linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Javier Martinez Canillas <javierm@redhat.com>,
	daniel@ffwll.ch, airlied@linux.ie, mripard@kernel.org,
	maarten.lankhorst@linux.intel.com, deller@gmx.de
Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org
Subject: Re: [PATCH 9/9] drm/virtio: Implement dumb_create_fbdev with GEM SHMEM helpers
Date: Wed, 9 Mar 2022 09:52:48 +0100	[thread overview]
Message-ID: <971ff2e6-adda-17ee-d002-5b32403d344f@suse.de> (raw)
In-Reply-To: <b1af16e7-a20f-5499-6234-c5090349305f@redhat.com>


[-- Attachment #1.1: Type: text/plain, Size: 2966 bytes --]

Hi

Am 08.03.22 um 20:37 schrieb Javier Martinez Canillas:
> On 3/3/22 21:58, Thomas Zimmermann wrote:
>> Implement struct drm_driver.dumb_create_fbdev with the helpers
>> provided by GEM SHMEM. Fbdev deferred I/O will now work without
>> an intermediate shadow buffer for mmap.
>>
>> As the virtio driver replaces several of the regular GEM SHMEM
>> functions with its own implementation, some additional code is
>> necessary make fbdev optimization work. Especially, the driver
>> has to provide buffer-object functions for fbdev. Add the hook
>> struct drm_driver.gem_create_object_fbdev, which is similar to
>> struct drm_driver.gem_create_object and allows for the creation
>> of dedicated fbdev buffer objects. Wire things up within GEM
>> SHMEM.
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>> ---
>>   drivers/gpu/drm/drm_gem_shmem_helper.c  |  7 +++-
>>   drivers/gpu/drm/virtio/virtgpu_drv.c    |  2 +
>>   drivers/gpu/drm/virtio/virtgpu_drv.h    |  2 +
>>   drivers/gpu/drm/virtio/virtgpu_object.c | 54 +++++++++++++++++++++++--
>>   include/drm/drm_drv.h                   | 10 +++++
>>   5 files changed, 71 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c
>> index ab7cb7d896c3..225aa17895bd 100644
>> --- a/drivers/gpu/drm/drm_gem_shmem_helper.c
>> +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c
>> @@ -71,7 +71,12 @@ __drm_gem_shmem_create(struct drm_device *dev, size_t size, bool private, bool f
>>   
>>   	size = PAGE_ALIGN(size);
>>   
>> -	if (dev->driver->gem_create_object) {
>> +	if (dev->driver->gem_create_object_fbdev && fbdev) {
> 
> Same comment here to check if fbdev emulation is enabled or maybe is not
> worht it ? But I think this hints the compiler to optimize the if branch.
> 
> [snip]
> 
>> +}
>> +#else
>> +struct drm_gem_object *virtio_gpu_create_object_fbdev(struct drm_device *dev,
>> +						      size_t size)
>> +{
>> +	return ERR_PTR(-ENOSYS);
>> +}
> 
> As mentioned, I believe this should be ERR_PTR(-ENOTSUPP) instead.

I've been wondering about this as well. I finally went with the rules at 
[1].  All the variants of ENOTOP/ENOTSUPP seem to be for specific use 
cases, such as a certain feature is not implemented be a specific 
interface (e.g., sockets for EOPNOTSUPP).  ENOSYS is the only general 
error that indicates that an entire interface is missing. Even though 
checkpatch.pl warns that it's only for system calls.

Best regards
Thomas

[1] https://www.cs.helsinki.fi/linux/linux-kernel/2002-30/1135.html

> 
> Feel free to ignore all this nits if you consider that are not applicable.
> 
> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
> 

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

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

  reply	other threads:[~2022-03-09  8:52 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-03 20:58 [PATCH 0/9] drm: Support GEM SHMEM fbdev without shadow FB Thomas Zimmermann
2022-03-03 20:58 ` [PATCH 1/9] drm/simpledrm: Use fbdev defaults for shadow buffering Thomas Zimmermann
2022-03-08  9:31   ` Javier Martinez Canillas
2022-03-08  9:56     ` Thomas Zimmermann
2022-03-08  9:58       ` Javier Martinez Canillas
2022-03-03 20:58 ` [PATCH 2/9] fbdev: Put mmap for deferred I/O into drivers Thomas Zimmermann
2022-03-08 14:03   ` Javier Martinez Canillas
2022-03-03 20:58 ` [PATCH 3/9] fbdev: Track deferred-I/O pages in pageref struct Thomas Zimmermann
2022-03-08 14:42   ` Javier Martinez Canillas
2022-03-09  8:36     ` Thomas Zimmermann
2022-03-09 11:21       ` Javier Martinez Canillas
2022-03-03 20:58 ` [PATCH 4/9] fbdev: Export helper for implementing page_mkwrite Thomas Zimmermann
2022-03-08 17:21   ` Javier Martinez Canillas
2022-03-03 20:58 ` [PATCH 5/9] drm/fb-helper: Separate deferred I/O from shadow buffers Thomas Zimmermann
2022-03-08 17:24   ` Javier Martinez Canillas
2022-03-03 20:58 ` [PATCH 6/9] drm/fb-helper: Provide callback to create fbdev dumb buffers Thomas Zimmermann
2022-03-08 17:51   ` Javier Martinez Canillas
2022-03-09  8:42     ` Thomas Zimmermann
2022-03-15 19:11     ` Thomas Zimmermann
2022-03-03 20:58 ` [PATCH 7/9] drm/fb-helper: Provide fbdev deferred-I/O helpers Thomas Zimmermann
2022-03-08 18:56   ` Javier Martinez Canillas
2022-03-03 20:58 ` [PATCH 8/9] drm/gem-shmem: Implement fbdev dumb buffer and mmap helpers Thomas Zimmermann
2022-03-08 19:29   ` Javier Martinez Canillas
2022-03-09  8:47     ` Thomas Zimmermann
2022-03-09 11:25       ` Javier Martinez Canillas
2022-03-03 20:58 ` [PATCH 9/9] drm/virtio: Implement dumb_create_fbdev with GEM SHMEM helpers Thomas Zimmermann
2022-03-08 19:37   ` Javier Martinez Canillas
2022-03-09  8:52     ` Thomas Zimmermann [this message]
2022-03-09 11:29       ` Javier Martinez Canillas
2022-03-08  9:13 ` [PATCH 0/9] drm: Support GEM SHMEM fbdev without shadow FB Javier Martinez Canillas
2022-03-08  9:44   ` Thomas Zimmermann

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=971ff2e6-adda-17ee-d002-5b32403d344f@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=javierm@redhat.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.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 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).