dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Dave Airlie <airlied@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: christian.koenig@amd.com, rscheidegger.oss@gmail.com
Subject: [PATCH 1/5] drm/qxl: drop unused code (v2)
Date: Tue,  6 Oct 2020 10:06:40 +1000	[thread overview]
Message-ID: <20201006000644.1005758-2-airlied@gmail.com> (raw)
In-Reply-To: <20201006000644.1005758-1-airlied@gmail.com>

From: Dave Airlie <airlied@redhat.com>

v2: drop the wrapper struct
Signed-off-by: Dave Airlie <airlied@redhat.com>
---
 drivers/gpu/drm/qxl/qxl_ttm.c | 29 ++++++++---------------------
 1 file changed, 8 insertions(+), 21 deletions(-)

diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c
index 2c35ca4270c6..669bceb58205 100644
--- a/drivers/gpu/drm/qxl/qxl_ttm.c
+++ b/drivers/gpu/drm/qxl/qxl_ttm.c
@@ -98,19 +98,11 @@ int qxl_ttm_io_mem_reserve(struct ttm_bo_device *bdev,
 /*
  * TTM backend functions.
  */
-struct qxl_ttm_tt {
-	struct ttm_tt		        ttm;
-	struct qxl_device		*qdev;
-	u64				offset;
-};
 
 static int qxl_ttm_backend_bind(struct ttm_bo_device *bdev,
 				struct ttm_tt *ttm,
 				struct ttm_resource *bo_mem)
 {
-	struct qxl_ttm_tt *gtt = (void *)ttm;
-
-	gtt->offset = (unsigned long)(bo_mem->start << PAGE_SHIFT);
 	if (!ttm->num_pages) {
 		WARN(1, "nothing to bind %lu pages for mreg %p back %p!\n",
 		     ttm->num_pages, bo_mem, ttm);
@@ -128,29 +120,24 @@ static void qxl_ttm_backend_unbind(struct ttm_bo_device *bdev,
 static void qxl_ttm_backend_destroy(struct ttm_bo_device *bdev,
 				    struct ttm_tt *ttm)
 {
-	struct qxl_ttm_tt *gtt = (void *)ttm;
-
 	ttm_tt_destroy_common(bdev, ttm);
-	ttm_tt_fini(&gtt->ttm);
-	kfree(gtt);
+	ttm_tt_fini(ttm);
+	kfree(ttm);
 }
 
 static struct ttm_tt *qxl_ttm_tt_create(struct ttm_buffer_object *bo,
 					uint32_t page_flags)
 {
-	struct qxl_device *qdev;
-	struct qxl_ttm_tt *gtt;
+	struct ttm_tt *ttm;
 
-	qdev = qxl_get_qdev(bo->bdev);
-	gtt = kzalloc(sizeof(struct qxl_ttm_tt), GFP_KERNEL);
-	if (gtt == NULL)
+	ttm = kzalloc(sizeof(struct ttm_tt), GFP_KERNEL);
+	if (ttm == NULL)
 		return NULL;
-	gtt->qdev = qdev;
-	if (ttm_tt_init(&gtt->ttm, bo, page_flags)) {
-		kfree(gtt);
+	if (ttm_tt_init(ttm, bo, page_flags)) {
+		kfree(ttm);
 		return NULL;
 	}
-	return &gtt->ttm;
+	return ttm;
 }
 
 static int qxl_bo_move(struct ttm_buffer_object *bo, bool evict,
-- 
2.27.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-10-06  0:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-06  0:06 [PATCH 0/5] ttm make move callback compulsory Dave Airlie
2020-10-06  0:06 ` Dave Airlie [this message]
2020-10-06  0:06 ` [PATCH 2/5] drm/vmwgfx: move null mem checks outside move notifies Dave Airlie
2020-10-08  3:39   ` Zack Rusin
2020-10-06  0:06 ` [PATCH 3/5] drm/vmwgfx: add a move callback Dave Airlie
2020-10-08  3:41   ` Zack Rusin
2020-10-08  4:02     ` Dave Airlie
2020-10-08 15:35   ` Roland Scheidegger
2020-10-06  0:06 ` [PATCH 4/5] drm/vram_helper: implement a ttm " Dave Airlie
2020-10-06  0:06 ` [PATCH 5/5] drm/ttm: make move callback compulstory Dave Airlie
2020-10-06 10:29 ` [PATCH 0/5] ttm make move callback compulsory Christian König

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=20201006000644.1005758-2-airlied@gmail.com \
    --to=airlied@gmail.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=rscheidegger.oss@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).