Re: [PATCH RESEND] drm/mediatek: Add valid modifier check

2023-08-03 Thread Fei Shao
On Thu, Aug 3, 2023 at 10:57 PM Daniel Vetter wrote: > > On Thu, Aug 03, 2023 at 08:48:56AM -0400, Justin Green wrote: > > > See c91acda3a380 ("drm/gem: Check for valid formats") and the related gem > > fb helper functions to see how this is supposed to be done. Thanks for shedding the light, Sim

Re: [PATCH RESEND] drm/mediatek: Add valid modifier check

2023-08-03 Thread Daniel Vetter
On Thu, Aug 03, 2023 at 08:48:56AM -0400, Justin Green wrote: > > See c91acda3a380 ("drm/gem: Check for valid formats") and the related gem > fb helper functions to see how this is supposed to be done. > > Oh that's interesting, so does this imply that the infrastructure > automatically calls form

Re: [PATCH RESEND] drm/mediatek: Add valid modifier check

2023-08-03 Thread Justin Green
> See c91acda3a380 ("drm/gem: Check for valid formats") and the related gem fb helper functions to see how this is supposed to be done. Oh that's interesting, so does this imply that the infrastructure automatically calls format_mod_supported() during framebuffer creation? In that case, this entir

Re: [PATCH RESEND] drm/mediatek: Add valid modifier check

2023-08-03 Thread Daniel Vetter
On Mon, Jul 24, 2023 at 01:58:39PM -0400, Justin Green wrote: > Add a check to mtk_drm_mode_fb_create() that rejects any modifier that > is not the AFBC mode supported by MT8195's display overlays. > > Tested by booting ChromeOS and verifying the UI works, and by running > the ChromeOS kms_addfb_b

Re: [PATCH RESEND] drm/mediatek: Add valid modifier check

2023-07-27 Thread Justin Green
> ...so that a per-plane logic in mtk_drm_plane can be easily added, because... I think my concern is more that if we need to validate the format and the modifier differently because of the plane data, then this method would provide limited value. For example, on my MT8195, plane ID 38 supports AR3

Re: [PATCH RESEND] drm/mediatek: Add valid modifier check

2023-07-27 Thread AngeloGioacchino Del Regno
Il 26/07/23 21:44, Justin Green ha scritto: Would it make more sense to commmonize function mtk_plane_format_mod_supported() and call that one here instead? I had considered that, but mtk_plane_format_mod_supported() is required to take a drm_plane as a parameter in order to conform to the type

Re: [PATCH RESEND] drm/mediatek: Add valid modifier check

2023-07-26 Thread Justin Green
> Would it make more sense to commmonize function > mtk_plane_format_mod_supported() > and call that one here instead? I had considered that, but mtk_plane_format_mod_supported() is required to take a drm_plane as a parameter in order to conform to the type signature defined in drm_plane_funcs, bu

Re: [PATCH RESEND] drm/mediatek: Add valid modifier check

2023-07-25 Thread Daniel Stone
On Mon, 24 Jul 2023 at 18:58, Justin Green wrote: > + if (cmd->modifier[0] && > This is not DRM_FORMAT_MOD_INVALID. Please either explicitly compare against INVALID if that's what you meant, or against LINEAR if that's what you meant, or both. Cheers, Daniel

Re: [PATCH RESEND] drm/mediatek: Add valid modifier check

2023-07-25 Thread Fei Shao
On Tue, Jul 25, 2023 at 1:59 AM Justin Green wrote: > > Add a check to mtk_drm_mode_fb_create() that rejects any modifier that > is not the AFBC mode supported by MT8195's display overlays. > > Tested by booting ChromeOS and verifying the UI works, and by running > the ChromeOS kms_addfb_basic bin

Re: [PATCH RESEND] drm/mediatek: Add valid modifier check

2023-07-24 Thread AngeloGioacchino Del Regno
Il 24/07/23 19:58, Justin Green ha scritto: Add a check to mtk_drm_mode_fb_create() that rejects any modifier that is not the AFBC mode supported by MT8195's display overlays. Tested by booting ChromeOS and verifying the UI works, and by running the ChromeOS kms_addfb_basic binary, which has a t