raof at ubuntu.com
2017-Mar-29 00:27 UTC
[Nouveau] [PATCH 2/6] drm/nouveau: Pin bos from imported dma-bufs to GTT.
From: Christopher James Halse Rogers <christopher.halse.rogers at canonical.com> Attempting to migrate the bo will break the sharing of the buffer. Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers at canonical.com> CC: nouveau at lists.freedesktop.org --- drivers/gpu/drm/nouveau/nouveau_prime.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/nouveau/nouveau_prime.c b/drivers/gpu/drm/nouveau/nouveau_prime.c index 1fefc93af1d7..5f474ebb4d6d 100644 --- a/drivers/gpu/drm/nouveau/nouveau_prime.c +++ b/drivers/gpu/drm/nouveau/nouveau_prime.c @@ -76,6 +76,8 @@ struct drm_gem_object *nouveau_gem_prime_import_sg_table(struct drm_device *dev, return ERR_PTR(ret); nvbo->valid_domains = NOUVEAU_GEM_DOMAIN_GART; + /* pin imported buffer to GTT */ + nouveau_bo_pin(nvbo, TTM_PL_FLAG_TT, false); /* Initialize the embedded gem-object. We return a single gem-reference * to the caller, instead of a normal nouveau_bo ttm reference. */ -- 2.11.0
Maarten Lankhorst
2017-Mar-29 08:45 UTC
[Nouveau] [PATCH 2/6] drm/nouveau: Pin bos from imported dma-bufs to GTT.
Op 29-03-17 om 02:27 schreef raof at ubuntu.com:> From: Christopher James Halse Rogers <christopher.halse.rogers at canonical.com> > > Attempting to migrate the bo will break the sharing of the buffer. > > Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers at canonical.com> > CC: nouveau at lists.freedesktop.org > --- > drivers/gpu/drm/nouveau/nouveau_prime.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/gpu/drm/nouveau/nouveau_prime.c b/drivers/gpu/drm/nouveau/nouveau_prime.c > index 1fefc93af1d7..5f474ebb4d6d 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_prime.c > +++ b/drivers/gpu/drm/nouveau/nouveau_prime.c > @@ -76,6 +76,8 @@ struct drm_gem_object *nouveau_gem_prime_import_sg_table(struct drm_device *dev, > return ERR_PTR(ret); > > nvbo->valid_domains = NOUVEAU_GEM_DOMAIN_GART; > + /* pin imported buffer to GTT */ > + nouveau_bo_pin(nvbo, TTM_PL_FLAG_TT, false); > > /* Initialize the embedded gem-object. We return a single gem-reference > * to the caller, instead of a normal nouveau_bo ttm reference. */Missing error handling here?
raof at ubuntu.com
2017-Apr-03 05:56 UTC
[Nouveau] [PATCH 2/6 v2] drm/nouveau: Pin bos from imported dma-bufs to GTT. (v2)
From: Christopher James Halse Rogers <christopher.halse.rogers at canonical.com> Attempting to migrate the bo will break the sharing of the buffer. v2: Error-check the nouveau_bo_pin call; it can fail. Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers at canonical.com> --- drivers/gpu/drm/nouveau/nouveau_prime.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/nouveau/nouveau_prime.c b/drivers/gpu/drm/nouveau/nouveau_prime.c index 1fefc93af1d7..ad5eaf70c8e2 100644 --- a/drivers/gpu/drm/nouveau/nouveau_prime.c +++ b/drivers/gpu/drm/nouveau/nouveau_prime.c @@ -76,6 +76,12 @@ struct drm_gem_object *nouveau_gem_prime_import_sg_table(struct drm_device *dev, return ERR_PTR(ret); nvbo->valid_domains = NOUVEAU_GEM_DOMAIN_GART; + /* pin imported buffer to GTT */ + ret = nouveau_bo_pin(nvbo, TTM_PL_FLAG_TT, false); + if (ret) { + nouveau_bo_ref(NULL, &nvbo); + return ERR_PTR(ret); + } /* Initialize the embedded gem-object. We return a single gem-reference * to the caller, instead of a normal nouveau_bo ttm reference. */ -- 2.11.0
Maybe Matching Threads
- [PATCH 2/4] drm/nouveau: Fill out gem_object->resv
- [PATCH 1/5] drm/prime: Remove duplicate forward declaration
- [PATCH 1/6] drm/nouveau: Fail fb creation from imported dma-bufs.
- [PATCH 0/4] drm/nouveau: Miscellaneous fixes
- [PATCH 09/20] drm/nouveau: Introduce GEM object functions