Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2025-01-17 Thread Marek Olšák
If DRM_FORMAT_MOD_LINEAR stays, then most of this discussion is irrelevant. If you don't like the new linear modifiers, don't use them. If that's you, bye. For the rest, there are multiple solutions: 1) New vendor-agnostic linear modifiers. The reason why we would want them is that they define ro

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2025-01-17 Thread Simona Vetter
On Wed, Jan 15, 2025 at 12:20:07PM +, Daniel Stone wrote: > On Wed, 15 Jan 2025 at 04:05, Marek Olšák wrote: > > On Tue, Jan 14, 2025 at 12:58 PM Daniel Stone wrote: > >> AMD hardware is the only hardware I know of which doesn't support > >> overaligning. Say (not hypothetically) we have a GP

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2025-01-15 Thread Daniel Stone
On Wed, 15 Jan 2025 at 04:05, Marek Olšák wrote: > On Tue, Jan 14, 2025 at 12:58 PM Daniel Stone wrote: >> AMD hardware is the only hardware I know of which doesn't support >> overaligning. Say (not hypothetically) we have a GPU and a display >> controller which have a minimum pitch alignment of

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2025-01-15 Thread Simona Vetter
On Tue, Jan 14, 2025 at 12:33:57PM -0600, Faith Ekstrand wrote: > On January 14, 2025 03:39:45 Marek Olšák wrote: > > I would keep the existing modifier interfaces, API extensions, and > > expectations the same as today for simplicity. > > > > The new linear modifier definition (proposal) will ha

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2025-01-14 Thread Marek Olšák
On Tue, Jan 14, 2025 at 1:34 PM Faith Ekstrand wrote: > On January 14, 2025 03:39:45 Marek Olšák wrote: > >> I would keep the existing modifier interfaces, API extensions, and >> expectations the same as today for simplicity. >> >> The new linear modifier definition (proposal) will have these fi

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2025-01-14 Thread Marek Olšák
On Tue, Jan 14, 2025 at 12:58 PM Daniel Stone wrote: > Hi, > > On Tue, 14 Jan 2025 at 09:38, Marek Olšák wrote: > > I would keep the existing modifier interfaces, API extensions, and > expectations the same as today for simplicity. > > Well yes, not just for simplicity, but because everything st

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2025-01-14 Thread Marek Olšák
On Tue, Jan 14, 2025 at 12:55 PM James Jones wrote: > I don't see how that fits in the current modifier usage patterns. I'm > not clear how applications are supposed to programmatically "look at the > modifiers of other drivers to find commonalities," nor how that "keeps > "expectations the same

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2025-01-14 Thread Faith Ekstrand
On January 14, 2025 03:39:45 Marek Olšák wrote: I would keep the existing modifier interfaces, API extensions, and expectations the same as today for simplicity. The new linear modifier definition (proposal) will have these fields: 5 bits for log2 pitch alignment in bytes 5 bits for log2 h

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2025-01-14 Thread Daniel Stone
Hi, On Tue, 14 Jan 2025 at 09:38, Marek Olšák wrote: > I would keep the existing modifier interfaces, API extensions, and > expectations the same as today for simplicity. Well yes, not just for simplicity, but because everything stops working if you don't. > The new linear modifier definition

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2025-01-14 Thread James Jones
I don't see how that fits in the current modifier usage patterns. I'm not clear how applications are supposed to programmatically "look at the modifiers of other drivers to find commonalities," nor how that "keeps "expectations the same as today for simplicity.". I think replacing the existing

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2025-01-14 Thread Thomas Zimmermann
Hi Am 14.01.25 um 14:46 schrieb Thomas Zimmermann: Hi Am 15.12.24 um 21:53 schrieb Marek Olšák: The comment explains the problem with DRM_FORMAT_MOD_LINEAR. Signed-off-by: Marek Olšák diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h index 78abd819fd62e..8ec4163

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2025-01-14 Thread Thomas Zimmermann
Hi Am 15.12.24 um 21:53 schrieb Marek Olšák: The comment explains the problem with DRM_FORMAT_MOD_LINEAR. Signed-off-by: Marek Olšák diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h index 78abd819fd62e..8ec4163429014 100644 --- a/include/uapi/drm/drm_fourcc.h +++ b/

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2025-01-14 Thread Marek Olšák
I would keep the existing modifier interfaces, API extensions, and expectations the same as today for simplicity. The new linear modifier definition (proposal) will have these fields: 5 bits for log2 pitch alignment in bytes 5 bits for log2 height alignment in rows 5 bits for log2 offset

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2025-01-10 Thread James Jones
On 12/19/24 10:03, Simona Vetter wrote: On Thu, Dec 19, 2024 at 09:02:27AM +, Daniel Stone wrote: On Wed, 18 Dec 2024 at 10:32, Brian Starkey wrote: On Wed, Dec 18, 2024 at 11:24:58AM +, Simona Vetter wrote: For that reason I think linear modifiers with explicit pitch/size alignment c

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2024-12-24 Thread Marek Olšák
On Fri, Dec 20, 2024 at 10:24 AM Simona Vetter wrote: > On Thu, Dec 19, 2024 at 05:09:33PM +0100, Michel Dänzer wrote: > > On 2024-12-19 10:02, Daniel Stone wrote: > > > > > > How this would be used in practice is also way too underdocumented. We > > > need to document that exact-round-up 64b is

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2024-12-20 Thread Simona Vetter
On Fri, Dec 20, 2024 at 09:24:59AM -0500, Marek Olšák wrote: > > > > * Modifiers must uniquely encode buffer layout. In other words, a buffer > > must > > * match only a single modifier. > > > > That sentence is misleading and impossible to meet. Specifications are > sometimes changed to reflect

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2024-12-20 Thread Simona Vetter
On Thu, Dec 19, 2024 at 05:09:33PM +0100, Michel Dänzer wrote: > On 2024-12-19 10:02, Daniel Stone wrote: > > > > How this would be used in practice is also way too underdocumented. We > > need to document that exact-round-up 64b is more restrictive than > > any-multiple-of 64b is more restrictive

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2024-12-20 Thread Marek Olšák
> > * Modifiers must uniquely encode buffer layout. In other words, a buffer > must > * match only a single modifier. > That sentence is misleading and impossible to meet. Specifications are sometimes changed to reflect the overwhelming reality. Multiple modifiers can represent identical layouts

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2024-12-20 Thread Brian Starkey
This is getting long, so tl;dr: - Pitch alignment *by itself* is manageable. - Adding constraints in modifiers quickly leads to combinatorial explosion. - drm_fourcc.h explicitly says "it's incorrect to encode pitch alignment in a modifier", for all the reasons Daniel raised. That need

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2024-12-19 Thread Marek Olšák
On Thu, Dec 19, 2024 at 5:32 AM Brian Starkey wrote: > On Wed, Dec 18, 2024 at 09:53:56PM +, Marek Olšák wrote: > > On Wed, Dec 18, 2024 at 5:32 AM Brian Starkey > wrote: > > > > > On Wed, Dec 18, 2024 at 11:24:58AM +, Simona Vetter wrote: > > > > > > > > For that reason I think linear m

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2024-12-19 Thread Simona Vetter
On Thu, Dec 19, 2024 at 09:02:27AM +, Daniel Stone wrote: > On Wed, 18 Dec 2024 at 10:32, Brian Starkey wrote: > > On Wed, Dec 18, 2024 at 11:24:58AM +, Simona Vetter wrote: > > > For that reason I think linear modifiers with explicit pitch/size > > > alignment constraints is a sound conce

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2024-12-19 Thread Michel Dänzer
On 2024-12-19 10:02, Daniel Stone wrote: > > How this would be used in practice is also way too underdocumented. We > need to document that exact-round-up 64b is more restrictive than > any-multiple-of 64b is more restrictive than 'classic' linear. We need > to document what people should advertis

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2024-12-19 Thread Brian Starkey
On Wed, Dec 18, 2024 at 09:53:56PM +, Marek Olšák wrote: > On Wed, Dec 18, 2024 at 5:32 AM Brian Starkey wrote: > > > On Wed, Dec 18, 2024 at 11:24:58AM +, Simona Vetter wrote: > > > > > > For that reason I think linear modifiers with explicit pitch/size > > > alignment constraints is a s

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2024-12-19 Thread Daniel Stone
On Thu, 19 Dec 2024 at 02:54, Marek Olšák wrote: > On Wed, Dec 18, 2024 at 5:32 AM Brian Starkey wrote: >> On Wed, Dec 18, 2024 at 11:24:58AM +, Simona Vetter wrote: >> > For that reason I think linear modifiers with explicit pitch/size >> > alignment constraints is a sound concept and fits i

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2024-12-19 Thread Daniel Stone
On Wed, 18 Dec 2024 at 10:32, Brian Starkey wrote: > On Wed, Dec 18, 2024 at 11:24:58AM +, Simona Vetter wrote: > > For that reason I think linear modifiers with explicit pitch/size > > alignment constraints is a sound concept and fits into how modifiers work > > overall. > > Could we make it

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2024-12-18 Thread Marek Olšák
On Wed, Dec 18, 2024 at 5:32 AM Brian Starkey wrote: > On Wed, Dec 18, 2024 at 11:24:58AM +, Simona Vetter wrote: > > > > For that reason I think linear modifiers with explicit pitch/size > > alignment constraints is a sound concept and fits into how modifiers work > > overall. > > -Sima > >

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2024-12-18 Thread Brian Starkey
On Wed, Dec 18, 2024 at 11:24:58AM +, Simona Vetter wrote: > > For that reason I think linear modifiers with explicit pitch/size > alignment constraints is a sound concept and fits into how modifiers work > overall. > -Sima Could we make it (more) clear that pitch alignment is a "special" con

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2024-12-18 Thread Simona Vetter
On Wed, Dec 18, 2024 at 10:44:17AM +0100, Michel Dänzer wrote: > On 2024-12-17 12:03, Brian Starkey wrote: > > On Tue, Dec 17, 2024 at 11:13:05AM +, Michel Dänzer wrote: > >> On 2024-12-17 10:14, Brian Starkey wrote: > >> > >>> Modifiers are meant to describe framebuffers, and this pitch alignm

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2024-12-18 Thread Simona Vetter
On Mon, Dec 16, 2024 at 04:58:20PM -0500, Marek Olšák wrote: > On Mon, Dec 16, 2024 at 9:53 AM Simona Vetter > wrote: > > > On Mon, Dec 16, 2024 at 11:46:13AM +0100, Lucas Stach wrote: > > > Am Montag, dem 16.12.2024 um 10:27 +0100 schrieb Michel Dänzer: > > > > On 2024-12-15 21:53, Marek Olšák w

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2024-12-18 Thread Michel Dänzer
On 2024-12-17 12:03, Brian Starkey wrote: > On Tue, Dec 17, 2024 at 11:13:05AM +, Michel Dänzer wrote: >> On 2024-12-17 10:14, Brian Starkey wrote: >> >>> Modifiers are meant to describe framebuffers, and this pitch alignment >>> requirement isn't really a framebuffer property - it's a device >

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2024-12-17 Thread Brian Starkey
On Tue, Dec 17, 2024 at 11:13:05AM +, Michel Dänzer wrote: > On 2024-12-17 10:14, Brian Starkey wrote: > > On Sun, Dec 15, 2024 at 03:53:14PM +, Marek Olšák wrote: > >> The comment explains the problem with DRM_FORMAT_MOD_LINEAR. > >> > >> Signed-off-by: Marek Olšák > >> > >> diff --git a/

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2024-12-17 Thread Michel Dänzer
On 2024-12-17 10:14, Brian Starkey wrote: > On Sun, Dec 15, 2024 at 03:53:14PM +, Marek Olšák wrote: >> The comment explains the problem with DRM_FORMAT_MOD_LINEAR. >> >> Signed-off-by: Marek Olšák >> >> diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h >> index 78abd8

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2024-12-17 Thread Michel Dänzer
On 2024-12-16 22:54, Marek Olšák wrote: > On Mon, Dec 16, 2024 at 5:46 AM Lucas Stach > wrote: > > Am Montag, dem 16.12.2024 um 10:27 +0100 schrieb Michel Dänzer: > > On 2024-12-15 21:53, Marek Olšák wrote: > > > The comment explains the problem with DRM

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2024-12-17 Thread Brian Starkey
Hi, On Sun, Dec 15, 2024 at 03:53:14PM +, Marek Olšák wrote: > The comment explains the problem with DRM_FORMAT_MOD_LINEAR. > > Signed-off-by: Marek Olšák > > diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h > index 78abd819fd62e..8ec4163429014 100644 > --- a/inclu

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2024-12-17 Thread Michel Dänzer
On 2024-12-16 22:29, Marek Olšák wrote: > On Mon, Dec 16, 2024 at 4:27 AM Michel Dänzer > wrote: > > On 2024-12-15 21:53, Marek Olšák wrote: > > The comment explains the problem with DRM_FORMAT_MOD_LINEAR. > >     > > Signed-off-by: Marek Olšák

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2024-12-16 Thread Marek Olšák
On Mon, Dec 16, 2024 at 9:53 AM Simona Vetter wrote: > On Mon, Dec 16, 2024 at 11:46:13AM +0100, Lucas Stach wrote: > > Am Montag, dem 16.12.2024 um 10:27 +0100 schrieb Michel Dänzer: > > > On 2024-12-15 21:53, Marek Olšák wrote: > > > > The comment explains the problem with DRM_FORMAT_MOD_LINEAR

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2024-12-16 Thread Marek Olšák
On Mon, Dec 16, 2024 at 5:46 AM Lucas Stach wrote: > Am Montag, dem 16.12.2024 um 10:27 +0100 schrieb Michel Dänzer: > > On 2024-12-15 21:53, Marek Olšák wrote: > > > The comment explains the problem with DRM_FORMAT_MOD_LINEAR. > > > > > > Signed-off-by: Marek Olšák marek.ol...@amd.com>> > > > >

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2024-12-16 Thread Marek Olšák
On Mon, Dec 16, 2024 at 4:27 AM Michel Dänzer wrote: > On 2024-12-15 21:53, Marek Olšák wrote: > > The comment explains the problem with DRM_FORMAT_MOD_LINEAR. > > > > Signed-off-by: Marek Olšák marek.ol...@amd.com>> > > > > diff --git a/include/uapi/drm/drm_fourcc.h > b/include/uapi/drm/drm_fou

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2024-12-16 Thread Simona Vetter
On Mon, Dec 16, 2024 at 11:46:13AM +0100, Lucas Stach wrote: > Am Montag, dem 16.12.2024 um 10:27 +0100 schrieb Michel Dänzer: > > On 2024-12-15 21:53, Marek Olšák wrote: > > > The comment explains the problem with DRM_FORMAT_MOD_LINEAR. > > >     > > > Signed-off-by: Marek Olšák > >

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2024-12-16 Thread Lucas Stach
Am Montag, dem 16.12.2024 um 10:27 +0100 schrieb Michel Dänzer: > On 2024-12-15 21:53, Marek Olšák wrote: > > The comment explains the problem with DRM_FORMAT_MOD_LINEAR. > >     > > Signed-off-by: Marek Olšák > > > > > > diff --git a/include/uapi/drm/drm_fourcc.h b/in

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2024-12-16 Thread Michel Dänzer
On 2024-12-15 21:53, Marek Olšák wrote: > The comment explains the problem with DRM_FORMAT_MOD_LINEAR. >     > Signed-off-by: Marek Olšák mailto:marek.ol...@amd.com>> > > diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h > index 78abd819fd62e..8ec4163429014 100644 > --- a/

Re: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2024-12-15 Thread Marek Olšák
Missed 2 lines from the diff: +#define DRM_FORMAT_MOD_LINEAR_PITCH_ALIGN_128B fourcc_mod_code(NONE, 2) +#define DRM_FORMAT_MOD_LINEAR_PITCH_ALIGN_256B fourcc_mod_code(NONE, 3) Marek On Sun, Dec 15, 2024 at 3:53 PM Marek Olšák wrote: > The comment explains the problem with DRM_FORMAT_MOD_LINEAR

[PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment

2024-12-15 Thread Marek Olšák
The comment explains the problem with DRM_FORMAT_MOD_LINEAR. Signed-off-by: Marek Olšák diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h index 78abd819fd62e..8ec4163429014 100644 --- a/include/uapi/drm/drm_fourcc.h +++ b/include/uapi/drm/drm_fourcc.h @@ -484,9 +484,27 @