From: Tan Xiaojun <tanxiaojun@huawei.com> To: <christian.koenig@amd.com>, <seanpaul@chromium.org>, <airlied@linux.ie>, <michel.daenzer@amd.com>, <alexander.deucher@amd.com>, <nicolai.haehnle@amd.com>, <thomas.lendacky@amd.com>, <yamada.masahiro@socionext.com>, <msrb@suse.com>, <Felix.Kuehling@amd.com>, <dave.jiang@intel.com>, <gregkh@linuxfoundation.org>, <michael.thayer@oracle.com>, <hdegoede@redhat.com> Cc: <daniel.vetter@intel.com>, <dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org> Subject: Re: [PATCH 01/12] drm/ttm: Use ttm_bo_default_io_mem_pfn if io_mem_pfn is NULL Date: Mon, 25 Dec 2017 09:24:30 +0800 [thread overview] Message-ID: <5A40534E.9070802@huawei.com> (raw) In-Reply-To: <7542197c-a821-a5d2-1abd-449c823c53e5@gmail.com> On 2017/12/24 17:27, Christian König wrote: > Am 24.12.2017 um 07:14 schrieb Tan Xiaojun: >> From: Michal Srb <msrb@suse.com> >> >> 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 c8ebb75..e25a99b 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); > > Please move this check into a new function ttm_bo_io_mem_pfn(). > > You can then move the calculation of ttm_bo_default_io_mem_pfn() into this new function in patch #12 as well. > > Regards, > Christian. > OK. Thank you for your reply. I will modify it and send v2. Thanks. Xiaojun. >> } else { >> page = ttm->pages[page_offset]; >> if (unlikely(!page && i == 0)) { > > > . >
WARNING: multiple messages have this Message-ID (diff)
From: Tan Xiaojun <tanxiaojun@huawei.com> To: christian.koenig@amd.com, seanpaul@chromium.org, airlied@linux.ie, michel.daenzer@amd.com, alexander.deucher@amd.com, nicolai.haehnle@amd.com, thomas.lendacky@amd.com, yamada.masahiro@socionext.com, msrb@suse.com, Felix.Kuehling@amd.com, dave.jiang@intel.com, gregkh@linuxfoundation.org, michael.thayer@oracle.com, hdegoede@redhat.com Cc: daniel.vetter@intel.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: Re: [PATCH 01/12] drm/ttm: Use ttm_bo_default_io_mem_pfn if io_mem_pfn is NULL Date: Mon, 25 Dec 2017 09:24:30 +0800 [thread overview] Message-ID: <5A40534E.9070802@huawei.com> (raw) In-Reply-To: <7542197c-a821-a5d2-1abd-449c823c53e5@gmail.com> On 2017/12/24 17:27, Christian König wrote: > Am 24.12.2017 um 07:14 schrieb Tan Xiaojun: >> From: Michal Srb <msrb@suse.com> >> >> 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 c8ebb75..e25a99b 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); > > Please move this check into a new function ttm_bo_io_mem_pfn(). > > You can then move the calculation of ttm_bo_default_io_mem_pfn() into this new function in patch #12 as well. > > Regards, > Christian. > OK. Thank you for your reply. I will modify it and send v2. Thanks. Xiaojun. >> } else { >> page = ttm->pages[page_offset]; >> if (unlikely(!page && i == 0)) { > > > . > _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2017-12-25 1:24 UTC|newest] Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top 2017-12-24 6:14 [PATCH 00/12] drm: add check if io_mem_pfn is NULL and cleanup Tan Xiaojun 2017-12-24 6:14 ` Tan Xiaojun 2017-12-24 6:14 ` [PATCH 01/12] drm/ttm: Use ttm_bo_default_io_mem_pfn if io_mem_pfn is NULL Tan Xiaojun 2017-12-24 6:14 ` Tan Xiaojun 2017-12-24 9:27 ` Christian König 2017-12-24 9:27 ` Christian König 2017-12-25 1:24 ` Tan Xiaojun [this message] 2017-12-25 1:24 ` Tan Xiaojun 2017-12-24 6:14 ` [PATCH 02/12] drm/ast: remove the default io_mem_pfn set Tan Xiaojun 2017-12-24 6:14 ` Tan Xiaojun 2017-12-24 6:14 ` [PATCH 03/12] drm/bochs: " Tan Xiaojun 2017-12-24 6:14 ` Tan Xiaojun 2017-12-24 6:14 ` [PATCH 04/12] drm/cirrus: " Tan Xiaojun 2017-12-24 6:14 ` Tan Xiaojun 2017-12-24 6:14 ` [PATCH 05/12] drm/mgag200: " Tan Xiaojun 2017-12-24 6:14 ` Tan Xiaojun 2017-12-24 6:14 ` [PATCH 06/12] drm/nouveau: " Tan Xiaojun 2017-12-24 6:14 ` Tan Xiaojun 2017-12-24 6:14 ` [PATCH 07/12] drm/qxl: " Tan Xiaojun 2017-12-24 6:14 ` Tan Xiaojun 2017-12-24 6:14 ` [PATCH 08/12] drm/radeon: " Tan Xiaojun 2017-12-24 6:14 ` Tan Xiaojun 2017-12-24 6:14 ` [PATCH 09/12] drm/virtio: " Tan Xiaojun 2017-12-24 6:14 ` Tan Xiaojun 2017-12-24 6:14 ` [PATCH 10/12] drm/vmwgfx: " Tan Xiaojun 2017-12-24 6:14 ` Tan Xiaojun 2017-12-24 6:14 ` [PATCH 11/12] staging: " Tan Xiaojun 2017-12-24 6:14 ` Tan Xiaojun 2017-12-24 6:14 ` [PATCH 12/12] drm/ttm: unexport ttm_bo_default_io_mem_pfn and make it static Tan Xiaojun 2017-12-24 6:14 ` Tan Xiaojun
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=5A40534E.9070802@huawei.com \ --to=tanxiaojun@huawei.com \ --cc=Felix.Kuehling@amd.com \ --cc=airlied@linux.ie \ --cc=alexander.deucher@amd.com \ --cc=christian.koenig@amd.com \ --cc=daniel.vetter@intel.com \ --cc=dave.jiang@intel.com \ --cc=dri-devel@lists.freedesktop.org \ --cc=gregkh@linuxfoundation.org \ --cc=hdegoede@redhat.com \ --cc=linux-kernel@vger.kernel.org \ --cc=michael.thayer@oracle.com \ --cc=michel.daenzer@amd.com \ --cc=msrb@suse.com \ --cc=nicolai.haehnle@amd.com \ --cc=seanpaul@chromium.org \ --cc=thomas.lendacky@amd.com \ --cc=yamada.masahiro@socionext.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: linkBe 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.