dri-devel Archive mirror
 help / color / mirror / Atom feed
From: Zack Rusin <zackr@vmware.com>
To: <dri-devel@lists.freedesktop.org>
Cc: Martin Krastev <krastevm@vmware.com>
Subject: [PATCH 6/9] drm/vmwgfx: inline access to the pages from the piter
Date: Wed, 9 Jun 2021 13:23:04 -0400	[thread overview]
Message-ID: <20210609172307.131929-7-zackr@vmware.com> (raw)
In-Reply-To: <20210609172307.131929-1-zackr@vmware.com>

The indirection doesn't make sense because we always go through
the same function pointer. Instead of the extra indirection
lets inline the access to the current page.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Martin Krastev <krastevm@vmware.com>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.h        |  3 +--
 drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 16 ----------------
 2 files changed, 1 insertion(+), 18 deletions(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
index 31519b78cb6a..3875cfbf1791 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
@@ -358,7 +358,6 @@ struct vmw_piter {
 	unsigned long num_pages;
 	bool (*next)(struct vmw_piter *);
 	dma_addr_t (*dma_address)(struct vmw_piter *);
-	struct page *(*page)(struct vmw_piter *);
 };
 
 /*
@@ -1088,7 +1087,7 @@ static inline dma_addr_t vmw_piter_dma_addr(struct vmw_piter *viter)
  */
 static inline struct page *vmw_piter_page(struct vmw_piter *viter)
 {
-	return viter->page(viter);
+	return viter->pages[viter->i];
 }
 
 /**
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c
index a6015f2a297f..b0973c27e774 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c
@@ -222,21 +222,6 @@ static bool __vmw_piter_sg_next(struct vmw_piter *viter)
 }
 
 
-/**
- * __vmw_piter_non_sg_page: Helper functions to return a pointer
- * to the current page.
- *
- * @viter: Pointer to the iterator
- *
- * These functions return a pointer to the page currently
- * pointed to by @viter. Functions are selected depending on the
- * current mapping mode.
- */
-static struct page *__vmw_piter_non_sg_page(struct vmw_piter *viter)
-{
-	return viter->pages[viter->i];
-}
-
 static dma_addr_t __vmw_piter_dma_addr(struct vmw_piter *viter)
 {
 	return viter->addrs[viter->i];
@@ -264,7 +249,6 @@ void vmw_piter_start(struct vmw_piter *viter, const struct vmw_sg_table *vsgt,
 {
 	viter->i = p_offset - 1;
 	viter->num_pages = vsgt->num_pages;
-	viter->page = &__vmw_piter_non_sg_page;
 	viter->pages = vsgt->pages;
 	switch (vsgt->mode) {
 	case vmw_dma_alloc_coherent:
-- 
2.30.2


  parent reply	other threads:[~2021-06-09 17:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09 17:22 [PATCH 0/9] Adding support for mks-stats and some cleanups/fixes Zack Rusin
2021-06-09 17:22 ` [PATCH 1/9] drm/vmwgfx: Simplify devcaps code Zack Rusin
2021-06-09 17:23 ` [PATCH 2/9] drm/vmwgfx: Introduce VMware mks-guest-stats Zack Rusin
2021-06-09 17:23 ` [PATCH 3/9] drm/vmwgfx: Fix subresource updates with new contexts Zack Rusin
2021-06-10  6:49   ` Thomas Hellström (Intel)
2021-06-10 16:59     ` Zack Rusin
2021-06-09 17:23 ` [PATCH 4/9] drm/vmwgfx: Fix some static checker warnings Zack Rusin
2021-06-09 17:23 ` [PATCH 5/9] drm/vmwgfx: remove code that was using physical page addresses Zack Rusin
2021-06-09 17:23 ` Zack Rusin [this message]
2021-06-09 17:23 ` [PATCH 7/9] drm/vmwgfx: Refactor vmw_mksstat_remove_ioctl to expect pgid match with vmw_mksstat_add_ioctl to authorise removal Zack Rusin
2021-06-09 17:23 ` [PATCH 8/9] drm/vmwgfx: Remove vmw_chipset Zack Rusin
2021-06-09 17:23 ` [PATCH 9/9] drm/vmwgfx: Fix implicit declaration error Zack Rusin
2021-06-09 17:24   ` 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=20210609172307.131929-7-zackr@vmware.com \
    --to=zackr@vmware.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=krastevm@vmware.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 read-only IMAP folder(s) and NNTP newsgroup(s).