Message ID | 20250326234748.2982010-25-alex.hung@amd.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | Color Pipeline API w/ VKMS | expand |
Hi, Do we really need to disable cursor plane color pipeline support? I don't think we need to disable that if it is supported, since there might be some user-defined colored cursor icon. Best regards, Shengyu 在 2025/3/27 7:47, Alex Hung 写道: > cursor plane does not need to have color pipeline. > > Signed-off-by: Alex Hung <alex.hung@amd.com> > --- > v7: > - Add a commit messages > > drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c > index 9632b8b73e7e..b5b9b0b5da63 100644 > --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c > +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c > @@ -1792,6 +1792,9 @@ dm_plane_init_colorops(struct drm_plane *plane) > struct drm_prop_enum_list pipelines[MAX_COLOR_PIPELINES]; > int len = 0; > > + if (plane->type == DRM_PLANE_TYPE_CURSOR) > + return 0; > + > /* Create COLOR_PIPELINE property and attach */ > drm_plane_create_color_pipeline_property(plane, pipelines, len); >
Hi, Do we really need to disable cursor plane color pipeline support? I don't think we need to disable that if it is supported, since there might be some user-defined colored cursor icon. Best regards, Shengyu For some unknown reason, seems my mail is not shown in the mail list archive, so I resent it. 在 2025/3/27 7:47, Alex Hung 写道: > cursor plane does not need to have color pipeline. > > Signed-off-by: Alex Hung <alex.hung@amd.com> > --- > v7: > - Add a commit messages > > drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c > index 9632b8b73e7e..b5b9b0b5da63 100644 > --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c > +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c > @@ -1792,6 +1792,9 @@ dm_plane_init_colorops(struct drm_plane *plane) > struct drm_prop_enum_list pipelines[MAX_COLOR_PIPELINES]; > int len = 0; > > + if (plane->type == DRM_PLANE_TYPE_CURSOR) > + return 0; > + > /* Create COLOR_PIPELINE property and attach */ > drm_plane_create_color_pipeline_property(plane, pipelines, len); >
On 3/30/25 06:59, Shengyu Qu wrote: > Hi, > > Do we really need to disable cursor plane color pipeline support? I > don't think we need to disable that if it is supported, since there > might be some user-defined colored cursor icon. This patch applies to AMD hardware only: https://elixir.bootlin.com/linux/v6.13/source/Documentation/gpu/amdgpu/display/mpo-overview.rst#L101 > > Best regards, > Shengyu > > For some unknown reason, seems my mail is not shown in the mail list > archive, so I resent it. > > 在 2025/3/27 7:47, Alex Hung 写道: >> cursor plane does not need to have color pipeline. >> >> Signed-off-by: Alex Hung <alex.hung@amd.com> >> --- >> v7: >> - Add a commit messages >> >> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 3 +++ >> 1 file changed, 3 insertions(+) >> >> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c >> b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c >> index 9632b8b73e7e..b5b9b0b5da63 100644 >> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c >> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c >> @@ -1792,6 +1792,9 @@ dm_plane_init_colorops(struct drm_plane *plane) >> struct drm_prop_enum_list pipelines[MAX_COLOR_PIPELINES]; >> int len = 0; >> + if (plane->type == DRM_PLANE_TYPE_CURSOR) >> + return 0; >> + >> /* Create COLOR_PIPELINE property and attach */ >> drm_plane_create_color_pipeline_property(plane, pipelines, len); >
Hi, Thanks for reply. So currently we have to apply color conversion on the background plane of the cursor to do some color space conversion. What would happen if cursor and background plane needs different conversion config? Or we just give the cursor a dedicated plane? Best regards, Shengyu 在 2025/3/31 22:28, Alex Hung 写道: > > > On 3/30/25 06:59, Shengyu Qu wrote: >> Hi, >> >> Do we really need to disable cursor plane color pipeline support? I >> don't think we need to disable that if it is supported, since there >> might be some user-defined colored cursor icon. > > This patch applies to AMD hardware only: https://elixir.bootlin.com/ > linux/v6.13/source/Documentation/gpu/amdgpu/display/mpo-overview.rst#L101 > >> >> Best regards, >> Shengyu >> >> For some unknown reason, seems my mail is not shown in the mail list >> archive, so I resent it. >> >> 在 2025/3/27 7:47, Alex Hung 写道: >>> cursor plane does not need to have color pipeline. >>> >>> Signed-off-by: Alex Hung <alex.hung@amd.com> >>> --- >>> v7: >>> - Add a commit messages >>> >>> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 3 +++ >>> 1 file changed, 3 insertions(+) >>> >>> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c >>> b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c >>> index 9632b8b73e7e..b5b9b0b5da63 100644 >>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c >>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c >>> @@ -1792,6 +1792,9 @@ dm_plane_init_colorops(struct drm_plane *plane) >>> struct drm_prop_enum_list pipelines[MAX_COLOR_PIPELINES]; >>> int len = 0; >>> + if (plane->type == DRM_PLANE_TYPE_CURSOR) >>> + return 0; >>> + >>> /* Create COLOR_PIPELINE property and attach */ >>> drm_plane_create_color_pipeline_property(plane, pipelines, len); >> >
On 3/31/25 09:43, Shengyu Qu wrote: > Hi, > > Thanks for reply. So currently we have to apply color conversion on the > background plane of the cursor to do some color space conversion. What > would happen if cursor and background plane needs different conversion > config? Or we just give the cursor a dedicated plane? This scenario is not supported on AMD hardware, but software cursors on other plane types won't be affected. > > Best regards, > Shengyu > > 在 2025/3/31 22:28, Alex Hung 写道: >> >> >> On 3/30/25 06:59, Shengyu Qu wrote: >>> Hi, >>> >>> Do we really need to disable cursor plane color pipeline support? I >>> don't think we need to disable that if it is supported, since there >>> might be some user-defined colored cursor icon. >> >> This patch applies to AMD hardware only: https://elixir.bootlin.com/ >> linux/v6.13/source/Documentation/gpu/amdgpu/display/mpo-overview.rst#L101 >> >>> >>> Best regards, >>> Shengyu >>> >>> For some unknown reason, seems my mail is not shown in the mail list >>> archive, so I resent it. >>> >>> 在 2025/3/27 7:47, Alex Hung 写道: >>>> cursor plane does not need to have color pipeline. >>>> >>>> Signed-off-by: Alex Hung <alex.hung@amd.com> >>>> --- >>>> v7: >>>> - Add a commit messages >>>> >>>> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 3 +++ >>>> 1 file changed, 3 insertions(+) >>>> >>>> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c >>>> b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c >>>> index 9632b8b73e7e..b5b9b0b5da63 100644 >>>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c >>>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c >>>> @@ -1792,6 +1792,9 @@ dm_plane_init_colorops(struct drm_plane *plane) >>>> struct drm_prop_enum_list pipelines[MAX_COLOR_PIPELINES]; >>>> int len = 0; >>>> + if (plane->type == DRM_PLANE_TYPE_CURSOR) >>>> + return 0; >>>> + >>>> /* Create COLOR_PIPELINE property and attach */ >>>> drm_plane_create_color_pipeline_property(plane, pipelines, len); >>> >> >
So currently we have to hope the compositor won't use DRM_PLANE_TYPE_CURSOR planes at all.... Why do we still register DRM_PLANE_TYPE_CURSOR in the driver? 在 2025/4/1 0:06, Alex Hung 写道: > > > On 3/31/25 09:43, Shengyu Qu wrote: >> Hi, >> >> Thanks for reply. So currently we have to apply color conversion on >> the background plane of the cursor to do some color space conversion. >> What would happen if cursor and background plane needs different >> conversion config? Or we just give the cursor a dedicated plane? > > This scenario is not supported on AMD hardware, but software cursors on > other plane types won't be affected. > >> >> Best regards, >> Shengyu >> >> 在 2025/3/31 22:28, Alex Hung 写道: >>> >>> >>> On 3/30/25 06:59, Shengyu Qu wrote: >>>> Hi, >>>> >>>> Do we really need to disable cursor plane color pipeline support? I >>>> don't think we need to disable that if it is supported, since there >>>> might be some user-defined colored cursor icon. >>> >>> This patch applies to AMD hardware only: https://elixir.bootlin.com/ >>> linux/v6.13/source/Documentation/gpu/amdgpu/display/mpo- >>> overview.rst#L101 >>> >>>> >>>> Best regards, >>>> Shengyu >>>> >>>> For some unknown reason, seems my mail is not shown in the mail list >>>> archive, so I resent it. >>>> >>>> 在 2025/3/27 7:47, Alex Hung 写道: >>>>> cursor plane does not need to have color pipeline. >>>>> >>>>> Signed-off-by: Alex Hung <alex.hung@amd.com> >>>>> --- >>>>> v7: >>>>> - Add a commit messages >>>>> >>>>> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 3 +++ >>>>> 1 file changed, 3 insertions(+) >>>>> >>>>> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/ >>>>> amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/ >>>>> amdgpu_dm_plane.c >>>>> index 9632b8b73e7e..b5b9b0b5da63 100644 >>>>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c >>>>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c >>>>> @@ -1792,6 +1792,9 @@ dm_plane_init_colorops(struct drm_plane *plane) >>>>> struct drm_prop_enum_list pipelines[MAX_COLOR_PIPELINES]; >>>>> int len = 0; >>>>> + if (plane->type == DRM_PLANE_TYPE_CURSOR) >>>>> + return 0; >>>>> + >>>>> /* Create COLOR_PIPELINE property and attach */ >>>>> drm_plane_create_color_pipeline_property(plane, pipelines, len); >>>> >>> >> >
On 3/31/25 10:12, Shengyu Qu wrote: > So currently we have to hope the compositor won't use > DRM_PLANE_TYPE_CURSOR planes at all.... Why do we still register > DRM_PLANE_TYPE_CURSOR in the driver? I am not sure what your question is. A compositor can choose or skip any hardware features, but this discussion is out of the scope. > > 在 2025/4/1 0:06, Alex Hung 写道: >> >> >> On 3/31/25 09:43, Shengyu Qu wrote: >>> Hi, >>> >>> Thanks for reply. So currently we have to apply color conversion on >>> the background plane of the cursor to do some color space conversion. >>> What would happen if cursor and background plane needs different >>> conversion config? Or we just give the cursor a dedicated plane? >> >> This scenario is not supported on AMD hardware, but software cursors >> on other plane types won't be affected. >> >>> >>> Best regards, >>> Shengyu >>> >>> 在 2025/3/31 22:28, Alex Hung 写道: >>>> >>>> >>>> On 3/30/25 06:59, Shengyu Qu wrote: >>>>> Hi, >>>>> >>>>> Do we really need to disable cursor plane color pipeline support? I >>>>> don't think we need to disable that if it is supported, since there >>>>> might be some user-defined colored cursor icon. >>>> >>>> This patch applies to AMD hardware only: https://elixir.bootlin.com/ >>>> linux/v6.13/source/Documentation/gpu/amdgpu/display/mpo- >>>> overview.rst#L101 >>>> >>>>> >>>>> Best regards, >>>>> Shengyu >>>>> >>>>> For some unknown reason, seems my mail is not shown in the mail >>>>> list archive, so I resent it. >>>>> >>>>> 在 2025/3/27 7:47, Alex Hung 写道: >>>>>> cursor plane does not need to have color pipeline. >>>>>> >>>>>> Signed-off-by: Alex Hung <alex.hung@amd.com> >>>>>> --- >>>>>> v7: >>>>>> - Add a commit messages >>>>>> >>>>>> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 3 +++ >>>>>> 1 file changed, 3 insertions(+) >>>>>> >>>>>> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/ >>>>>> amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/ >>>>>> amdgpu_dm_plane.c >>>>>> index 9632b8b73e7e..b5b9b0b5da63 100644 >>>>>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c >>>>>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c >>>>>> @@ -1792,6 +1792,9 @@ dm_plane_init_colorops(struct drm_plane *plane) >>>>>> struct drm_prop_enum_list pipelines[MAX_COLOR_PIPELINES]; >>>>>> int len = 0; >>>>>> + if (plane->type == DRM_PLANE_TYPE_CURSOR) >>>>>> + return 0; >>>>>> + >>>>>> /* Create COLOR_PIPELINE property and attach */ >>>>>> drm_plane_create_color_pipeline_property(plane, pipelines, >>>>>> len); >>>>> >>>> >>> >> >
Sorry for vague expression. I mean that I think we shouldn't register DRM_PLANE_TYPE_CURSOR in the driver, as we don't have actual hardware support. 在 2025/4/1 0:26, Alex Hung 写道: > > > On 3/31/25 10:12, Shengyu Qu wrote: >> So currently we have to hope the compositor won't use >> DRM_PLANE_TYPE_CURSOR planes at all.... Why do we still register >> DRM_PLANE_TYPE_CURSOR in the driver? > > I am not sure what your question is. A compositor can choose or skip any > hardware features, but this discussion is out of the scope. > >> >> 在 2025/4/1 0:06, Alex Hung 写道: >>> >>> >>> On 3/31/25 09:43, Shengyu Qu wrote: >>>> Hi, >>>> >>>> Thanks for reply. So currently we have to apply color conversion on >>>> the background plane of the cursor to do some color space >>>> conversion. What would happen if cursor and background plane needs >>>> different conversion config? Or we just give the cursor a dedicated >>>> plane? >>> >>> This scenario is not supported on AMD hardware, but software cursors >>> on other plane types won't be affected. >>> >>>> >>>> Best regards, >>>> Shengyu >>>> >>>> 在 2025/3/31 22:28, Alex Hung 写道: >>>>> >>>>> >>>>> On 3/30/25 06:59, Shengyu Qu wrote: >>>>>> Hi, >>>>>> >>>>>> Do we really need to disable cursor plane color pipeline support? >>>>>> I don't think we need to disable that if it is supported, since >>>>>> there might be some user-defined colored cursor icon. >>>>> >>>>> This patch applies to AMD hardware only: https:// >>>>> elixir.bootlin.com/ linux/v6.13/source/Documentation/gpu/amdgpu/ >>>>> display/mpo- overview.rst#L101 >>>>> >>>>>> >>>>>> Best regards, >>>>>> Shengyu >>>>>> >>>>>> For some unknown reason, seems my mail is not shown in the mail >>>>>> list archive, so I resent it. >>>>>> >>>>>> 在 2025/3/27 7:47, Alex Hung 写道: >>>>>>> cursor plane does not need to have color pipeline. >>>>>>> >>>>>>> Signed-off-by: Alex Hung <alex.hung@amd.com> >>>>>>> --- >>>>>>> v7: >>>>>>> - Add a commit messages >>>>>>> >>>>>>> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 3 +++ >>>>>>> 1 file changed, 3 insertions(+) >>>>>>> >>>>>>> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/ >>>>>>> amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/ >>>>>>> amdgpu_dm_plane.c >>>>>>> index 9632b8b73e7e..b5b9b0b5da63 100644 >>>>>>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c >>>>>>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c >>>>>>> @@ -1792,6 +1792,9 @@ dm_plane_init_colorops(struct drm_plane >>>>>>> *plane) >>>>>>> struct drm_prop_enum_list pipelines[MAX_COLOR_PIPELINES]; >>>>>>> int len = 0; >>>>>>> + if (plane->type == DRM_PLANE_TYPE_CURSOR) >>>>>>> + return 0; >>>>>>> + >>>>>>> /* Create COLOR_PIPELINE property and attach */ >>>>>>> drm_plane_create_color_pipeline_property(plane, pipelines, >>>>>>> len); >>>>>> >>>>> >>>> >>> >> >
On 3/31/25 10:31, Shengyu Qu wrote: > Sorry for vague expression. I mean that I think we shouldn't register > DRM_PLANE_TYPE_CURSOR in the driver, as we don't have actual hardware > support. This is not true. AMD has hardware cursor support. > > 在 2025/4/1 0:26, Alex Hung 写道: >> >> >> On 3/31/25 10:12, Shengyu Qu wrote: >>> So currently we have to hope the compositor won't use >>> DRM_PLANE_TYPE_CURSOR planes at all.... Why do we still register >>> DRM_PLANE_TYPE_CURSOR in the driver? >> >> I am not sure what your question is. A compositor can choose or skip >> any hardware features, but this discussion is out of the scope. >> >>> >>> 在 2025/4/1 0:06, Alex Hung 写道: >>>> >>>> >>>> On 3/31/25 09:43, Shengyu Qu wrote: >>>>> Hi, >>>>> >>>>> Thanks for reply. So currently we have to apply color conversion on >>>>> the background plane of the cursor to do some color space >>>>> conversion. What would happen if cursor and background plane needs >>>>> different conversion config? Or we just give the cursor a dedicated >>>>> plane? >>>> >>>> This scenario is not supported on AMD hardware, but software cursors >>>> on other plane types won't be affected. >>>> >>>>> >>>>> Best regards, >>>>> Shengyu >>>>> >>>>> 在 2025/3/31 22:28, Alex Hung 写道: >>>>>> >>>>>> >>>>>> On 3/30/25 06:59, Shengyu Qu wrote: >>>>>>> Hi, >>>>>>> >>>>>>> Do we really need to disable cursor plane color pipeline support? >>>>>>> I don't think we need to disable that if it is supported, since >>>>>>> there might be some user-defined colored cursor icon. >>>>>> >>>>>> This patch applies to AMD hardware only: https:// >>>>>> elixir.bootlin.com/ linux/v6.13/source/Documentation/gpu/amdgpu/ >>>>>> display/mpo- overview.rst#L101 >>>>>> >>>>>>> >>>>>>> Best regards, >>>>>>> Shengyu >>>>>>> >>>>>>> For some unknown reason, seems my mail is not shown in the mail >>>>>>> list archive, so I resent it. >>>>>>> >>>>>>> 在 2025/3/27 7:47, Alex Hung 写道: >>>>>>>> cursor plane does not need to have color pipeline. >>>>>>>> >>>>>>>> Signed-off-by: Alex Hung <alex.hung@amd.com> >>>>>>>> --- >>>>>>>> v7: >>>>>>>> - Add a commit messages >>>>>>>> >>>>>>>> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 3 +++ >>>>>>>> 1 file changed, 3 insertions(+) >>>>>>>> >>>>>>>> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/ >>>>>>>> amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/ >>>>>>>> amdgpu_dm_plane.c >>>>>>>> index 9632b8b73e7e..b5b9b0b5da63 100644 >>>>>>>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c >>>>>>>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c >>>>>>>> @@ -1792,6 +1792,9 @@ dm_plane_init_colorops(struct drm_plane >>>>>>>> *plane) >>>>>>>> struct drm_prop_enum_list pipelines[MAX_COLOR_PIPELINES]; >>>>>>>> int len = 0; >>>>>>>> + if (plane->type == DRM_PLANE_TYPE_CURSOR) >>>>>>>> + return 0; >>>>>>>> + >>>>>>>> /* Create COLOR_PIPELINE property and attach */ >>>>>>>> drm_plane_create_color_pipeline_property(plane, pipelines, >>>>>>>> len); >>>>>>> >>>>>> >>>>> >>>> >>> >> >
Thanks, I mistook about the MPO document. Maybe we should also disable colorop on the background plane of the cursor plane? So that compositors would do sw color convertion on both cursor plane and background plane, which should keep cursor display correctly. 在 2025/4/1 0:34, Alex Hung 写道: > > > On 3/31/25 10:31, Shengyu Qu wrote: >> Sorry for vague expression. I mean that I think we shouldn't register >> DRM_PLANE_TYPE_CURSOR in the driver, as we don't have actual hardware >> support. > > This is not true. AMD has hardware cursor support. > >> >> 在 2025/4/1 0:26, Alex Hung 写道: >>> >>> >>> On 3/31/25 10:12, Shengyu Qu wrote: >>>> So currently we have to hope the compositor won't use >>>> DRM_PLANE_TYPE_CURSOR planes at all.... Why do we still register >>>> DRM_PLANE_TYPE_CURSOR in the driver? >>> >>> I am not sure what your question is. A compositor can choose or skip >>> any hardware features, but this discussion is out of the scope. >>> >>>> >>>> 在 2025/4/1 0:06, Alex Hung 写道: >>>>> >>>>> >>>>> On 3/31/25 09:43, Shengyu Qu wrote: >>>>>> Hi, >>>>>> >>>>>> Thanks for reply. So currently we have to apply color conversion >>>>>> on the background plane of the cursor to do some color space >>>>>> conversion. What would happen if cursor and background plane needs >>>>>> different conversion config? Or we just give the cursor a >>>>>> dedicated plane? >>>>> >>>>> This scenario is not supported on AMD hardware, but software >>>>> cursors on other plane types won't be affected. >>>>> >>>>>> >>>>>> Best regards, >>>>>> Shengyu >>>>>> >>>>>> 在 2025/3/31 22:28, Alex Hung 写道: >>>>>>> >>>>>>> >>>>>>> On 3/30/25 06:59, Shengyu Qu wrote: >>>>>>>> Hi, >>>>>>>> >>>>>>>> Do we really need to disable cursor plane color pipeline >>>>>>>> support? I don't think we need to disable that if it is >>>>>>>> supported, since there might be some user-defined colored cursor >>>>>>>> icon. >>>>>>> >>>>>>> This patch applies to AMD hardware only: https:// >>>>>>> elixir.bootlin.com/ linux/v6.13/source/Documentation/gpu/amdgpu/ >>>>>>> display/mpo- overview.rst#L101 >>>>>>> >>>>>>>> >>>>>>>> Best regards, >>>>>>>> Shengyu >>>>>>>> >>>>>>>> For some unknown reason, seems my mail is not shown in the mail >>>>>>>> list archive, so I resent it. >>>>>>>> >>>>>>>> 在 2025/3/27 7:47, Alex Hung 写道: >>>>>>>>> cursor plane does not need to have color pipeline. >>>>>>>>> >>>>>>>>> Signed-off-by: Alex Hung <alex.hung@amd.com> >>>>>>>>> --- >>>>>>>>> v7: >>>>>>>>> - Add a commit messages >>>>>>>>> >>>>>>>>> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 3 +++ >>>>>>>>> 1 file changed, 3 insertions(+) >>>>>>>>> >>>>>>>>> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/ >>>>>>>>> amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/ >>>>>>>>> amdgpu_dm_plane.c >>>>>>>>> index 9632b8b73e7e..b5b9b0b5da63 100644 >>>>>>>>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c >>>>>>>>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c >>>>>>>>> @@ -1792,6 +1792,9 @@ dm_plane_init_colorops(struct drm_plane >>>>>>>>> *plane) >>>>>>>>> struct drm_prop_enum_list pipelines[MAX_COLOR_PIPELINES]; >>>>>>>>> int len = 0; >>>>>>>>> + if (plane->type == DRM_PLANE_TYPE_CURSOR) >>>>>>>>> + return 0; >>>>>>>>> + >>>>>>>>> /* Create COLOR_PIPELINE property and attach */ >>>>>>>>> drm_plane_create_color_pipeline_property(plane, >>>>>>>>> pipelines, len); >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >> >
Or we can add some kind of "linked with" info to plane's COLOR_PIPELINE property, to let userspace know that cursor plane and background plane share the same colorop config. So that userspace could do extra conversion on cursor image data to avoid display wrong cursor color. 在 2025/4/1 0:50, Shengyu Qu 写道: > Thanks, I mistook about the MPO document. Maybe we should also disable > colorop on the background plane of the cursor plane? So that compositors > would do sw color convertion on both cursor plane and background plane, > which should keep cursor display correctly. > > 在 2025/4/1 0:34, Alex Hung 写道: >> >> >> On 3/31/25 10:31, Shengyu Qu wrote: >>> Sorry for vague expression. I mean that I think we shouldn't register >>> DRM_PLANE_TYPE_CURSOR in the driver, as we don't have actual hardware >>> support. >> >> This is not true. AMD has hardware cursor support. >> >>> >>> 在 2025/4/1 0:26, Alex Hung 写道: >>>> >>>> >>>> On 3/31/25 10:12, Shengyu Qu wrote: >>>>> So currently we have to hope the compositor won't use >>>>> DRM_PLANE_TYPE_CURSOR planes at all.... Why do we still register >>>>> DRM_PLANE_TYPE_CURSOR in the driver? >>>> >>>> I am not sure what your question is. A compositor can choose or skip >>>> any hardware features, but this discussion is out of the scope. >>>> >>>>> >>>>> 在 2025/4/1 0:06, Alex Hung 写道: >>>>>> >>>>>> >>>>>> On 3/31/25 09:43, Shengyu Qu wrote: >>>>>>> Hi, >>>>>>> >>>>>>> Thanks for reply. So currently we have to apply color conversion >>>>>>> on the background plane of the cursor to do some color space >>>>>>> conversion. What would happen if cursor and background plane >>>>>>> needs different conversion config? Or we just give the cursor a >>>>>>> dedicated plane? >>>>>> >>>>>> This scenario is not supported on AMD hardware, but software >>>>>> cursors on other plane types won't be affected. >>>>>> >>>>>>> >>>>>>> Best regards, >>>>>>> Shengyu >>>>>>> >>>>>>> 在 2025/3/31 22:28, Alex Hung 写道: >>>>>>>> >>>>>>>> >>>>>>>> On 3/30/25 06:59, Shengyu Qu wrote: >>>>>>>>> Hi, >>>>>>>>> >>>>>>>>> Do we really need to disable cursor plane color pipeline >>>>>>>>> support? I don't think we need to disable that if it is >>>>>>>>> supported, since there might be some user-defined colored >>>>>>>>> cursor icon. >>>>>>>> >>>>>>>> This patch applies to AMD hardware only: https:// >>>>>>>> elixir.bootlin.com/ linux/v6.13/source/Documentation/gpu/amdgpu/ >>>>>>>> display/mpo- overview.rst#L101 >>>>>>>> >>>>>>>>> >>>>>>>>> Best regards, >>>>>>>>> Shengyu >>>>>>>>> >>>>>>>>> For some unknown reason, seems my mail is not shown in the mail >>>>>>>>> list archive, so I resent it. >>>>>>>>> >>>>>>>>> 在 2025/3/27 7:47, Alex Hung 写道: >>>>>>>>>> cursor plane does not need to have color pipeline. >>>>>>>>>> >>>>>>>>>> Signed-off-by: Alex Hung <alex.hung@amd.com> >>>>>>>>>> --- >>>>>>>>>> v7: >>>>>>>>>> - Add a commit messages >>>>>>>>>> >>>>>>>>>> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 3 +++ >>>>>>>>>> 1 file changed, 3 insertions(+) >>>>>>>>>> >>>>>>>>>> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/ >>>>>>>>>> amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/ >>>>>>>>>> amdgpu_dm_plane.c >>>>>>>>>> index 9632b8b73e7e..b5b9b0b5da63 100644 >>>>>>>>>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c >>>>>>>>>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c >>>>>>>>>> @@ -1792,6 +1792,9 @@ dm_plane_init_colorops(struct drm_plane >>>>>>>>>> *plane) >>>>>>>>>> struct drm_prop_enum_list pipelines[MAX_COLOR_PIPELINES]; >>>>>>>>>> int len = 0; >>>>>>>>>> + if (plane->type == DRM_PLANE_TYPE_CURSOR) >>>>>>>>>> + return 0; >>>>>>>>>> + >>>>>>>>>> /* Create COLOR_PIPELINE property and attach */ >>>>>>>>>> drm_plane_create_color_pipeline_property(plane, >>>>>>>>>> pipelines, len); >>>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >> >
On 3/31/25 11:04, Shengyu Qu wrote: > Or we can add some kind of "linked with" info to plane's COLOR_PIPELINE > property, to let userspace know that cursor plane and background plane > share the same colorop config. So that userspace could do extra > conversion on cursor image data to avoid display wrong cursor color. That's over-complicate and makes little sense for both device drivers and userspace applications. If any planes share same colorop config, a device driver exposes the same color pipeline with the same colorops. If a plane does not support color pipeline or a driver doesn't want to support it, there is no color pipeline and no color objects. Again it is up to compositors or apps to determine how color pipeline and colorops are used (or not). For example, both primary plane and overlay plane have the same color pipeline, HDR can be enabled only on overlay but not on primary. > > 在 2025/4/1 0:50, Shengyu Qu 写道: >> Thanks, I mistook about the MPO document. Maybe we should also disable >> colorop on the background plane of the cursor plane? So that >> compositors would do sw color convertion on both cursor plane and >> background plane, which should keep cursor display correctly. Cursor plane has no color pipeline and thus it has no colorop either. It inherits color processing from its parent plane. You can create a color pipeline for cursor plane for your hardware. If none of existing colorop matches your need, new colorop can be defined. >> >> 在 2025/4/1 0:34, Alex Hung 写道: >>> >>> >>> On 3/31/25 10:31, Shengyu Qu wrote: >>>> Sorry for vague expression. I mean that I think we shouldn't >>>> register DRM_PLANE_TYPE_CURSOR in the driver, as we don't have >>>> actual hardware support. >>> >>> This is not true. AMD has hardware cursor support. >>> >>>> >>>> 在 2025/4/1 0:26, Alex Hung 写道: >>>>> >>>>> >>>>> On 3/31/25 10:12, Shengyu Qu wrote: >>>>>> So currently we have to hope the compositor won't use >>>>>> DRM_PLANE_TYPE_CURSOR planes at all.... Why do we still register >>>>>> DRM_PLANE_TYPE_CURSOR in the driver? >>>>> >>>>> I am not sure what your question is. A compositor can choose or >>>>> skip any hardware features, but this discussion is out of the scope. >>>>> >>>>>> >>>>>> 在 2025/4/1 0:06, Alex Hung 写道: >>>>>>> >>>>>>> >>>>>>> On 3/31/25 09:43, Shengyu Qu wrote: >>>>>>>> Hi, >>>>>>>> >>>>>>>> Thanks for reply. So currently we have to apply color conversion >>>>>>>> on the background plane of the cursor to do some color space >>>>>>>> conversion. What would happen if cursor and background plane >>>>>>>> needs different conversion config? Or we just give the cursor a >>>>>>>> dedicated plane? >>>>>>> >>>>>>> This scenario is not supported on AMD hardware, but software >>>>>>> cursors on other plane types won't be affected. >>>>>>> >>>>>>>> >>>>>>>> Best regards, >>>>>>>> Shengyu >>>>>>>> >>>>>>>> 在 2025/3/31 22:28, Alex Hung 写道: >>>>>>>>> >>>>>>>>> >>>>>>>>> On 3/30/25 06:59, Shengyu Qu wrote: >>>>>>>>>> Hi, >>>>>>>>>> >>>>>>>>>> Do we really need to disable cursor plane color pipeline >>>>>>>>>> support? I don't think we need to disable that if it is >>>>>>>>>> supported, since there might be some user-defined colored >>>>>>>>>> cursor icon. >>>>>>>>> >>>>>>>>> This patch applies to AMD hardware only: https:// >>>>>>>>> elixir.bootlin.com/ linux/v6.13/source/Documentation/gpu/ >>>>>>>>> amdgpu/ display/mpo- overview.rst#L101 >>>>>>>>> >>>>>>>>>> >>>>>>>>>> Best regards, >>>>>>>>>> Shengyu >>>>>>>>>> >>>>>>>>>> For some unknown reason, seems my mail is not shown in the >>>>>>>>>> mail list archive, so I resent it. >>>>>>>>>> >>>>>>>>>> 在 2025/3/27 7:47, Alex Hung 写道: >>>>>>>>>>> cursor plane does not need to have color pipeline. >>>>>>>>>>> >>>>>>>>>>> Signed-off-by: Alex Hung <alex.hung@amd.com> >>>>>>>>>>> --- >>>>>>>>>>> v7: >>>>>>>>>>> - Add a commit messages >>>>>>>>>>> >>>>>>>>>>> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 3 >>>>>>>>>>> +++ >>>>>>>>>>> 1 file changed, 3 insertions(+) >>>>>>>>>>> >>>>>>>>>>> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/ >>>>>>>>>>> amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/ >>>>>>>>>>> amdgpu_dm_plane.c >>>>>>>>>>> index 9632b8b73e7e..b5b9b0b5da63 100644 >>>>>>>>>>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c >>>>>>>>>>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c >>>>>>>>>>> @@ -1792,6 +1792,9 @@ dm_plane_init_colorops(struct drm_plane >>>>>>>>>>> *plane) >>>>>>>>>>> struct drm_prop_enum_list pipelines[MAX_COLOR_PIPELINES]; >>>>>>>>>>> int len = 0; >>>>>>>>>>> + if (plane->type == DRM_PLANE_TYPE_CURSOR) >>>>>>>>>>> + return 0; >>>>>>>>>>> + >>>>>>>>>>> /* Create COLOR_PIPELINE property and attach */ >>>>>>>>>>> drm_plane_create_color_pipeline_property(plane, >>>>>>>>>>> pipelines, len); >>>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >> >
> Cursor plane has no color pipeline and thus it has no colorop either. It > inherits color processing from its parent plane. Just to be sure: That means amdgpu will reject atomic commits that try to set a color pipeline on the primary plane while showing the cursor plane on top of it? Just like with scaling?
On 3/31/25 12:53, Xaver Hugl wrote: >> Cursor plane has no color pipeline and thus it has no colorop either. It >> inherits color processing from its parent plane. > > Just to be sure: That means amdgpu will reject atomic commits that try > to set a color pipeline on the primary plane while showing the cursor > plane on top of it? Just like with scaling? In theory that should be the case, and I will investigate and confirm it. Is this a beavhiour expected by a compositor?
在 2025/4/1 1:42, Alex Hung 写道: > > > On 3/31/25 11:04, Shengyu Qu wrote: >> Or we can add some kind of "linked with" info to plane's >> COLOR_PIPELINE property, to let userspace know that cursor plane and >> background plane share the same colorop config. So that userspace >> could do extra conversion on cursor image data to avoid display wrong >> cursor color. > > That's over-complicate and makes little sense for both device drivers > and userspace applications. > > If any planes share same colorop config, a device driver exposes the > same color pipeline with the same colorops. > > If a plane does not support color pipeline or a driver doesn't want to > support it, there is no color pipeline and no color objects. My understanding is that currently the driver would just report no colorop support on cursor plane and actually implement the background plane's colorop on cursor? > > Again it is up to compositors or apps to determine how color pipeline > and colorops are used (or not). For example, both primary plane and > overlay plane have the same color pipeline, HDR can be enabled only on > overlay but not on primary. Still this is the cleanest way to let compositors know and deal with this special cursor plane behavior. Or if compositors want to use all planes with hw colorop + MPO(for power saving or sth.), they have to detect the gpu they are running on and apply a quirk for this. That's a "dirty" implementation. > >> >> 在 2025/4/1 0:50, Shengyu Qu 写道: >>> Thanks, I mistook about the MPO document. Maybe we should also >>> disable colorop on the background plane of the cursor plane? So that >>> compositors would do sw color convertion on both cursor plane and >>> background plane, which should keep cursor display correctly. > > Cursor plane has no color pipeline and thus it has no colorop either. It > inherits color processing from its parent plane. > > You can create a color pipeline for cursor plane for your hardware. If > none of existing colorop matches your need, new colorop can be defined. > > >>> >>> 在 2025/4/1 0:34, Alex Hung 写道: >>>> >>>> >>>> On 3/31/25 10:31, Shengyu Qu wrote: >>>>> Sorry for vague expression. I mean that I think we shouldn't >>>>> register DRM_PLANE_TYPE_CURSOR in the driver, as we don't have >>>>> actual hardware support. >>>> >>>> This is not true. AMD has hardware cursor support. >>>> >>>>> >>>>> 在 2025/4/1 0:26, Alex Hung 写道: >>>>>> >>>>>> >>>>>> On 3/31/25 10:12, Shengyu Qu wrote: >>>>>>> So currently we have to hope the compositor won't use >>>>>>> DRM_PLANE_TYPE_CURSOR planes at all.... Why do we still register >>>>>>> DRM_PLANE_TYPE_CURSOR in the driver? >>>>>> >>>>>> I am not sure what your question is. A compositor can choose or >>>>>> skip any hardware features, but this discussion is out of the scope. >>>>>> >>>>>>> >>>>>>> 在 2025/4/1 0:06, Alex Hung 写道: >>>>>>>> >>>>>>>> >>>>>>>> On 3/31/25 09:43, Shengyu Qu wrote: >>>>>>>>> Hi, >>>>>>>>> >>>>>>>>> Thanks for reply. So currently we have to apply color >>>>>>>>> conversion on the background plane of the cursor to do some >>>>>>>>> color space conversion. What would happen if cursor and >>>>>>>>> background plane needs different conversion config? Or we just >>>>>>>>> give the cursor a dedicated plane? >>>>>>>> >>>>>>>> This scenario is not supported on AMD hardware, but software >>>>>>>> cursors on other plane types won't be affected. >>>>>>>> >>>>>>>>> >>>>>>>>> Best regards, >>>>>>>>> Shengyu >>>>>>>>> >>>>>>>>> 在 2025/3/31 22:28, Alex Hung 写道: >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On 3/30/25 06:59, Shengyu Qu wrote: >>>>>>>>>>> Hi, >>>>>>>>>>> >>>>>>>>>>> Do we really need to disable cursor plane color pipeline >>>>>>>>>>> support? I don't think we need to disable that if it is >>>>>>>>>>> supported, since there might be some user-defined colored >>>>>>>>>>> cursor icon. >>>>>>>>>> >>>>>>>>>> This patch applies to AMD hardware only: https:// >>>>>>>>>> elixir.bootlin.com/ linux/v6.13/source/Documentation/gpu/ >>>>>>>>>> amdgpu/ display/mpo- overview.rst#L101 >>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> Best regards, >>>>>>>>>>> Shengyu >>>>>>>>>>> >>>>>>>>>>> For some unknown reason, seems my mail is not shown in the >>>>>>>>>>> mail list archive, so I resent it. >>>>>>>>>>> >>>>>>>>>>> 在 2025/3/27 7:47, Alex Hung 写道: >>>>>>>>>>>> cursor plane does not need to have color pipeline. >>>>>>>>>>>> >>>>>>>>>>>> Signed-off-by: Alex Hung <alex.hung@amd.com> >>>>>>>>>>>> --- >>>>>>>>>>>> v7: >>>>>>>>>>>> - Add a commit messages >>>>>>>>>>>> >>>>>>>>>>>> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | >>>>>>>>>>>> 3 +++ >>>>>>>>>>>> 1 file changed, 3 insertions(+) >>>>>>>>>>>> >>>>>>>>>>>> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/ >>>>>>>>>>>> amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/ >>>>>>>>>>>> amdgpu_dm_plane.c >>>>>>>>>>>> index 9632b8b73e7e..b5b9b0b5da63 100644 >>>>>>>>>>>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c >>>>>>>>>>>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c >>>>>>>>>>>> @@ -1792,6 +1792,9 @@ dm_plane_init_colorops(struct >>>>>>>>>>>> drm_plane *plane) >>>>>>>>>>>> struct drm_prop_enum_list pipelines[MAX_COLOR_PIPELINES]; >>>>>>>>>>>> int len = 0; >>>>>>>>>>>> + if (plane->type == DRM_PLANE_TYPE_CURSOR) >>>>>>>>>>>> + return 0; >>>>>>>>>>>> + >>>>>>>>>>>> /* Create COLOR_PIPELINE property and attach */ >>>>>>>>>>>> drm_plane_create_color_pipeline_property(plane, >>>>>>>>>>>> pipelines, len); >>>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >> >
On 3/31/25 19:04, Shengyu Qu wrote: >> > My understanding is that currently the driver would just report no > colorop support on cursor plane and actually implement the background > plane's colorop on cursor? No. > >> >> Again it is up to compositors or apps to determine how color pipeline >> and colorops are used (or not). For example, both primary plane and >> overlay plane have the same color pipeline, HDR can be enabled only on >> overlay but not on primary. > Still this is the cleanest way to let compositors know and deal with > this special cursor plane behavior. Or if compositors want to use all > planes with hw colorop + MPO(for power saving or sth.), they have to > detect the gpu they are running on and apply a quirk for this. That's a > "dirty" implementation. Unrelated to color pipeline.
On 2025-03-31 19:42, Alex Hung wrote: > On 3/31/25 11:04, Shengyu Qu wrote: >> Or we can add some kind of "linked with" info to plane's COLOR_PIPELINE property, to let userspace know that cursor plane and background plane share the same colorop config. So that userspace could do extra conversion on cursor image data to avoid display wrong cursor color. > > That's over-complicate and makes little sense for both device drivers and userspace applications. > > If any planes share same colorop config, a device driver exposes the same color pipeline with the same colorops. > > If a plane does not support color pipeline or a driver doesn't want to support it, there is no color pipeline and no color objects. I suspect using the cursor plane is generally higher priority for Wayland compositors than using overlay planes, because the former is critical for a responsive user experience. This requires that the amdgpu DC driver backs the cursor plane with a dedicated HW plane though (as it's already doing in some cases), to either fully support color pipelines for the cursor plane, or at least provide proper "no color pipeline" behaviour for it. Letting the effective behaviour be determined by the other planes which happen to be behind the cursor plane isn't usable for Wayland compositors.
Btw what's your opinion about this, Xaver? 在 2025/4/1 17:56, Michel Dänzer 写道: > On 2025-03-31 19:42, Alex Hung wrote: >> On 3/31/25 11:04, Shengyu Qu wrote: >>> Or we can add some kind of "linked with" info to plane's COLOR_PIPELINE property, to let userspace know that cursor plane and background plane share the same colorop config. So that userspace could do extra conversion on cursor image data to avoid display wrong cursor color. >> >> That's over-complicate and makes little sense for both device drivers and userspace applications. >> >> If any planes share same colorop config, a device driver exposes the same color pipeline with the same colorops. >> >> If a plane does not support color pipeline or a driver doesn't want to support it, there is no color pipeline and no color objects. > > I suspect using the cursor plane is generally higher priority for Wayland compositors than using overlay planes, because the former is critical for a responsive user experience. > > This requires that the amdgpu DC driver backs the cursor plane with a dedicated HW plane though (as it's already doing in some cases), to either fully support color pipelines for the cursor plane, or at least provide proper "no color pipeline" behaviour for it. Letting the effective behaviour be determined by the other planes which happen to be behind the cursor plane isn't usable for Wayland compositors. Current behavior is just disable colorop for both background plane and cursor plane. I'm not sure how much planes does the hardware support, but if there are too less planes to use, maybe we still need to make use of the cursor background plane in the compositor. And then how to deal with colorop of cursor and background plane while saving as much power as possible becomes a problem.
On 2025-04-01 14:32, Shengyu Qu wrote: > 在 2025/4/1 17:56, Michel Dänzer 写道: >> On 2025-03-31 19:42, Alex Hung wrote: >>> On 3/31/25 11:04, Shengyu Qu wrote: >>>> Or we can add some kind of "linked with" info to plane's COLOR_PIPELINE property, to let userspace know that cursor plane and background plane share the same colorop config. So that userspace could do extra conversion on cursor image data to avoid display wrong cursor color. >>> >>> That's over-complicate and makes little sense for both device drivers and userspace applications. >>> >>> If any planes share same colorop config, a device driver exposes the same color pipeline with the same colorops. >>> >>> If a plane does not support color pipeline or a driver doesn't want to support it, there is no color pipeline and no color objects. >> >> I suspect using the cursor plane is generally higher priority for Wayland compositors than using overlay planes, because the former is critical for a responsive user experience. >> >> This requires that the amdgpu DC driver backs the cursor plane with a dedicated HW plane though (as it's already doing in some cases), to either fully support color pipelines for the cursor plane, or at least provide proper "no color pipeline" behaviour for it. Letting the effective behaviour be determined by the other planes which happen to be behind the cursor plane isn't usable for Wayland compositors. > Current behavior is just disable colorop for both background plane and cursor plane. Are you saying the color pipeline is implicitly disabled for any KMS planes which happen to be overlapped by the cursor plane? That sounds like a no go. > I'm not sure how much planes does the hardware support, but if there are too less planes to use, maybe we still need to make use of the cursor background plane in the compositor. If the HW has too few planes to allow both the cursor & overlay planes to work correctly (regardless of their dimensions), the driver should not allow enabling both kinds of planes at the same time.
Am Di., 1. Apr. 2025 um 02:29 Uhr schrieb Alex Hung <alex.hung@amd.com>: > > > > On 3/31/25 12:53, Xaver Hugl wrote: > >> Cursor plane has no color pipeline and thus it has no colorop either. It > >> inherits color processing from its parent plane. > > > > Just to be sure: That means amdgpu will reject atomic commits that try > > to set a color pipeline on the primary plane while showing the cursor > > plane on top of it? Just like with scaling? > > > In theory that should be the case, and I will investigate and confirm > it. Is this a beavhiour expected by a compositor? It's not just an expectation, the API requires it. If you were to apply a color pipeline to a plane that doesn't have any, or not apply one that is set, then that would be incredibly broken. Commits where that would happen must never ever pass atomic tests.
在 2025/4/1 22:11, Michel Dänzer 写道: > On 2025-04-01 14:32, Shengyu Qu wrote: >> 在 2025/4/1 17:56, Michel Dänzer 写道: >>> On 2025-03-31 19:42, Alex Hung wrote: >>>> On 3/31/25 11:04, Shengyu Qu wrote: >>>>> Or we can add some kind of "linked with" info to plane's COLOR_PIPELINE property, to let userspace know that cursor plane and background plane share the same colorop config. So that userspace could do extra conversion on cursor image data to avoid display wrong cursor color. >>>> >>>> That's over-complicate and makes little sense for both device drivers and userspace applications. >>>> >>>> If any planes share same colorop config, a device driver exposes the same color pipeline with the same colorops. >>>> >>>> If a plane does not support color pipeline or a driver doesn't want to support it, there is no color pipeline and no color objects. >>> >>> I suspect using the cursor plane is generally higher priority for Wayland compositors than using overlay planes, because the former is critical for a responsive user experience. >>> >>> This requires that the amdgpu DC driver backs the cursor plane with a dedicated HW plane though (as it's already doing in some cases), to either fully support color pipelines for the cursor plane, or at least provide proper "no color pipeline" behaviour for it. Letting the effective behaviour be determined by the other planes which happen to be behind the cursor plane isn't usable for Wayland compositors. >> Current behavior is just disable colorop for both background plane and cursor plane. > > Are you saying the color pipeline is implicitly disabled for any KMS planes which happen to be overlapped by the cursor plane? According to this mail, I think so(unless I mistook about the meaning again): https://lists.freedesktop.org/archives/amd-gfx/2025-April/122257.html > > That sounds like a no go. > > >> I'm not sure how much planes does the hardware support, but if there are too less planes to use, maybe we still need to make use of the cursor background plane in the compositor. > > If the HW has too few planes to allow both the cursor & overlay planes to work correctly (regardless of their dimensions), the driver should not allow enabling both kinds of planes at the same time. > >
On 03/31, Xaver Hugl wrote: > > Cursor plane has no color pipeline and thus it has no colorop either. It > > inherits color processing from its parent plane. > > Just to be sure: That means amdgpu will reject atomic commits that try > to set a color pipeline on the primary plane while showing the cursor > plane on top of it? Just like with scaling? Isn't AMD driver resorting to overlay cursor mode when scaling? In addition, isn't it a case of using overlay cursor mode when setting a color pipeline for cursor? Melissa
在 2025/4/1 22:11, Michel Dänzer 写道: > On 2025-04-01 14:32, Shengyu Qu wrote: >> 在 2025/4/1 17:56, Michel Dänzer 写道: >>> On 2025-03-31 19:42, Alex Hung wrote: >>>> On 3/31/25 11:04, Shengyu Qu wrote: >>>>> Or we can add some kind of "linked with" info to plane's COLOR_PIPELINE property, to let userspace know that cursor plane and background plane share the same colorop config. So that userspace could do extra conversion on cursor image data to avoid display wrong cursor color. >>>> >>>> That's over-complicate and makes little sense for both device drivers and userspace applications. >>>> >>>> If any planes share same colorop config, a device driver exposes the same color pipeline with the same colorops. >>>> >>>> If a plane does not support color pipeline or a driver doesn't want to support it, there is no color pipeline and no color objects. >>> >>> I suspect using the cursor plane is generally higher priority for Wayland compositors than using overlay planes, because the former is critical for a responsive user experience. >>> >>> This requires that the amdgpu DC driver backs the cursor plane with a dedicated HW plane though (as it's already doing in some cases), to either fully support color pipelines for the cursor plane, or at least provide proper "no color pipeline" behaviour for it. Letting the effective behaviour be determined by the other planes which happen to be behind the cursor plane isn't usable for Wayland compositors. >> Current behavior is just disable colorop for both background plane and cursor plane. > > Are you saying the color pipeline is implicitly disabled for any KMS planes which happen to be overlapped by the cursor plane? Forget about my previous mail. Background plane means the parent plane of cursor plane, which is described here: https://docs.kernel.org/next/gpu/amdgpu/display/mpo-overview.html Not mean the plane that is overlapped by cursor plane, since only one plane is affected by cursor plane. > > That sounds like a no go. > > >> I'm not sure how much planes does the hardware support, but if there are too less planes to use, maybe we still need to make use of the cursor background plane in the compositor. > > If the HW has too few planes to allow both the cursor & overlay planes to work correctly (regardless of their dimensions), the driver should not allow enabling both kinds of planes at the same time. > >
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c index 9632b8b73e7e..b5b9b0b5da63 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c @@ -1792,6 +1792,9 @@ dm_plane_init_colorops(struct drm_plane *plane) struct drm_prop_enum_list pipelines[MAX_COLOR_PIPELINES]; int len = 0; + if (plane->type == DRM_PLANE_TYPE_CURSOR) + return 0; + /* Create COLOR_PIPELINE property and attach */ drm_plane_create_color_pipeline_property(plane, pipelines, len);
cursor plane does not need to have color pipeline. Signed-off-by: Alex Hung <alex.hung@amd.com> --- v7: - Add a commit messages drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 3 +++ 1 file changed, 3 insertions(+)