[Nouveau] [RFC PATCH v3 1/3] drm: introduce fb_modifiers_not_supported flag in mode_config

2022-01-14 Thread Tomohito Esaki
If only linear modifier is advertised, since there are many drivers that only linear supported, the DRM core should handle this rather than open-coding in every driver. However, there are legacy drivers such as radeon that do not support modifiers but infer the actual layout of the underlying

Re: [Nouveau] [RFC PATCH v2 2/3] drm: set fb_modifiers_not_supported flag in legacy drivers

2022-01-14 Thread Bas Nieuwenhuizen
I think we'll also want to do a conditional disable for DC (drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c) since it only enables modifiers on newer HW. Something like "if (modifiers == NULL) fb_modifiers_not_supported = true;" in amdgpu_dm_plane_init. On Thu, Jan 13, 2022 at 10:44 AM

[Nouveau] [RFC PATCH v3 0/3] Add support modifiers for drivers whose planes only support linear layout

2022-01-14 Thread Tomohito Esaki
Some drivers whose planes only support linear layout fb do not support format modifiers. These drivers should support modifiers, however the DRM core should handle this rather than open-coding in every driver. In this patch series, these drivers expose format modifiers based on the following

Re: [Nouveau] [RFC PATCH v2 0/3] Add support modifiers for drivers whose planes only support linear layout

2022-01-14 Thread Esaki Tomohito
Hi Daniel-san, Thank you for your comments. On 2022/01/13 22:44, Daniel Stone wrote: Hi Esaki-san, On Thu, 13 Jan 2022 at 09:44, Tomohito Esaki wrote: Some drivers whose planes only support linear layout fb do not support format modifiers. These drivers should support modifiers, however the

[Nouveau] [RFC PATCH v2 2/3] drm: set fb_modifiers_not_supported flag in legacy drivers

2022-01-14 Thread Tomohito Esaki
Set fb_modifiers_not_supported flag in legacy drivers whose planes support non-linear layouts but does not support modifiers, and replace allow_fb_modifiers with fb_modifiers_not_supported. Signed-off-by: Tomohito Esaki --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 6 +++---

[Nouveau] [RFC PATCH v3 2/3] drm: add support modifiers for drivers whose planes only support linear layout

2022-01-14 Thread Tomohito Esaki
The LINEAR modifier is advertised as default if a driver doesn't specify modifiers. Signed-off-by: Tomohito Esaki --- drivers/gpu/drm/drm_plane.c | 15 --- include/drm/drm_plane.h | 3 +++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git

[Nouveau] [RFC PATCH v2 1/3] drm: add support modifiers for drivers whose planes only support linear layout

2022-01-14 Thread Tomohito Esaki
The LINEAR modifier is advertised as default if a driver doesn't specify modifiers. However, there are legacy drivers such as radeon that do not support modifiers but infer the actual layout of the underlying buffer. Therefore, a new flag not_support_fb_modifires is introduced for these legacy

[Nouveau] [RFC PATCH v3 3/3] drm: remove allow_fb_modifiers

2022-01-14 Thread Tomohito Esaki
The allow_fb_modifiers flag is unnecessary since it has been replaced with cannot_support_modifiers flag. Signed-off-by: Tomohito Esaki --- drivers/gpu/drm/drm_plane.c | 9 - drivers/gpu/drm/selftests/test-drm_framebuffer.c | 1 - include/drm/drm_mode_config.h

[Nouveau] [RFC PATCH v2 0/3] Add support modifiers for drivers whose planes only support linear layout

2022-01-14 Thread Tomohito Esaki
Some drivers whose planes only support linear layout fb do not support format modifiers. These drivers should support modifiers, however the DRM core should handle this rather than open-coding in every driver. In this patch series, these drivers expose format modifiers based on the following

[Nouveau] [RFC PATCH v2 3/3] drm: replace allow_fb_modifiers with fb_modifiers_not_supported

2022-01-14 Thread Tomohito Esaki
Since almost drivers support fb modifiers, allow_fb_modifiers is replaced with fb_modifiers_not_supported and removed. Signed-off-by: Tomohito Esaki --- drivers/gpu/drm/drm_framebuffer.c| 6 +++--- drivers/gpu/drm/drm_ioctl.c | 2 +-

Re: [Nouveau] [RFC PATCH v2 2/3] drm: set fb_modifiers_not_supported flag in legacy drivers

2022-01-14 Thread Esaki Tomohito
Hi, Thank you for your comment. On 2022/01/14 2:56, Bas Nieuwenhuizen wrote: I think we'll also want to do a conditional disable for DC (drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c) since it only enables modifiers on newer HW. Something like "if (modifiers == NULL)

Re: [Nouveau] [RFC PATCH v3 2/3] drm: add support modifiers for drivers whose planes only support linear layout

2022-01-14 Thread Andy Shevchenko
On Fri, Jan 14, 2022 at 03:42:54PM +, Simon Ser wrote: > On Friday, January 14th, 2022 at 16:17, Andy Shevchenko > wrote: > > > On Fri, Jan 14, 2022 at 03:07:21PM +, Simon Ser wrote: > > > On Friday, January 14th, 2022 at 15:16, Andy Shevchenko > > > wrote: > > > > > > > Why not enum?

Re: [Nouveau] [RFC PATH 1/3] drm: add support modifiers for drivers whose planes only support linear layout

2022-01-14 Thread Daniel Vetter
On Wed, Dec 22, 2021 at 02:27:25PM +0900, Tomohito Esaki wrote: > The LINEAR modifier is advertised as default if a driver doesn't specify > modifiers. However, there are legacy drivers such as radeon that do not > support modifiers but infer the actual layout of the underlying buffer. >

Re: [Nouveau] [RFC PATCH v3 2/3] drm: add support modifiers for drivers whose planes only support linear layout

2022-01-14 Thread Andy Shevchenko
On Fri, Jan 14, 2022 at 03:07:21PM +, Simon Ser wrote: > On Friday, January 14th, 2022 at 15:16, Andy Shevchenko > wrote: > > > Why not enum? > > There is no enum for DRM format modifiers. I'm not sure how this prevents to use enum in the code instead of const u64. Any specific reason for

Re: [Nouveau] [RFC PATCH v3 2/3] drm: add support modifiers for drivers whose planes only support linear layout

2022-01-14 Thread Simon Ser
On Friday, January 14th, 2022 at 16:17, Andy Shevchenko wrote: > On Fri, Jan 14, 2022 at 03:07:21PM +, Simon Ser wrote: > > On Friday, January 14th, 2022 at 15:16, Andy Shevchenko > > wrote: > > > > > Why not enum? > > > > There is no enum for DRM format modifiers. > > I'm not sure how

Re: [Nouveau] [RFC PATCH v3 2/3] drm: add support modifiers for drivers whose planes only support linear layout

2022-01-14 Thread Simon Ser
On Friday, January 14th, 2022 at 15:16, Andy Shevchenko wrote: > Why not enum? There is no enum for DRM format modifiers.

Re: [Nouveau] [RFC PATCH v3 2/3] drm: add support modifiers for drivers whose planes only support linear layout

2022-01-14 Thread Andy Shevchenko
On Fri, Jan 14, 2022 at 07:17:52PM +0900, Tomohito Esaki wrote: > The LINEAR modifier is advertised as default if a driver doesn't specify > modifiers. ... > + const uint64_t default_modifiers[] = { > + DRM_FORMAT_MOD_LINEAR, > + DRM_FORMAT_MOD_INVALID + Comma? > +