dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: "Hellstrom, Thomas" <thomas.hellstrom@intel.com>,
	"daniel@ffwll.ch" <daniel@ffwll.ch>
Cc: "dri-devel@lists.freedesktop.org" <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 1/9] drm/ttm: initialize the system domain with defaults
Date: Mon, 27 Jul 2020 14:23:11 +0200	[thread overview]
Message-ID: <419b0a05-63f7-3daa-8ebc-cc6636d8837b@amd.com> (raw)
In-Reply-To: <10da016f256f726b49c09f7440e0dc2c82809bbc.camel@intel.com>

Am 27.07.20 um 12:50 schrieb Hellstrom, Thomas:
> On Mon, 2020-07-27 at 12:39 +0200, Christian König wrote:
>> Am 27.07.20 um 11:42 schrieb daniel@ffwll.ch:
>>> On Thu, Jul 23, 2020 at 05:16:13PM +0200, Christian König wrote:
>>>> Instead of repeating that in each driver.
>>>>
>>>> Signed-off-by: Christian König <christian.koenig@amd.com>
>>>> ---
>>>>    drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c    | 3 ---
>>>>    drivers/gpu/drm/drm_gem_vram_helper.c      | 3 ---
>>>>    drivers/gpu/drm/nouveau/nouveau_bo.c       | 3 ---
>>>>    drivers/gpu/drm/qxl/qxl_ttm.c              | 3 ---
>>>>    drivers/gpu/drm/radeon/radeon_ttm.c        | 3 ---
>>>>    drivers/gpu/drm/ttm/ttm_bo.c               | 2 ++
>>>>    drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 2 --
>>>>    7 files changed, 2 insertions(+), 17 deletions(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>>>> index 0dd5e802091d..e57c49a91b73 100644
>>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>>>> @@ -84,9 +84,6 @@ static int amdgpu_init_mem_type(struct
>>>> ttm_bo_device *bdev, uint32_t type,
>>>>    	switch (type) {
>>>>    	case TTM_PL_SYSTEM:
>>>>    		/* System memory */
>>>> -		man->flags = 0;
>>>> -		man->available_caching = TTM_PL_MASK_CACHING;
>>>> -		man->default_caching = TTM_PL_FLAG_CACHED;
>>>>    		break;
>>>>    	case TTM_PL_TT:
>>>>    		/* GTT memory  */
>>>> diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c
>>>> b/drivers/gpu/drm/drm_gem_vram_helper.c
>>>> index 3296ed3df358..be177afdeb9a 100644
>>>> --- a/drivers/gpu/drm/drm_gem_vram_helper.c
>>>> +++ b/drivers/gpu/drm/drm_gem_vram_helper.c
>>>> @@ -1009,9 +1009,6 @@ static int bo_driver_init_mem_type(struct
>>>> ttm_bo_device *bdev, uint32_t type,
>>>>    {
>>>>    	switch (type) {
>>>>    	case TTM_PL_SYSTEM:
>>>> -		man->flags = 0;
>>>> -		man->available_caching = TTM_PL_MASK_CACHING;
>>>> -		man->default_caching = TTM_PL_FLAG_CACHED;
>>>>    		break;
>>>>    	case TTM_PL_VRAM:
>>>>    		man->func = &ttm_bo_manager_func;
>>>> diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c
>>>> b/drivers/gpu/drm/nouveau/nouveau_bo.c
>>>> index 4ccf937df0d0..53af25020bb2 100644
>>>> --- a/drivers/gpu/drm/nouveau/nouveau_bo.c
>>>> +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
>>>> @@ -655,9 +655,6 @@ nouveau_bo_init_mem_type(struct ttm_bo_device
>>>> *bdev, uint32_t type,
>>>>    
>>>>    	switch (type) {
>>>>    	case TTM_PL_SYSTEM:
>>>> -		man->flags = 0;
>>>> -		man->available_caching = TTM_PL_MASK_CACHING;
>>>> -		man->default_caching = TTM_PL_FLAG_CACHED;
>>>>    		break;
>>>>    	case TTM_PL_VRAM:
>>>>    		man->flags = TTM_MEMTYPE_FLAG_FIXED;
>>>> diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c
>>>> b/drivers/gpu/drm/qxl/qxl_ttm.c
>>>> index 1d8e07b8b19e..e9b8c921c1f0 100644
>>>> --- a/drivers/gpu/drm/qxl/qxl_ttm.c
>>>> +++ b/drivers/gpu/drm/qxl/qxl_ttm.c
>>>> @@ -54,9 +54,6 @@ static int qxl_init_mem_type(struct
>>>> ttm_bo_device *bdev, uint32_t type,
>>>>    	switch (type) {
>>>>    	case TTM_PL_SYSTEM:
>>>>    		/* System memory */
>>>> -		man->flags = 0;
>>>> -		man->available_caching = TTM_PL_MASK_CACHING;
>>>> -		man->default_caching = TTM_PL_FLAG_CACHED;
>>>>    		break;
>>>>    	case TTM_PL_VRAM:
>>>>    	case TTM_PL_PRIV:
>>>> diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c
>>>> b/drivers/gpu/drm/radeon/radeon_ttm.c
>>>> index b474781a0920..b4cb75361577 100644
>>>> --- a/drivers/gpu/drm/radeon/radeon_ttm.c
>>>> +++ b/drivers/gpu/drm/radeon/radeon_ttm.c
>>>> @@ -76,9 +76,6 @@ static int radeon_init_mem_type(struct
>>>> ttm_bo_device *bdev, uint32_t type,
>>>>    	switch (type) {
>>>>    	case TTM_PL_SYSTEM:
>>>>    		/* System memory */
>>>> -		man->flags = 0;
>>>> -		man->available_caching = TTM_PL_MASK_CACHING;
>>>> -		man->default_caching = TTM_PL_FLAG_CACHED;
>>>>    		break;
>>>>    	case TTM_PL_TT:
>>>>    		man->func = &ttm_bo_manager_func;
>>>> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c
>>>> b/drivers/gpu/drm/ttm/ttm_bo.c
>>>> index 7c02ce784805..1f1f9e463265 100644
>>>> --- a/drivers/gpu/drm/ttm/ttm_bo.c
>>>> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
>>>> @@ -1677,6 +1677,8 @@ int ttm_bo_device_init(struct ttm_bo_device
>>>> *bdev,
>>>>    	 * Initialize the system memory buffer type.
>>>>    	 * Other types need to be driver / IOCTL initialized.
>>>>    	 */
>>>> +	bdev->man[TTM_PL_SYSTEM].available_caching =
>>>> TTM_PL_MASK_CACHING;
>>>> +	bdev->man[TTM_PL_SYSTEM].default_caching = TTM_PL_FLAG_CACHED;
>>>>    	ret = ttm_bo_init_mm(bdev, TTM_PL_SYSTEM, 0);
>>>>    	if (unlikely(ret != 0))
>>>>    		goto out_no_sys;
>>>> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c
>>>> b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c
>>>> index 1d78187eaba6..00cef1a3a178 100644
>>>> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c
>>>> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c
>>>> @@ -742,8 +742,6 @@ static int vmw_init_mem_type(struct
>>>> ttm_bo_device *bdev, uint32_t type,
>>>>    	switch (type) {
>>>>    	case TTM_PL_SYSTEM:
>>>>    		/* System memory */
>>>> -		man->available_caching = TTM_PL_FLAG_CACHED;
>>> Above is CACHED, not CACHING, so needs to stay to overwrite the
>>> default.
>> Crap I missed that. Problem is that I wanted to remove the
>> possibility
>> to init the system domain with different caching attributes.
>>
>> I don't see how vmwgfx is every going to use this? Thomas do you
>> have
>> any idea what this was good for?
> I interpret that like vmwgfx can't handle any other caching attribute
> than 'cached'. But I can't see anyone feeding vmwgfx system memory
> buffers with other caching attributes. In that case, those would be
> ignored.

Yeah, agree. So any objections to change that setting in vmwgfx?

This way we could have the same settings for all drivers in the kernel 
and I don't see why any driver should have something special here.

Christian.

>
> /Thomas
>
>
>> Thanks,
>> Christian.
>>
>>> With that fixed:
>>>
>>> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>>>
>>>> -		man->default_caching = TTM_PL_FLAG_CACHED;
>>>>    		break;
>>>>    	case TTM_PL_VRAM:
>>>>    		/* "On-card" video ram */
>>>> -- 
>>>> 2.17.1
>>>>
>>>> _______________________________________________
>>>> dri-devel mailing list
>>>> dri-devel@lists.freedesktop.org
>>>> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fdri-devel&amp;data=02%7C01%7Cchristian.koenig%40amd.com%7C66991383884c46a79f4608d8321ae136%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637314438323255193&amp;sdata=Y86QJdnrTmhaG5Sx1NmKaeUbbOkrVvQQP%2BBB29SuA9I%3D&amp;reserved=0
> ----------------------------------------------------------------------
> Intel Sweden AB
> Registered Office: Isafjordsgatan 30B, 164 40 Kista, Stockholm, Sweden
> Registration Number: 556189-6027
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-07-27 12:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-23 15:16 [PATCH 1/9] drm/ttm: initialize the system domain with defaults Christian König
2020-07-23 15:16 ` [PATCH 2/9] drm/ttm: remove TTM_MEMTYPE_FLAG_FIXED Christian König
2020-07-27  9:48   ` daniel
2020-07-27  9:54     ` Christian König
2020-07-27 10:27       ` daniel
2020-07-23 15:16 ` [PATCH 3/9] drm/radeon: stop implementing init_mem_type Christian König
2020-07-27 10:30   ` daniel
2020-07-27 10:30     ` daniel
2020-07-27 10:54     ` Christian König
2020-07-27  9:42 ` [PATCH 1/9] drm/ttm: initialize the system domain with defaults daniel
2020-07-27 10:39   ` Christian König
2020-07-27 10:50     ` Hellstrom, Thomas
2020-07-27 12:23       ` Christian König [this message]
2020-07-27 13:01         ` Hellstrom, Thomas
2020-07-23 15:17 More TTM cleanups Christian König
2020-07-23 15:17 ` [PATCH 1/9] drm/ttm: initialize the system domain with defaults Christian König
2020-07-24  6:43   ` Thomas Zimmermann
2020-07-29  6:21     ` Dave Airlie
2020-07-29  6:23       ` Dave Airlie
2020-07-29  9:47         ` 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=419b0a05-63f7-3daa-8ebc-cc6636d8837b@amd.com \
    --to=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=thomas.hellstrom@intel.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 NNTP newsgroup(s).