From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Dave Airlie <airlied@gmail.com>,
dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 1/2] drm/ttm: init mem->bus in common code.
Date: Tue, 11 Aug 2020 10:42:25 +0200 [thread overview]
Message-ID: <ceca6880-201f-a4b1-4d07-caac3e570e93@gmail.com> (raw)
In-Reply-To: <CAPM=9tw2nZB569FUw_KGhhP07m0n8ZugcFNrAsa0kn+9xtndsg@mail.gmail.com>
I've totally missed those and still don't see any reference in any inbox
to the original mail or patch #2 in this series.
But this patch at least looks like it makes a lot of sense.
BTW: Does anybody know why we separate base and offset here? That
distinction seems to be superfluous as well.
Christian.
Am 11.08.20 um 10:02 schrieb Dave Airlie:
> (cc'ing Christian, just in case he misses them). 2 small cleanups.
>
> On Tue, 11 Aug 2020 at 17:47, Dave Airlie <airlied@gmail.com> wrote:
>> From: Dave Airlie <airlied@redhat.com>
>>
>> The drivers all do the same thing here.
>>
>> Signed-off-by: Dave Airlie <airlied@redhat.com>
>> ---
>> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 6 ------
>> drivers/gpu/drm/drm_gem_vram_helper.c | 6 ------
>> drivers/gpu/drm/nouveau/nouveau_bo.c | 6 ------
>> drivers/gpu/drm/qxl/qxl_ttm.c | 6 ------
>> drivers/gpu/drm/radeon/radeon_ttm.c | 6 ------
>> drivers/gpu/drm/ttm/ttm_bo_util.c | 5 +++++
>> drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 6 ------
>> 7 files changed, 5 insertions(+), 36 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>> index 67d2eef2f9eb..324abf7a3cba 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>> @@ -751,12 +751,6 @@ static int amdgpu_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_reso
>> struct amdgpu_device *adev = amdgpu_ttm_adev(bdev);
>> struct drm_mm_node *mm_node = mem->mm_node;
>>
>> - mem->bus.addr = NULL;
>> - mem->bus.offset = 0;
>> - mem->bus.size = mem->num_pages << PAGE_SHIFT;
>> - mem->bus.base = 0;
>> - mem->bus.is_iomem = false;
>> -
>> switch (mem->mem_type) {
>> case TTM_PL_SYSTEM:
>> /* system memory */
>> diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c
>> index b410930d94a0..545a877406f4 100644
>> --- a/drivers/gpu/drm/drm_gem_vram_helper.c
>> +++ b/drivers/gpu/drm/drm_gem_vram_helper.c
>> @@ -1038,14 +1038,8 @@ static int bo_driver_io_mem_reserve(struct ttm_bo_device *bdev,
>> {
>> struct drm_vram_mm *vmm = drm_vram_mm_of_bdev(bdev);
>>
>> - mem->bus.addr = NULL;
>> - mem->bus.size = mem->num_pages << PAGE_SHIFT;
>> -
>> switch (mem->mem_type) {
>> case TTM_PL_SYSTEM: /* nothing to do */
>> - mem->bus.offset = 0;
>> - mem->bus.base = 0;
>> - mem->bus.is_iomem = false;
>> break;
>> case TTM_PL_VRAM:
>> mem->bus.offset = mem->start << PAGE_SHIFT;
>> diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
>> index 604a74323696..7cfe3898ce62 100644
>> --- a/drivers/gpu/drm/nouveau/nouveau_bo.c
>> +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
>> @@ -1380,12 +1380,6 @@ nouveau_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_resource *reg)
>> struct nvkm_device *device = nvxx_device(&drm->client.device);
>> struct nouveau_mem *mem = nouveau_mem(reg);
>>
>> - reg->bus.addr = NULL;
>> - reg->bus.offset = 0;
>> - reg->bus.size = reg->num_pages << PAGE_SHIFT;
>> - reg->bus.base = 0;
>> - reg->bus.is_iomem = false;
>> -
>> switch (reg->mem_type) {
>> case TTM_PL_SYSTEM:
>> /* System memory */
>> diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c
>> index b1ea984f143a..c55ac31f5476 100644
>> --- a/drivers/gpu/drm/qxl/qxl_ttm.c
>> +++ b/drivers/gpu/drm/qxl/qxl_ttm.c
>> @@ -75,12 +75,6 @@ int qxl_ttm_io_mem_reserve(struct ttm_bo_device *bdev,
>> {
>> struct qxl_device *qdev = qxl_get_qdev(bdev);
>>
>> - mem->bus.addr = NULL;
>> - mem->bus.offset = 0;
>> - mem->bus.size = mem->num_pages << PAGE_SHIFT;
>> - mem->bus.base = 0;
>> - mem->bus.is_iomem = false;
>> -
>> switch (mem->mem_type) {
>> case TTM_PL_SYSTEM:
>> /* system memory */
>> diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
>> index 3355b69b13d1..1f1e025b9f06 100644
>> --- a/drivers/gpu/drm/radeon/radeon_ttm.c
>> +++ b/drivers/gpu/drm/radeon/radeon_ttm.c
>> @@ -380,12 +380,6 @@ static int radeon_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_reso
>> {
>> struct radeon_device *rdev = radeon_get_rdev(bdev);
>>
>> - mem->bus.addr = NULL;
>> - mem->bus.offset = 0;
>> - mem->bus.size = mem->num_pages << PAGE_SHIFT;
>> - mem->bus.base = 0;
>> - mem->bus.is_iomem = false;
>> -
>> switch (mem->mem_type) {
>> case TTM_PL_SYSTEM:
>> /* system memory */
>> diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
>> index 496158acd5b9..023f0a2d07c9 100644
>> --- a/drivers/gpu/drm/ttm/ttm_bo_util.c
>> +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
>> @@ -138,6 +138,11 @@ int ttm_mem_io_reserve(struct ttm_bo_device *bdev,
>> if (!bdev->driver->io_mem_reserve)
>> return 0;
>>
>> + mem->bus.addr = NULL;
>> + mem->bus.offset = 0;
>> + mem->bus.size = mem->num_pages << PAGE_SHIFT;
>> + mem->bus.base = 0;
>> + mem->bus.is_iomem = false;
>> retry:
>> ret = bdev->driver->io_mem_reserve(bdev, mem);
>> if (ret == -ENOSPC) {
>> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c
>> index 69e7e7fe2a4c..6ae4a856241b 100644
>> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c
>> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c
>> @@ -717,12 +717,6 @@ static int vmw_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_resourc
>> {
>> struct vmw_private *dev_priv = container_of(bdev, struct vmw_private, bdev);
>>
>> - mem->bus.addr = NULL;
>> - mem->bus.is_iomem = false;
>> - mem->bus.offset = 0;
>> - mem->bus.size = mem->num_pages << PAGE_SHIFT;
>> - mem->bus.base = 0;
>> -
>> switch (mem->mem_type) {
>> case TTM_PL_SYSTEM:
>> case VMW_PL_GMR:
>> --
>> 2.27.0
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2020-08-11 8:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-11 7:46 [PATCH 1/2] drm/ttm: init mem->bus in common code Dave Airlie
2020-08-11 7:46 ` [PATCH 2/2] drm/ttm: drop bus.size from bus placement Dave Airlie
2020-08-11 8:02 ` [PATCH 1/2] drm/ttm: init mem->bus in common code Dave Airlie
2020-08-11 8:42 ` Christian König [this message]
2020-08-11 8:49 ` Dave Airlie
2020-08-11 8:53 ` 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=ceca6880-201f-a4b1-4d07-caac3e570e93@gmail.com \
--to=ckoenig.leichtzumerken@gmail.com \
--cc=airlied@gmail.com \
--cc=christian.koenig@amd.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.