Skip to content

Commit 8d9a8d9

Browse files
committed
drm/vmwgfx: inline access to the pages from the piter
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 <[email protected]> Reviewed-by: Martin Krastev <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent f674a21 commit 8d9a8d9

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

drivers/gpu/drm/vmwgfx/vmwgfx_drv.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,6 @@ struct vmw_piter {
358358
unsigned long num_pages;
359359
bool (*next)(struct vmw_piter *);
360360
dma_addr_t (*dma_address)(struct vmw_piter *);
361-
struct page *(*page)(struct vmw_piter *);
362361
};
363362

364363
/*
@@ -1088,7 +1087,7 @@ static inline dma_addr_t vmw_piter_dma_addr(struct vmw_piter *viter)
10881087
*/
10891088
static inline struct page *vmw_piter_page(struct vmw_piter *viter)
10901089
{
1091-
return viter->page(viter);
1090+
return viter->pages[viter->i];
10921091
}
10931092

10941093
/**

drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -222,21 +222,6 @@ static bool __vmw_piter_sg_next(struct vmw_piter *viter)
222222
}
223223

224224

225-
/**
226-
* __vmw_piter_non_sg_page: Helper functions to return a pointer
227-
* to the current page.
228-
*
229-
* @viter: Pointer to the iterator
230-
*
231-
* These functions return a pointer to the page currently
232-
* pointed to by @viter. Functions are selected depending on the
233-
* current mapping mode.
234-
*/
235-
static struct page *__vmw_piter_non_sg_page(struct vmw_piter *viter)
236-
{
237-
return viter->pages[viter->i];
238-
}
239-
240225
static dma_addr_t __vmw_piter_dma_addr(struct vmw_piter *viter)
241226
{
242227
return viter->addrs[viter->i];
@@ -264,7 +249,6 @@ void vmw_piter_start(struct vmw_piter *viter, const struct vmw_sg_table *vsgt,
264249
{
265250
viter->i = p_offset - 1;
266251
viter->num_pages = vsgt->num_pages;
267-
viter->page = &__vmw_piter_non_sg_page;
268252
viter->pages = vsgt->pages;
269253
switch (vsgt->mode) {
270254
case vmw_dma_alloc_coherent:

0 commit comments

Comments
 (0)