From: Thomas Zimmermann <tzimmermann@suse.de>
To: "Daniel Vetter" <daniel@ffwll.ch>, "Maíra Canal" <mcanal@igalia.com>
Cc: "Melissa Wen" <mwen@igalia.com>,
"André Almeida" <andrealmeid@igalia.com>,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/gem: Check for valid formats
Date: Fri, 6 Jan 2023 08:10:28 +0100 [thread overview]
Message-ID: <a7159d76-1432-5a29-f011-b5b786fb516b@suse.de> (raw)
In-Reply-To: <CAKMK7uHZcLc1UYD44Zpi2wkrkuKAWXpQZKtdy4wwMW9wqJJ_og@mail.gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 2335 bytes --]
Hi
Am 05.01.23 um 19:22 schrieb Daniel Vetter:
> On Thu, 5 Jan 2023 at 18:48, Maíra Canal <mcanal@igalia.com> wrote:
>>
>> On 1/5/23 12:26, Daniel Vetter wrote:
>>> On Tue, Jan 03, 2023 at 09:53:23AM -0300, Maíra Canal wrote:
>>>> Currently, drm_gem_fb_create() doesn't check if the pixel format is
>>>> supported, which can lead to the acceptance of invalid pixel formats
>>>> e.g. the acceptance of invalid modifiers. Therefore, add a check for
>>>> valid formats on drm_gem_fb_create().
>>>>
>>>> Moreover, note that this check is only valid for atomic drivers,
>>>> because, for non-atomic drivers, checking drm_any_plane_has_format() is
>>>> not possible since the format list for the primary plane is fake, and
>>>> we'd therefor reject valid formats.
>>>>
>>>> Suggested-by: Thomas Zimmermann <tzimmermann@suse.de>
>>>> Signed-off-by: Maíra Canal <mcanal@igalia.com>
>>>
>>> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>>>
>>> I think to really make sure we have consensus it'd be good to extend this
>>> to a series which removes all the callers to drm_any_plane_has_format()
>>> from the various drivers, and then unexports that helper. That way your
>>> series here will have more eyes on it :-)
>>
>> I took a look at the callers to drm_any_plane_has_format() and there are only
>> 3 callers (amdgpu, i915 and vmwgfx). They all use drm_any_plane_has_format()
>> before calling drm_framebuffer_init(). So, I'm not sure I could remove
>> drm_any_plane_has_format() from those drivers. Maybe adding this same check
>> to drm_gem_fb_init() and refactor the drivers to make them use drm_gem_fb_init(),
>> but I guess this would be part of a different series.
>
> Well vmwgfx still not yet using gem afaik, so that doesn't work.
There was a patchset that converted vmwgfx to GEM IIRC. It even uses
generic fbdev emulation now, for which GEM is a hard requirement.
Best regards
Thomas
>
> But why can't we move the modifier check int drm_framebuffer_init()?
> That's kinda where it probably should be anyway, there's nothing gem
> bo specific in the code you're adding.
> -Daniel
--
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 --]
next prev parent reply other threads:[~2023-01-06 7:10 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-03 12:53 [PATCH] drm/gem: Check for valid formats Maíra Canal
2023-01-03 13:16 ` Thomas Zimmermann
2023-01-05 15:24 ` Daniel Vetter
2023-01-05 15:43 ` Thomas Zimmermann
2023-01-05 15:51 ` Daniel Vetter
2023-01-03 22:46 ` Rob Clark
2023-01-03 23:27 ` Simon Ser
2023-01-04 1:11 ` Maíra Canal
2023-01-04 2:22 ` Rob Clark
2023-01-05 15:26 ` Daniel Vetter
2023-01-05 17:48 ` Maíra Canal
2023-01-05 18:22 ` Daniel Vetter
2023-01-05 18:30 ` Maíra Canal
2023-01-05 18:36 ` Simon Ser
2023-01-05 18:48 ` Maíra Canal
2023-01-05 18:54 ` Simon Ser
2023-01-05 19:00 ` Maíra Canal
2023-01-05 20:04 ` Simon Ser
2023-01-06 17:42 ` Daniel Vetter
2023-01-06 7:10 ` Thomas Zimmermann [this message]
2023-01-05 15:59 ` Thomas Zimmermann
2023-04-12 14:29 Maíra Canal
2023-04-12 14:53 ` Ville Syrjälä
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=a7159d76-1432-5a29-f011-b5b786fb516b@suse.de \
--to=tzimmermann@suse.de \
--cc=andrealmeid@igalia.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=mcanal@igalia.com \
--cc=mwen@igalia.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).