All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: airlied@linux.ie, nouveau@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org,
	virtualization@lists.linux-foundation.org, kraxel@redhat.com,
	spice-devel@lists.freedesktop.org, bskeggs@redhat.com
Subject: Re: [Nouveau] [PATCH 0/4] drm: Generic dumb_map_offset for TTM-based drivers
Date: Thu, 8 Apr 2021 13:34:03 +0200	[thread overview]
Message-ID: <52dd3e3f-a893-3d90-e642-df01a033490a@suse.de> (raw)
In-Reply-To: <YG7mHvmhPZIPA37B@phenom.ffwll.local>


[-- Attachment #1.1.1: Type: text/plain, Size: 2019 bytes --]

Hi

Am 08.04.21 um 13:16 schrieb Daniel Vetter:
> On Tue, Apr 06, 2021 at 10:29:38AM +0200, Thomas Zimmermann wrote:
>> The implementation of drm_driver.dumb_map_offset is the same for several
>> TTM-based drivers. Provide a common function in GEM-TTM helpers.
> 
> Out of curiosity, why does this not fit for radeon/amdgpu?

These drivers perform additional permission checks in their implementations.

But those checks are also part of the actual mmap code. I want to 
propose a patch to use the generic drm_gem_ttm_map_offset in 
amdgpu/radeon, and then rely on mmap to fail if necessary. It might 
result in a longer discussion, so that's for another patchset.

Best regards
Thomas

> -Daniel
> 
>>
>> Thomas Zimmermann (4):
>>    drm/gem-ttm-helper: Provide helper for struct
>>      drm_driver.dumb_map_offset
>>    drm/vram-helper: Use drm_gem_ttm_dumb_map_offset()
>>    drm/nouveau: Use drm_gem_ttm_dumb_map_offset()
>>    drm/qxl: Use drm_gem_ttm_dumb_map_offset()
>>
>>   drivers/gpu/drm/drm_gem_ttm_helper.c      | 33 ++++++++++++++++
>>   drivers/gpu/drm/drm_gem_vram_helper.c     | 48 -----------------------
>>   drivers/gpu/drm/nouveau/nouveau_display.c | 18 ---------
>>   drivers/gpu/drm/nouveau/nouveau_display.h |  2 -
>>   drivers/gpu/drm/nouveau/nouveau_drm.c     |  3 +-
>>   drivers/gpu/drm/qxl/qxl_drv.c             |  3 +-
>>   drivers/gpu/drm/qxl/qxl_drv.h             |  3 --
>>   drivers/gpu/drm/qxl/qxl_dumb.c            | 17 --------
>>   drivers/gpu/drm/qxl/qxl_ioctl.c           |  4 +-
>>   drivers/gpu/drm/qxl/qxl_object.h          |  5 ---
>>   include/drm/drm_gem_ttm_helper.h          |  5 ++-
>>   include/drm/drm_gem_vram_helper.h         |  7 +---
>>   12 files changed, 45 insertions(+), 103 deletions(-)
>>
>> --
>> 2.30.2
>>
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

WARNING: multiple messages have this Message-ID (diff)
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: airlied@linux.ie, nouveau@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org,
	virtualization@lists.linux-foundation.org,
	spice-devel@lists.freedesktop.org, bskeggs@redhat.com
Subject: Re: [PATCH 0/4] drm: Generic dumb_map_offset for TTM-based drivers
Date: Thu, 8 Apr 2021 13:34:03 +0200	[thread overview]
Message-ID: <52dd3e3f-a893-3d90-e642-df01a033490a@suse.de> (raw)
In-Reply-To: <YG7mHvmhPZIPA37B@phenom.ffwll.local>


[-- Attachment #1.1.1: Type: text/plain, Size: 2019 bytes --]

Hi

Am 08.04.21 um 13:16 schrieb Daniel Vetter:
> On Tue, Apr 06, 2021 at 10:29:38AM +0200, Thomas Zimmermann wrote:
>> The implementation of drm_driver.dumb_map_offset is the same for several
>> TTM-based drivers. Provide a common function in GEM-TTM helpers.
> 
> Out of curiosity, why does this not fit for radeon/amdgpu?

These drivers perform additional permission checks in their implementations.

But those checks are also part of the actual mmap code. I want to 
propose a patch to use the generic drm_gem_ttm_map_offset in 
amdgpu/radeon, and then rely on mmap to fail if necessary. It might 
result in a longer discussion, so that's for another patchset.

Best regards
Thomas

> -Daniel
> 
>>
>> Thomas Zimmermann (4):
>>    drm/gem-ttm-helper: Provide helper for struct
>>      drm_driver.dumb_map_offset
>>    drm/vram-helper: Use drm_gem_ttm_dumb_map_offset()
>>    drm/nouveau: Use drm_gem_ttm_dumb_map_offset()
>>    drm/qxl: Use drm_gem_ttm_dumb_map_offset()
>>
>>   drivers/gpu/drm/drm_gem_ttm_helper.c      | 33 ++++++++++++++++
>>   drivers/gpu/drm/drm_gem_vram_helper.c     | 48 -----------------------
>>   drivers/gpu/drm/nouveau/nouveau_display.c | 18 ---------
>>   drivers/gpu/drm/nouveau/nouveau_display.h |  2 -
>>   drivers/gpu/drm/nouveau/nouveau_drm.c     |  3 +-
>>   drivers/gpu/drm/qxl/qxl_drv.c             |  3 +-
>>   drivers/gpu/drm/qxl/qxl_drv.h             |  3 --
>>   drivers/gpu/drm/qxl/qxl_dumb.c            | 17 --------
>>   drivers/gpu/drm/qxl/qxl_ioctl.c           |  4 +-
>>   drivers/gpu/drm/qxl/qxl_object.h          |  5 ---
>>   include/drm/drm_gem_ttm_helper.h          |  5 ++-
>>   include/drm/drm_gem_vram_helper.h         |  7 +---
>>   12 files changed, 45 insertions(+), 103 deletions(-)
>>
>> --
>> 2.30.2
>>
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

[-- Attachment #2: Type: text/plain, Size: 183 bytes --]

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

WARNING: multiple messages have this Message-ID (diff)
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: airlied@linux.ie, nouveau@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org,
	virtualization@lists.linux-foundation.org, kraxel@redhat.com,
	spice-devel@lists.freedesktop.org, bskeggs@redhat.com
Subject: Re: [PATCH 0/4] drm: Generic dumb_map_offset for TTM-based drivers
Date: Thu, 8 Apr 2021 13:34:03 +0200	[thread overview]
Message-ID: <52dd3e3f-a893-3d90-e642-df01a033490a@suse.de> (raw)
In-Reply-To: <YG7mHvmhPZIPA37B@phenom.ffwll.local>


[-- Attachment #1.1.1: Type: text/plain, Size: 2019 bytes --]

Hi

Am 08.04.21 um 13:16 schrieb Daniel Vetter:
> On Tue, Apr 06, 2021 at 10:29:38AM +0200, Thomas Zimmermann wrote:
>> The implementation of drm_driver.dumb_map_offset is the same for several
>> TTM-based drivers. Provide a common function in GEM-TTM helpers.
> 
> Out of curiosity, why does this not fit for radeon/amdgpu?

These drivers perform additional permission checks in their implementations.

But those checks are also part of the actual mmap code. I want to 
propose a patch to use the generic drm_gem_ttm_map_offset in 
amdgpu/radeon, and then rely on mmap to fail if necessary. It might 
result in a longer discussion, so that's for another patchset.

Best regards
Thomas

> -Daniel
> 
>>
>> Thomas Zimmermann (4):
>>    drm/gem-ttm-helper: Provide helper for struct
>>      drm_driver.dumb_map_offset
>>    drm/vram-helper: Use drm_gem_ttm_dumb_map_offset()
>>    drm/nouveau: Use drm_gem_ttm_dumb_map_offset()
>>    drm/qxl: Use drm_gem_ttm_dumb_map_offset()
>>
>>   drivers/gpu/drm/drm_gem_ttm_helper.c      | 33 ++++++++++++++++
>>   drivers/gpu/drm/drm_gem_vram_helper.c     | 48 -----------------------
>>   drivers/gpu/drm/nouveau/nouveau_display.c | 18 ---------
>>   drivers/gpu/drm/nouveau/nouveau_display.h |  2 -
>>   drivers/gpu/drm/nouveau/nouveau_drm.c     |  3 +-
>>   drivers/gpu/drm/qxl/qxl_drv.c             |  3 +-
>>   drivers/gpu/drm/qxl/qxl_drv.h             |  3 --
>>   drivers/gpu/drm/qxl/qxl_dumb.c            | 17 --------
>>   drivers/gpu/drm/qxl/qxl_ioctl.c           |  4 +-
>>   drivers/gpu/drm/qxl/qxl_object.h          |  5 ---
>>   include/drm/drm_gem_ttm_helper.h          |  5 ++-
>>   include/drm/drm_gem_vram_helper.h         |  7 +---
>>   12 files changed, 45 insertions(+), 103 deletions(-)
>>
>> --
>> 2.30.2
>>
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

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

  reply	other threads:[~2021-04-08 11:34 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-06  8:29 [Nouveau] [PATCH 0/4] drm: Generic dumb_map_offset for TTM-based drivers Thomas Zimmermann
2021-04-06  8:29 ` Thomas Zimmermann
2021-04-06  8:29 ` Thomas Zimmermann
2021-04-06  8:29 ` [Nouveau] [PATCH 1/4] drm/gem-ttm-helper: Provide helper for struct drm_driver.dumb_map_offset Thomas Zimmermann
2021-04-06  8:29   ` Thomas Zimmermann
2021-04-06  8:29   ` Thomas Zimmermann
2021-04-06  8:29 ` [Nouveau] [PATCH 2/4] drm/vram-helper: Use drm_gem_ttm_dumb_map_offset() Thomas Zimmermann
2021-04-06  8:29   ` Thomas Zimmermann
2021-04-06  8:29   ` Thomas Zimmermann
2021-04-06 15:29   ` [Nouveau] " kernel test robot
2021-04-06 15:29     ` kernel test robot
2021-04-06 15:29     ` kernel test robot
2021-04-06  8:29 ` [Nouveau] [PATCH 3/4] drm/nouveau: " Thomas Zimmermann
2021-04-06  8:29   ` Thomas Zimmermann
2021-04-06  8:29   ` Thomas Zimmermann
2021-04-06  8:29 ` [Nouveau] [PATCH 4/4] drm/qxl: " Thomas Zimmermann
2021-04-06  8:29   ` Thomas Zimmermann
2021-04-06  8:29   ` Thomas Zimmermann
2021-04-08  7:58 ` [Nouveau] [PATCH 0/4] drm: Generic dumb_map_offset for TTM-based drivers Maxime Ripard
2021-04-08  7:58   ` Maxime Ripard
2021-04-08 11:16 ` [Nouveau] " Daniel Vetter
2021-04-08 11:16   ` Daniel Vetter
2021-04-08 11:16   ` Daniel Vetter
2021-04-08 11:34   ` Thomas Zimmermann [this message]
2021-04-08 11:34     ` Thomas Zimmermann
2021-04-08 11:34     ` Thomas Zimmermann
2021-04-08 11:39     ` [Nouveau] " Daniel Vetter
2021-04-08 11:39       ` Daniel Vetter
2021-04-08 11:39       ` Daniel Vetter

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=52dd3e3f-a893-3d90-e642-df01a033490a@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@linux.ie \
    --cc=bskeggs@redhat.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kraxel@redhat.com \
    --cc=nouveau@lists.freedesktop.org \
    --cc=spice-devel@lists.freedesktop.org \
    --cc=virtualization@lists.linux-foundation.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.