From: Michal Srb <msrb@suse.com>
To: dri-devel@lists.freedesktop.org
Subject: [PATCH] drm/ttm: Use ttm_bo_default_io_mem_pfn if io_mem_pfn is NULL
Date: Wed, 29 Nov 2017 16:20:01 +0100 [thread overview]
Message-ID: <20171129152001.29669-1-msrb@suse.com> (raw)
In-Reply-To: <20171129144730.n7ir4bugdxamhqod@art_vandelay>
The io_mem_pfn field was added in commit ea642c3216cb2a60d1c0e760ae47ee85c9c16447
and is called unconditionally. However, not all drivers were updated to set it.
Use the ttm_bo_default_io_mem_pfn function if a driver did not set its own.
Signed-off-by: Michal Srb <msrb@suse.com>
---
drivers/gpu/drm/ttm/ttm_bo_vm.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/ttm/ttm_bo_vm.c b/drivers/gpu/drm/ttm/ttm_bo_vm.c
index c8ebb757e36b..e25a99bc519d 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_vm.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_vm.c
@@ -234,7 +234,10 @@ static int ttm_bo_vm_fault(struct vm_fault *vmf)
if (bo->mem.bus.is_iomem) {
/* Iomem should not be marked encrypted */
cvma.vm_page_prot = pgprot_decrypted(cvma.vm_page_prot);
- pfn = bdev->driver->io_mem_pfn(bo, page_offset);
+ if (bdev->driver->io_mem_pfn)
+ pfn = bdev->driver->io_mem_pfn(bo, page_offset);
+ else
+ pfn = ttm_bo_default_io_mem_pfn(bo, page_offset);
} else {
page = ttm->pages[page_offset];
if (unlikely(!page && i == 0)) {
--
2.13.6
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2017-11-29 15:20 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-29 11:33 [PATCH] drm: hibmc: Initialize the hibmc_bo_driver.io_mem_pfn msrb
2017-11-29 14:47 ` Sean Paul
2017-11-29 14:54 ` Michal Srb
2017-11-29 15:20 ` Michal Srb [this message]
2017-11-29 15:24 ` [PATCH] drm/ttm: Use ttm_bo_default_io_mem_pfn if io_mem_pfn is NULL Christian König
2017-11-29 15:29 ` Michal Srb
2017-11-29 15:36 ` Sean Paul
2017-11-29 15:40 ` Christian König
2017-11-29 15:44 ` Sean Paul
2017-11-29 15:59 ` Christian König
2017-11-29 16:13 ` Sean Paul
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=20171129152001.29669-1-msrb@suse.com \
--to=msrb@suse.com \
--cc=dri-devel@lists.freedesktop.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.