All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter-/w4YWyX8dFk@public.gmane.org>
To: DRI Development
	<dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Cc: Daniel Vetter
	<daniel.vetter-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	Ben Skeggs <bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Emil Velikov
	<emil.velikov-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
Subject: [PATCH 5/7] drm/nouveau: Fill out gem_object->resv
Date: Tue, 25 Jun 2019 22:42:06 +0200	[thread overview]
Message-ID: <20190625204208.5614-6-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <20190625204208.5614-1-daniel.vetter-/w4YWyX8dFk@public.gmane.org>

That way we can ditch our gem_prime_res_obj implementation. Since ttm
absolutely needs the right reservation object all the boilerplate is
already there and we just have to wire it up correctly.

Note that gem/prime doesn't care when we do this, as long as we do it
before the bo is registered and someone can call the handle2fd ioctl
on it.

Aside: ttm_buffer_object.ttm_resv could probably be ditched in favour
of always passing a non-NULL resv to ttm_bo_init(). At least for gem
drivers that would avoid having two of these, on in ttm_buffer_object
and the other in drm_gem_object, one just there for confusion.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: nouveau@lists.freedesktop.org
---
 drivers/gpu/drm/nouveau/nouveau_bo.c    | 2 ++
 drivers/gpu/drm/nouveau/nouveau_drm.c   | 1 -
 drivers/gpu/drm/nouveau/nouveau_gem.h   | 1 -
 drivers/gpu/drm/nouveau/nouveau_prime.c | 7 -------
 4 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
index 34a998012bf6..6f1217b3e6b9 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bo.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
@@ -299,6 +299,8 @@ nouveau_bo_new(struct nouveau_cli *cli, u64 size, int align,
 			  type, &nvbo->placement,
 			  align >> PAGE_SHIFT, false, acc_size, sg,
 			  robj, nouveau_bo_del_ttm);
+	nvbo->gem.resv = nvbo->bo.resv;
+
 	if (ret) {
 		/* ttm will call nouveau_bo_del_ttm if it fails.. */
 		return ret;
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
index 4377b836265f..2c36319c158f 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -1131,7 +1131,6 @@ driver_stub = {
 	.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
 	.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
 	.gem_prime_pin = nouveau_gem_prime_pin,
-	.gem_prime_res_obj = nouveau_gem_prime_res_obj,
 	.gem_prime_unpin = nouveau_gem_prime_unpin,
 	.gem_prime_get_sg_table = nouveau_gem_prime_get_sg_table,
 	.gem_prime_import_sg_table = nouveau_gem_prime_import_sg_table,
diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.h b/drivers/gpu/drm/nouveau/nouveau_gem.h
index fe39998f65cc..9dea015387fd 100644
--- a/drivers/gpu/drm/nouveau/nouveau_gem.h
+++ b/drivers/gpu/drm/nouveau/nouveau_gem.h
@@ -33,7 +33,6 @@ extern int nouveau_gem_ioctl_info(struct drm_device *, void *,
 				  struct drm_file *);
 
 extern int nouveau_gem_prime_pin(struct drm_gem_object *);
-struct reservation_object *nouveau_gem_prime_res_obj(struct drm_gem_object *);
 extern void nouveau_gem_prime_unpin(struct drm_gem_object *);
 extern struct sg_table *nouveau_gem_prime_get_sg_table(struct drm_gem_object *);
 extern struct drm_gem_object *nouveau_gem_prime_import_sg_table(
diff --git a/drivers/gpu/drm/nouveau/nouveau_prime.c b/drivers/gpu/drm/nouveau/nouveau_prime.c
index 1fefc93af1d7..ec50017692d4 100644
--- a/drivers/gpu/drm/nouveau/nouveau_prime.c
+++ b/drivers/gpu/drm/nouveau/nouveau_prime.c
@@ -107,10 +107,3 @@ void nouveau_gem_prime_unpin(struct drm_gem_object *obj)
 
 	nouveau_bo_unpin(nvbo);
 }
-
-struct reservation_object *nouveau_gem_prime_res_obj(struct drm_gem_object *obj)
-{
-	struct nouveau_bo *nvbo = nouveau_gem_object(obj);
-
-	return nvbo->bo.resv;
-}
-- 
2.20.1

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

  parent reply	other threads:[~2019-06-25 20:42 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-25 20:42 [PATCH 0/7] gem_bo.resv prime unification, leftovers Daniel Vetter
2019-06-25 20:42 ` [PATCH 1/7] drm/fb-helper: use gem_bo.resv, not dma_buf.resv in prepare_fb Daniel Vetter
2019-06-25 20:50   ` Sam Ravnborg
2019-06-26  0:07   ` Eric Anholt
2019-06-25 20:42 ` [PATCH 2/7] drm/msm: Use drm_gem_fb_prepare_fb Daniel Vetter
2019-06-25 20:42   ` Daniel Vetter
2019-06-25 20:57   ` Rob Clark
2019-06-25 20:57     ` Rob Clark
2019-06-25 20:42 ` [PATCH 3/7] drm/vc4: " Daniel Vetter
2019-06-27  7:38   ` Daniel Vetter
     [not found] ` <20190625204208.5614-1-daniel.vetter-/w4YWyX8dFk@public.gmane.org>
2019-06-25 20:42   ` [PATCH 4/7] drm/radeon: Fill out gem_object->resv Daniel Vetter
     [not found]     ` <20190625204208.5614-5-daniel.vetter-/w4YWyX8dFk@public.gmane.org>
2019-06-25 20:52       ` Sam Ravnborg
2019-07-25 13:18         ` Daniel Vetter
2019-06-26  7:10       ` Koenig, Christian
     [not found]         ` <4cfa949e-1a20-149c-0758-e1bd97fd3cf5-5C7GfCeVMHo@public.gmane.org>
2019-06-26  8:23           ` Daniel Vetter
     [not found]             ` <20190626082312.GI12905-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2019-06-27  7:33               ` Daniel Vetter
     [not found]                 ` <20190627073350.GG12905-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2019-07-19 13:00                   ` Daniel Vetter
2019-06-25 20:42   ` Daniel Vetter [this message]
2019-06-25 20:42 ` [PATCH 6/7] drm/amdgpu: " Daniel Vetter
2019-06-25 20:42 ` [PATCH 7/7] drm/prime: Ditch gem_prime_res_obj hook Daniel Vetter
2019-06-26 10:04 ` [PATCH 0/7] gem_bo.resv prime unification, leftovers Mike Lothian
2019-06-27 12:16 ` Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190625204208.5614-6-daniel.vetter@ffwll.ch \
    --to=daniel.vetter-/w4ywyx8dfk@public.gmane.org \
    --cc=bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=daniel.vetter-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=emil.velikov-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org \
    --cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.