* [PATCH v5] amd/display: only require overlay plane to cover whole CRTC on ChromeOS
@ 2021-10-11 15:16 Simon Ser
2021-10-12 9:08 ` Paul Menzel
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Simon Ser @ 2021-10-11 15:16 UTC (permalink / raw)
To: amd-gfx
Cc: Alex Deucher, Harry Wentland, Nicholas Kazlauskas,
Bas Nieuwenhuizen, Rodrigo Siqueira, Sean Paul
Commit ddab8bd788f5 ("drm/amd/display: Fix two cursor duplication when
using overlay") changed the atomic validation code to forbid the
overlay plane from being used if it doesn't cover the whole CRTC. The
motivation is that ChromeOS uses the atomic API for everything except
the cursor plane (which uses the legacy API). Thus amdgpu must always
be prepared to enable/disable/move the cursor plane at any time without
failing (or else ChromeOS will trip over).
As discussed in [1], there's no reason why the ChromeOS limitation
should prevent other fully atomic users from taking advantage of the
overlay plane. Let's limit the check to ChromeOS.
v4: fix ChromeOS detection (Harry)
v5: fix conflict with linux-next
[1]: https://lore.kernel.org/amd-gfx/JIQ_93_cHcshiIDsrMU1huBzx9P9LVQxucx8hQArpQu7Wk5DrCl_vTXj_Q20m_L-8C8A5dSpNcSJ8ehfcCrsQpfB5QG_Spn14EYkH9chtg0=@emersion.fr/
Signed-off-by: Simon Ser <contact@emersion.fr>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Harry Wentland <hwentlan@amd.com>
Cc: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Cc: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Cc: Sean Paul <seanpaul@chromium.org>
Fixes: ddab8bd788f5 ("drm/amd/display: Fix two cursor duplication when using overlay")
---
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 29 +++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index f35561b5a465..2eeda1fec506 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -10594,6 +10594,31 @@ static int add_affected_mst_dsc_crtcs(struct drm_atomic_state *state, struct drm
}
#endif
+static bool is_chromeos(void)
+{
+ struct mm_struct *mm = current->mm;
+ struct file *exe_file;
+ bool ret;
+
+ /* ChromeOS renames its thread to DrmThread. Also check the executable
+ * name. */
+ if (strcmp(current->comm, "DrmThread") != 0 || !mm)
+ return false;
+
+ rcu_read_lock();
+ exe_file = rcu_dereference(mm->exe_file);
+ if (exe_file && !get_file_rcu(exe_file))
+ exe_file = NULL;
+ rcu_read_unlock();
+
+ if (!exe_file)
+ return false;
+ ret = strcmp(exe_file->f_path.dentry->d_name.name, "chrome") == 0;
+ fput(exe_file);
+
+ return ret;
+}
+
static int validate_overlay(struct drm_atomic_state *state)
{
int i;
@@ -10601,6 +10626,10 @@ static int validate_overlay(struct drm_atomic_state *state)
struct drm_plane_state *new_plane_state;
struct drm_plane_state *primary_state, *overlay_state = NULL;
+ /* This is a workaround for ChromeOS only */
+ if (!is_chromeos())
+ return 0;
+
/* Check if primary plane is contained inside overlay */
for_each_new_plane_in_state_reverse(state, plane, new_plane_state, i) {
if (plane->type == DRM_PLANE_TYPE_OVERLAY) {
--
2.33.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v5] amd/display: only require overlay plane to cover whole CRTC on ChromeOS
2021-10-11 15:16 [PATCH v5] amd/display: only require overlay plane to cover whole CRTC on ChromeOS Simon Ser
@ 2021-10-12 9:08 ` Paul Menzel
2021-10-12 9:15 ` Simon Ser
2021-10-12 14:39 ` Harry Wentland
2021-10-21 18:01 ` Rodrigo Siqueira Jordao
2 siblings, 1 reply; 11+ messages in thread
From: Paul Menzel @ 2021-10-12 9:08 UTC (permalink / raw)
To: Simon Ser
Cc: Alex Deucher, Harry Wentland, Nicholas Kazlauskas,
Bas Nieuwenhuizen, Rodrigo Siqueira, Sean Paul, amd-gfx
Dear Simon,
Am 11.10.21 um 17:16 schrieb Simon Ser:
> Commit ddab8bd788f5 ("drm/amd/display: Fix two cursor duplication when
> using overlay") changed the atomic validation code to forbid the
> overlay plane from being used if it doesn't cover the whole CRTC. The
> motivation is that ChromeOS uses the atomic API for everything except
s/motivation/problem/
> the cursor plane (which uses the legacy API). Thus amdgpu must always
> be prepared to enable/disable/move the cursor plane at any time without
> failing (or else ChromeOS will trip over).
What ChromeOS version did you test with? Are there plans to improve
ChromeOS?
> As discussed in [1], there's no reason why the ChromeOS limitation
> should prevent other fully atomic users from taking advantage of the
> overlay plane. Let's limit the check to ChromeOS.
How do we know, no other userspace programs are affected, breaking
Linux’ no-regression in userspace policy?
> v4: fix ChromeOS detection (Harry)
>
> v5: fix conflict with linux-next
>
> [1]: https://lore.kernel.org/amd-gfx/JIQ_93_cHcshiIDsrMU1huBzx9P9LVQxucx8hQArpQu7Wk5DrCl_vTXj_Q20m_L-8C8A5dSpNcSJ8ehfcCrsQpfB5QG_Spn14EYkH9chtg0=@emersion.fr/
>
> Signed-off-by: Simon Ser <contact@emersion.fr>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Cc: Harry Wentland <hwentlan@amd.com>
> Cc: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
> Cc: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
> Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
> Cc: Sean Paul <seanpaul@chromium.org>
> Fixes: ddab8bd788f5 ("drm/amd/display: Fix two cursor duplication when using overlay")
> ---
> .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 29 +++++++++++++++++++
> 1 file changed, 29 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index f35561b5a465..2eeda1fec506 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -10594,6 +10594,31 @@ static int add_affected_mst_dsc_crtcs(struct drm_atomic_state *state, struct drm
> }
> #endif
>
> +static bool is_chromeos(void)
> +{
> + struct mm_struct *mm = current->mm;
> + struct file *exe_file;
> + bool ret;
> +
> + /* ChromeOS renames its thread to DrmThread. Also check the executable
> + * name. */
> + if (strcmp(current->comm, "DrmThread") != 0 || !mm)
> + return false;
> +
> + rcu_read_lock();
> + exe_file = rcu_dereference(mm->exe_file);
> + if (exe_file && !get_file_rcu(exe_file))
> + exe_file = NULL;
> + rcu_read_unlock();
> +
> + if (!exe_file)
> + return false;
> + ret = strcmp(exe_file->f_path.dentry->d_name.name, "chrome") == 0;
> + fput(exe_file);
> +
> + return ret;
> +}
> +
> static int validate_overlay(struct drm_atomic_state *state)
> {
> int i;
> @@ -10601,6 +10626,10 @@ static int validate_overlay(struct drm_atomic_state *state)
> struct drm_plane_state *new_plane_state;
> struct drm_plane_state *primary_state, *overlay_state = NULL;
>
> + /* This is a workaround for ChromeOS only */
> + if (!is_chromeos())
> + return 0;
I would have expected the check to be the other way around, as no the
behavior on non-Chrome OS is changed?
> +
Could some log be added, if ChromeOS is detected?
> /* Check if primary plane is contained inside overlay */
> for_each_new_plane_in_state_reverse(state, plane, new_plane_state, i) {
> if (plane->type == DRM_PLANE_TYPE_OVERLAY) {
>
Kind regards,
Paul
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v5] amd/display: only require overlay plane to cover whole CRTC on ChromeOS
2021-10-12 9:08 ` Paul Menzel
@ 2021-10-12 9:15 ` Simon Ser
2021-10-12 9:24 ` Paul Menzel
0 siblings, 1 reply; 11+ messages in thread
From: Simon Ser @ 2021-10-12 9:15 UTC (permalink / raw)
To: Paul Menzel
Cc: Alex Deucher, Harry Wentland, Nicholas Kazlauskas,
Bas Nieuwenhuizen, Rodrigo Siqueira, Sean Paul, amd-gfx
On Tuesday, October 12th, 2021 at 11:08, Paul Menzel <pmenzel@molgen.mpg.de> wrote:
> > the cursor plane (which uses the legacy API). Thus amdgpu must always
> > be prepared to enable/disable/move the cursor plane at any time without
> > failing (or else ChromeOS will trip over).
>
> What ChromeOS version did you test with? Are there plans to improve
> ChromeOS?
No idea, I haven't received feedback from the ChromeOS folks.
> > As discussed in [1], there's no reason why the ChromeOS limitation
> > should prevent other fully atomic users from taking advantage of the
> > overlay plane. Let's limit the check to ChromeOS.
>
> How do we know, no other userspace programs are affected, breaking
> Linux’ no-regression in userspace policy?
Actually this is the other way around: the ChromeOS fix which landed
has broken my user-space. This patch tries to fix the situation for
both ChromeOS and gamescope.
That said, it seems like amdgpu maintainers are open to just revert the
ChromeOS fix, thus fixing gamescope. ChromeOS can carry the fix in their
kernel tree. More on that soon.
> > v4: fix ChromeOS detection (Harry)
> >
> > v5: fix conflict with linux-next
> >
> > [1]: https://lore.kernel.org/amd-gfx/JIQ_93_cHcshiIDsrMU1huBzx9P9LVQxucx8hQArpQu7Wk5DrCl_vTXj_Q20m_L-8C8A5dSpNcSJ8ehfcCrsQpfB5QG_Spn14EYkH9chtg0=@emersion.fr/
> >
> > Signed-off-by: Simon Ser <contact@emersion.fr>
> > Cc: Alex Deucher <alexander.deucher@amd.com>
> > Cc: Harry Wentland <hwentlan@amd.com>
> > Cc: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
> > Cc: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
> > Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
> > Cc: Sean Paul <seanpaul@chromium.org>
> > Fixes: ddab8bd788f5 ("drm/amd/display: Fix two cursor duplication when using overlay")
> > ---
> > .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 29 +++++++++++++++++++
> > 1 file changed, 29 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> > index f35561b5a465..2eeda1fec506 100644
> > --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> > +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> > @@ -10594,6 +10594,31 @@ static int add_affected_mst_dsc_crtcs(struct drm_atomic_state *state, struct drm
> > }
> > #endif
> >
> > +static bool is_chromeos(void)
> > +{
> > + struct mm_struct *mm = current->mm;
> > + struct file *exe_file;
> > + bool ret;
> > +
> > + /* ChromeOS renames its thread to DrmThread. Also check the executable
> > + * name. */
> > + if (strcmp(current->comm, "DrmThread") != 0 || !mm)
> > + return false;
> > +
> > + rcu_read_lock();
> > + exe_file = rcu_dereference(mm->exe_file);
> > + if (exe_file && !get_file_rcu(exe_file))
> > + exe_file = NULL;
> > + rcu_read_unlock();
> > +
> > + if (!exe_file)
> > + return false;
> > + ret = strcmp(exe_file->f_path.dentry->d_name.name, "chrome") == 0;
> > + fput(exe_file);
> > +
> > + return ret;
> > +}
> > +
> > static int validate_overlay(struct drm_atomic_state *state)
> > {
> > int i;
> > @@ -10601,6 +10626,10 @@ static int validate_overlay(struct drm_atomic_state *state)
> > struct drm_plane_state *new_plane_state;
> > struct drm_plane_state *primary_state, *overlay_state = NULL;
> >
> > + /* This is a workaround for ChromeOS only */
> > + if (!is_chromeos())
> > + return 0;
>
> I would have expected the check to be the other way around, as no the
> behavior on non-Chrome OS is changed?
This function performs a check which is only necessary on ChromeOS. On
non-ChromeOS, this function prevents user-space from using some hardware
features. The early return ensures non-ChromeOS user-space can use these
features.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v5] amd/display: only require overlay plane to cover whole CRTC on ChromeOS
2021-10-12 9:15 ` Simon Ser
@ 2021-10-12 9:24 ` Paul Menzel
2021-10-12 9:30 ` Simon Ser
0 siblings, 1 reply; 11+ messages in thread
From: Paul Menzel @ 2021-10-12 9:24 UTC (permalink / raw)
To: Simon Ser
Cc: Alex Deucher, Harry Wentland, Nicholas Kazlauskas,
Bas Nieuwenhuizen, Rodrigo Siqueira, Sean Paul, amd-gfx
Dear Simon,
Am 12.10.21 um 11:15 schrieb Simon Ser:
> On Tuesday, October 12th, 2021 at 11:08, Paul Menzel <pmenzel@molgen.mpg.de> wrote:
>
>>> the cursor plane (which uses the legacy API). Thus amdgpu must always
>>> be prepared to enable/disable/move the cursor plane at any time without
>>> failing (or else ChromeOS will trip over).
>>
>> What ChromeOS version did you test with? Are there plans to improve
>> ChromeOS?
>
> No idea, I haven't received feedback from the ChromeOS folks.
>
>>> As discussed in [1], there's no reason why the ChromeOS limitation
>>> should prevent other fully atomic users from taking advantage of the
>>> overlay plane. Let's limit the check to ChromeOS.
>>
>> How do we know, no other userspace programs are affected, breaking
>> Linux’ no-regression in userspace policy?
>
> Actually this is the other way around: the ChromeOS fix which landed
> has broken my user-space. This patch tries to fix the situation for
> both ChromeOS and gamescope.
Thank you.
> That said, it seems like amdgpu maintainers are open to just revert the
> ChromeOS fix, thus fixing gamescope. ChromeOS can carry the fix in their
> kernel tree. More on that soon.
>
>>> v4: fix ChromeOS detection (Harry)
>>>
>>> v5: fix conflict with linux-next
>>>
>>> [1]: https://lore.kernel.org/amd-gfx/JIQ_93_cHcshiIDsrMU1huBzx9P9LVQxucx8hQArpQu7Wk5DrCl_vTXj_Q20m_L-8C8A5dSpNcSJ8ehfcCrsQpfB5QG_Spn14EYkH9chtg0=@emersion.fr/
>>>
>>> Signed-off-by: Simon Ser <contact@emersion.fr>
>>> Cc: Alex Deucher <alexander.deucher@amd.com>
>>> Cc: Harry Wentland <hwentlan@amd.com>
>>> Cc: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
>>> Cc: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
>>> Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
>>> Cc: Sean Paul <seanpaul@chromium.org>
>>> Fixes: ddab8bd788f5 ("drm/amd/display: Fix two cursor duplication when using overlay")
>>> ---
>>> .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 29 +++++++++++++++++++
>>> 1 file changed, 29 insertions(+)
>>>
>>> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>>> index f35561b5a465..2eeda1fec506 100644
>>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>>> @@ -10594,6 +10594,31 @@ static int add_affected_mst_dsc_crtcs(struct drm_atomic_state *state, struct drm
>>> }
>>> #endif
>>>
>>> +static bool is_chromeos(void)
>>> +{
>>> + struct mm_struct *mm = current->mm;
>>> + struct file *exe_file;
>>> + bool ret;
>>> +
>>> + /* ChromeOS renames its thread to DrmThread. Also check the executable
>>> + * name. */
>>> + if (strcmp(current->comm, "DrmThread") != 0 || !mm)
>>> + return false;
>>> +
>>> + rcu_read_lock();
>>> + exe_file = rcu_dereference(mm->exe_file);
>>> + if (exe_file && !get_file_rcu(exe_file))
>>> + exe_file = NULL;
>>> + rcu_read_unlock();
>>> +
>>> + if (!exe_file)
>>> + return false;
>>> + ret = strcmp(exe_file->f_path.dentry->d_name.name, "chrome") == 0;
>>> + fput(exe_file);
>>> +
>>> + return ret;
>>> +}
>>> +
>>> static int validate_overlay(struct drm_atomic_state *state)
>>> {
>>> int i;
>>> @@ -10601,6 +10626,10 @@ static int validate_overlay(struct drm_atomic_state *state)
>>> struct drm_plane_state *new_plane_state;
>>> struct drm_plane_state *primary_state, *overlay_state = NULL;
>>>
>>> + /* This is a workaround for ChromeOS only */
>>> + if (!is_chromeos())
>>> + return 0;
>>
>> I would have expected the check to be the other way around, as no the
>> behavior on non-Chrome OS is changed?
>
> This function performs a check which is only necessary on ChromeOS. On
> non-ChromeOS, this function prevents user-space from using some hardware
> features. The early return ensures non-ChromeOS user-space can use these
> features.
Thank you for the explanation. Then I misunderstood commit ddab8bd7
(drm/amd/display: Fix two cursor duplication when using overlay) from
the Fixes tag, as commit ddab8bd7 does not mention Chrome OS, and also
does not carry a fixes tag.
With that background, I guess the workaround it fine.
Kind regards,
Paul
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v5] amd/display: only require overlay plane to cover whole CRTC on ChromeOS
2021-10-12 9:24 ` Paul Menzel
@ 2021-10-12 9:30 ` Simon Ser
0 siblings, 0 replies; 11+ messages in thread
From: Simon Ser @ 2021-10-12 9:30 UTC (permalink / raw)
To: Paul Menzel
Cc: Alex Deucher, Harry Wentland, Nicholas Kazlauskas,
Bas Nieuwenhuizen, Rodrigo Siqueira, Sean Paul, amd-gfx
On Tuesday, October 12th, 2021 at 11:24, Paul Menzel <pmenzel@molgen.mpg.de> wrote:
> Thank you for the explanation. Then I misunderstood commit ddab8bd7
> (drm/amd/display: Fix two cursor duplication when using overlay) from
> the Fixes tag, as commit ddab8bd7 does not mention Chrome OS, and also
> does not carry a fixes tag.
Yeah, that commit message isn't 100% explicit, but "some userspace" means
ChromeOS. See also e7d9560aeae5 ("Revert "drm/amd/display: Fix overlay
validation by considering cursors"") which reverts a patch relaxing the
checks introduced in ddab8bd7, and mentions ChromeOS explicitly.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v5] amd/display: only require overlay plane to cover whole CRTC on ChromeOS
2021-10-11 15:16 [PATCH v5] amd/display: only require overlay plane to cover whole CRTC on ChromeOS Simon Ser
2021-10-12 9:08 ` Paul Menzel
@ 2021-10-12 14:39 ` Harry Wentland
2021-10-12 19:57 ` Alex Deucher
2021-10-21 18:01 ` Rodrigo Siqueira Jordao
2 siblings, 1 reply; 11+ messages in thread
From: Harry Wentland @ 2021-10-12 14:39 UTC (permalink / raw)
To: Simon Ser, amd-gfx
Cc: Alex Deucher, Harry Wentland, Nicholas Kazlauskas,
Bas Nieuwenhuizen, Rodrigo Siqueira, Sean Paul
On 2021-10-11 11:16, Simon Ser wrote:
> Commit ddab8bd788f5 ("drm/amd/display: Fix two cursor duplication when
> using overlay") changed the atomic validation code to forbid the
> overlay plane from being used if it doesn't cover the whole CRTC. The
> motivation is that ChromeOS uses the atomic API for everything except
> the cursor plane (which uses the legacy API). Thus amdgpu must always
> be prepared to enable/disable/move the cursor plane at any time without
> failing (or else ChromeOS will trip over).
>
> As discussed in [1], there's no reason why the ChromeOS limitation
> should prevent other fully atomic users from taking advantage of the
> overlay plane. Let's limit the check to ChromeOS.
>
> v4: fix ChromeOS detection (Harry)
>
> v5: fix conflict with linux-next
>
> [1]: https://lore.kernel.org/amd-gfx/JIQ_93_cHcshiIDsrMU1huBzx9P9LVQxucx8hQArpQu7Wk5DrCl_vTXj_Q20m_L-8C8A5dSpNcSJ8ehfcCrsQpfB5QG_Spn14EYkH9chtg0=@emersion.fr/>>
> Signed-off-by: Simon Ser <contact@emersion.fr>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Cc: Harry Wentland <hwentlan@amd.com>
> Cc: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
> Cc: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
> Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
> Cc: Sean Paul <seanpaul@chromium.org>
> Fixes: ddab8bd788f5 ("drm/amd/display: Fix two cursor duplication when using overlay")
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Harry
> ---
> .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 29 +++++++++++++++++++
> 1 file changed, 29 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index f35561b5a465..2eeda1fec506 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -10594,6 +10594,31 @@ static int add_affected_mst_dsc_crtcs(struct drm_atomic_state *state, struct drm
> }
> #endif
>
> +static bool is_chromeos(void)
> +{
> + struct mm_struct *mm = current->mm;
> + struct file *exe_file;
> + bool ret;
> +
> + /* ChromeOS renames its thread to DrmThread. Also check the executable
> + * name. */
> + if (strcmp(current->comm, "DrmThread") != 0 || !mm)
> + return false;
> +
> + rcu_read_lock();
> + exe_file = rcu_dereference(mm->exe_file);
> + if (exe_file && !get_file_rcu(exe_file))
> + exe_file = NULL;
> + rcu_read_unlock();
> +
> + if (!exe_file)
> + return false;
> + ret = strcmp(exe_file->f_path.dentry->d_name.name, "chrome") == 0;
> + fput(exe_file);
> +
> + return ret;
> +}
> +
> static int validate_overlay(struct drm_atomic_state *state)
> {
> int i;
> @@ -10601,6 +10626,10 @@ static int validate_overlay(struct drm_atomic_state *state)
> struct drm_plane_state *new_plane_state;
> struct drm_plane_state *primary_state, *overlay_state = NULL;
>
> + /* This is a workaround for ChromeOS only */
> + if (!is_chromeos())
> + return 0;
> +
> /* Check if primary plane is contained inside overlay */
> for_each_new_plane_in_state_reverse(state, plane, new_plane_state, i) {
> if (plane->type == DRM_PLANE_TYPE_OVERLAY) {
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v5] amd/display: only require overlay plane to cover whole CRTC on ChromeOS
2021-10-12 14:39 ` Harry Wentland
@ 2021-10-12 19:57 ` Alex Deucher
2021-10-12 20:57 ` Harry Wentland
0 siblings, 1 reply; 11+ messages in thread
From: Alex Deucher @ 2021-10-12 19:57 UTC (permalink / raw)
To: Harry Wentland
Cc: Simon Ser, amd-gfx list, Alex Deucher, Harry Wentland,
Nicholas Kazlauskas, Bas Nieuwenhuizen, Rodrigo Siqueira,
Sean Paul
On Tue, Oct 12, 2021 at 10:39 AM Harry Wentland <harry.wentland@amd.com> wrote:
>
> On 2021-10-11 11:16, Simon Ser wrote:
> > Commit ddab8bd788f5 ("drm/amd/display: Fix two cursor duplication when
> > using overlay") changed the atomic validation code to forbid the
> > overlay plane from being used if it doesn't cover the whole CRTC. The
> > motivation is that ChromeOS uses the atomic API for everything except
> > the cursor plane (which uses the legacy API). Thus amdgpu must always
> > be prepared to enable/disable/move the cursor plane at any time without
> > failing (or else ChromeOS will trip over).
> >
> > As discussed in [1], there's no reason why the ChromeOS limitation
> > should prevent other fully atomic users from taking advantage of the
> > overlay plane. Let's limit the check to ChromeOS.
> >
> > v4: fix ChromeOS detection (Harry)
> >
> > v5: fix conflict with linux-next
> >
> > [1]: https://lore.kernel.org/amd-gfx/JIQ_93_cHcshiIDsrMU1huBzx9P9LVQxucx8hQArpQu7Wk5DrCl_vTXj_Q20m_L-8C8A5dSpNcSJ8ehfcCrsQpfB5QG_Spn14EYkH9chtg0=@emersion.fr/>>
> > Signed-off-by: Simon Ser <contact@emersion.fr>
> > Cc: Alex Deucher <alexander.deucher@amd.com>
> > Cc: Harry Wentland <hwentlan@amd.com>
> > Cc: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
> > Cc: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
> > Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
> > Cc: Sean Paul <seanpaul@chromium.org>
> > Fixes: ddab8bd788f5 ("drm/amd/display: Fix two cursor duplication when using overlay")
>
> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
@Harry Wentland, @Simon Ser Do you have a preference on whether we
apply this patch or revert ddab8bd788f5? I'm fine with either.
Alex
>
> Harry
>
> > ---
> > .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 29 +++++++++++++++++++
> > 1 file changed, 29 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> > index f35561b5a465..2eeda1fec506 100644
> > --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> > +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> > @@ -10594,6 +10594,31 @@ static int add_affected_mst_dsc_crtcs(struct drm_atomic_state *state, struct drm
> > }
> > #endif
> >
> > +static bool is_chromeos(void)
> > +{
> > + struct mm_struct *mm = current->mm;
> > + struct file *exe_file;
> > + bool ret;
> > +
> > + /* ChromeOS renames its thread to DrmThread. Also check the executable
> > + * name. */
> > + if (strcmp(current->comm, "DrmThread") != 0 || !mm)
> > + return false;
> > +
> > + rcu_read_lock();
> > + exe_file = rcu_dereference(mm->exe_file);
> > + if (exe_file && !get_file_rcu(exe_file))
> > + exe_file = NULL;
> > + rcu_read_unlock();
> > +
> > + if (!exe_file)
> > + return false;
> > + ret = strcmp(exe_file->f_path.dentry->d_name.name, "chrome") == 0;
> > + fput(exe_file);
> > +
> > + return ret;
> > +}
> > +
> > static int validate_overlay(struct drm_atomic_state *state)
> > {
> > int i;
> > @@ -10601,6 +10626,10 @@ static int validate_overlay(struct drm_atomic_state *state)
> > struct drm_plane_state *new_plane_state;
> > struct drm_plane_state *primary_state, *overlay_state = NULL;
> >
> > + /* This is a workaround for ChromeOS only */
> > + if (!is_chromeos())
> > + return 0;
> > +
> > /* Check if primary plane is contained inside overlay */
> > for_each_new_plane_in_state_reverse(state, plane, new_plane_state, i) {
> > if (plane->type == DRM_PLANE_TYPE_OVERLAY) {
> >
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v5] amd/display: only require overlay plane to cover whole CRTC on ChromeOS
2021-10-12 19:57 ` Alex Deucher
@ 2021-10-12 20:57 ` Harry Wentland
2021-10-12 21:03 ` Alex Deucher
0 siblings, 1 reply; 11+ messages in thread
From: Harry Wentland @ 2021-10-12 20:57 UTC (permalink / raw)
To: Alex Deucher
Cc: Simon Ser, amd-gfx list, Alex Deucher, Harry Wentland,
Nicholas Kazlauskas, Bas Nieuwenhuizen, Rodrigo Siqueira,
Sean Paul
On 10/12/21 3:57 PM, Alex Deucher wrote:
> On Tue, Oct 12, 2021 at 10:39 AM Harry Wentland <harry.wentland@amd.com> wrote:
>>
>> On 2021-10-11 11:16, Simon Ser wrote:
>>> Commit ddab8bd788f5 ("drm/amd/display: Fix two cursor duplication when
>>> using overlay") changed the atomic validation code to forbid the
>>> overlay plane from being used if it doesn't cover the whole CRTC. The
>>> motivation is that ChromeOS uses the atomic API for everything except
>>> the cursor plane (which uses the legacy API). Thus amdgpu must always
>>> be prepared to enable/disable/move the cursor plane at any time without
>>> failing (or else ChromeOS will trip over).
>>>
>>> As discussed in [1], there's no reason why the ChromeOS limitation
>>> should prevent other fully atomic users from taking advantage of the
>>> overlay plane. Let's limit the check to ChromeOS.
>>>
>>> v4: fix ChromeOS detection (Harry)
>>>
>>> v5: fix conflict with linux-next
>>>
>>> [1]: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.kernel.org%2Famd-gfx%2FJIQ_93_cHcshiIDsrMU1huBzx9P9LVQxucx8hQArpQu7Wk5DrCl_vTXj_Q20m_L-8C8A5dSpNcSJ8ehfcCrsQpfB5QG_Spn14EYkH9chtg0%3D%40emersion.fr%2F&data=04%7C01%7Charry.wentland%40amd.com%7Cf5038651be2d44b2d11208d98dba8a8e%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637696654602344329%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=83wfZCmSw3IpY%2BRxgnVB4YqABUf8W%2BgYCynDzLvFU7g%3D&reserved=0>>
>>> Signed-off-by: Simon Ser <contact@emersion.fr>
>>> Cc: Alex Deucher <alexander.deucher@amd.com>
>>> Cc: Harry Wentland <hwentlan@amd.com>
>>> Cc: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
>>> Cc: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
>>> Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
>>> Cc: Sean Paul <seanpaul@chromium.org>
>>> Fixes: ddab8bd788f5 ("drm/amd/display: Fix two cursor duplication when using overlay")
>>
>> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
>
> @Harry Wentland, @Simon Ser Do you have a preference on whether we
> apply this patch or revert ddab8bd788f5? I'm fine with either.
>
Is get_mm_exe_file missing on linux-next? I'm okay either
way but haven't looked closely at linux-next.
Another option, as discussed by Simon on IRC, might be
to take this patch only on the Chrome kernels, though
it would be nice to avoid custom patches on Chrome kernels.
Harry
> Alex
>
>>
>> Harry
>>
>>> ---
>>> .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 29 +++++++++++++++++++
>>> 1 file changed, 29 insertions(+)
>>>
>>> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>>> index f35561b5a465..2eeda1fec506 100644
>>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>>> @@ -10594,6 +10594,31 @@ static int add_affected_mst_dsc_crtcs(struct drm_atomic_state *state, struct drm
>>> }
>>> #endif
>>>
>>> +static bool is_chromeos(void)
>>> +{
>>> + struct mm_struct *mm = current->mm;
>>> + struct file *exe_file;
>>> + bool ret;
>>> +
>>> + /* ChromeOS renames its thread to DrmThread. Also check the executable
>>> + * name. */
>>> + if (strcmp(current->comm, "DrmThread") != 0 || !mm)
>>> + return false;
>>> +
>>> + rcu_read_lock();
>>> + exe_file = rcu_dereference(mm->exe_file);
>>> + if (exe_file && !get_file_rcu(exe_file))
>>> + exe_file = NULL;
>>> + rcu_read_unlock();
>>> +
>>> + if (!exe_file)
>>> + return false;
>>> + ret = strcmp(exe_file->f_path.dentry->d_name.name, "chrome") == 0;
>>> + fput(exe_file);
>>> +
>>> + return ret;
>>> +}
>>> +
>>> static int validate_overlay(struct drm_atomic_state *state)
>>> {
>>> int i;
>>> @@ -10601,6 +10626,10 @@ static int validate_overlay(struct drm_atomic_state *state)
>>> struct drm_plane_state *new_plane_state;
>>> struct drm_plane_state *primary_state, *overlay_state = NULL;
>>>
>>> + /* This is a workaround for ChromeOS only */
>>> + if (!is_chromeos())
>>> + return 0;
>>> +
>>> /* Check if primary plane is contained inside overlay */
>>> for_each_new_plane_in_state_reverse(state, plane, new_plane_state, i) {
>>> if (plane->type == DRM_PLANE_TYPE_OVERLAY) {
>>>
>>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v5] amd/display: only require overlay plane to cover whole CRTC on ChromeOS
2021-10-12 20:57 ` Harry Wentland
@ 2021-10-12 21:03 ` Alex Deucher
2021-10-14 15:34 ` Simon Ser
0 siblings, 1 reply; 11+ messages in thread
From: Alex Deucher @ 2021-10-12 21:03 UTC (permalink / raw)
To: Harry Wentland
Cc: Simon Ser, amd-gfx list, Alex Deucher, Harry Wentland,
Nicholas Kazlauskas, Bas Nieuwenhuizen, Rodrigo Siqueira,
Sean Paul
On Tue, Oct 12, 2021 at 4:57 PM Harry Wentland <harry.wentland@amd.com> wrote:
>
>
>
> On 10/12/21 3:57 PM, Alex Deucher wrote:
> > On Tue, Oct 12, 2021 at 10:39 AM Harry Wentland <harry.wentland@amd.com> wrote:
> >>
> >> On 2021-10-11 11:16, Simon Ser wrote:
> >>> Commit ddab8bd788f5 ("drm/amd/display: Fix two cursor duplication when
> >>> using overlay") changed the atomic validation code to forbid the
> >>> overlay plane from being used if it doesn't cover the whole CRTC. The
> >>> motivation is that ChromeOS uses the atomic API for everything except
> >>> the cursor plane (which uses the legacy API). Thus amdgpu must always
> >>> be prepared to enable/disable/move the cursor plane at any time without
> >>> failing (or else ChromeOS will trip over).
> >>>
> >>> As discussed in [1], there's no reason why the ChromeOS limitation
> >>> should prevent other fully atomic users from taking advantage of the
> >>> overlay plane. Let's limit the check to ChromeOS.
> >>>
> >>> v4: fix ChromeOS detection (Harry)
> >>>
> >>> v5: fix conflict with linux-next
> >>>
> >>> [1]: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.kernel.org%2Famd-gfx%2FJIQ_93_cHcshiIDsrMU1huBzx9P9LVQxucx8hQArpQu7Wk5DrCl_vTXj_Q20m_L-8C8A5dSpNcSJ8ehfcCrsQpfB5QG_Spn14EYkH9chtg0%3D%40emersion.fr%2F&data=04%7C01%7Charry.wentland%40amd.com%7Cf5038651be2d44b2d11208d98dba8a8e%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637696654602344329%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=83wfZCmSw3IpY%2BRxgnVB4YqABUf8W%2BgYCynDzLvFU7g%3D&reserved=0>>
> >>> Signed-off-by: Simon Ser <contact@emersion.fr>
> >>> Cc: Alex Deucher <alexander.deucher@amd.com>
> >>> Cc: Harry Wentland <hwentlan@amd.com>
> >>> Cc: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
> >>> Cc: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
> >>> Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
> >>> Cc: Sean Paul <seanpaul@chromium.org>
> >>> Fixes: ddab8bd788f5 ("drm/amd/display: Fix two cursor duplication when using overlay")
> >>
> >> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
> >
> > @Harry Wentland, @Simon Ser Do you have a preference on whether we
> > apply this patch or revert ddab8bd788f5? I'm fine with either.
> >
>
> Is get_mm_exe_file missing on linux-next? I'm okay either
> way but haven't looked closely at linux-next.
Yes, it was removed in 5.15.
Alex
>
> Another option, as discussed by Simon on IRC, might be
> to take this patch only on the Chrome kernels, though
> it would be nice to avoid custom patches on Chrome kernels.
>
> Harry
>
> > Alex
> >
> >>
> >> Harry
> >>
> >>> ---
> >>> .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 29 +++++++++++++++++++
> >>> 1 file changed, 29 insertions(+)
> >>>
> >>> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> >>> index f35561b5a465..2eeda1fec506 100644
> >>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> >>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> >>> @@ -10594,6 +10594,31 @@ static int add_affected_mst_dsc_crtcs(struct drm_atomic_state *state, struct drm
> >>> }
> >>> #endif
> >>>
> >>> +static bool is_chromeos(void)
> >>> +{
> >>> + struct mm_struct *mm = current->mm;
> >>> + struct file *exe_file;
> >>> + bool ret;
> >>> +
> >>> + /* ChromeOS renames its thread to DrmThread. Also check the executable
> >>> + * name. */
> >>> + if (strcmp(current->comm, "DrmThread") != 0 || !mm)
> >>> + return false;
> >>> +
> >>> + rcu_read_lock();
> >>> + exe_file = rcu_dereference(mm->exe_file);
> >>> + if (exe_file && !get_file_rcu(exe_file))
> >>> + exe_file = NULL;
> >>> + rcu_read_unlock();
> >>> +
> >>> + if (!exe_file)
> >>> + return false;
> >>> + ret = strcmp(exe_file->f_path.dentry->d_name.name, "chrome") == 0;
> >>> + fput(exe_file);
> >>> +
> >>> + return ret;
> >>> +}
> >>> +
> >>> static int validate_overlay(struct drm_atomic_state *state)
> >>> {
> >>> int i;
> >>> @@ -10601,6 +10626,10 @@ static int validate_overlay(struct drm_atomic_state *state)
> >>> struct drm_plane_state *new_plane_state;
> >>> struct drm_plane_state *primary_state, *overlay_state = NULL;
> >>>
> >>> + /* This is a workaround for ChromeOS only */
> >>> + if (!is_chromeos())
> >>> + return 0;
> >>> +
> >>> /* Check if primary plane is contained inside overlay */
> >>> for_each_new_plane_in_state_reverse(state, plane, new_plane_state, i) {
> >>> if (plane->type == DRM_PLANE_TYPE_OVERLAY) {
> >>>
> >>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v5] amd/display: only require overlay plane to cover whole CRTC on ChromeOS
2021-10-12 21:03 ` Alex Deucher
@ 2021-10-14 15:34 ` Simon Ser
0 siblings, 0 replies; 11+ messages in thread
From: Simon Ser @ 2021-10-14 15:34 UTC (permalink / raw)
To: Alex Deucher
Cc: Harry Wentland, amd-gfx list, Alex Deucher, Harry Wentland,
Nicholas Kazlauskas, Bas Nieuwenhuizen, Rodrigo Siqueira,
Sean Paul
On Tuesday, October 12th, 2021 at 23:03, Alex Deucher <alexdeucher@gmail.com> wrote:
> > > @Harry Wentland, @Simon Ser Do you have a preference on whether we
> > > apply this patch or revert ddab8bd788f5? I'm fine with either.
I'd prefer to revert because (1) the ChromeOS team seems to be okay with that
(2) they can remove it more easily once they have fixed their userspace and
(3) this avoids adding workarounds in the kernel.
Will send a patch for this soon!
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v5] amd/display: only require overlay plane to cover whole CRTC on ChromeOS
2021-10-11 15:16 [PATCH v5] amd/display: only require overlay plane to cover whole CRTC on ChromeOS Simon Ser
2021-10-12 9:08 ` Paul Menzel
2021-10-12 14:39 ` Harry Wentland
@ 2021-10-21 18:01 ` Rodrigo Siqueira Jordao
2 siblings, 0 replies; 11+ messages in thread
From: Rodrigo Siqueira Jordao @ 2021-10-21 18:01 UTC (permalink / raw)
To: Simon Ser, amd-gfx, Mark Yacoub
Cc: Alex Deucher, Harry Wentland, Nicholas Kazlauskas,
Bas Nieuwenhuizen, Rodrigo Siqueira, Sean Paul
On 2021-10-11 11:16 a.m., Simon Ser wrote:
> Commit ddab8bd788f5 ("drm/amd/display: Fix two cursor duplication when
> using overlay") changed the atomic validation code to forbid the
> overlay plane from being used if it doesn't cover the whole CRTC. The
> motivation is that ChromeOS uses the atomic API for everything except
> the cursor plane (which uses the legacy API). Thus amdgpu must always
> be prepared to enable/disable/move the cursor plane at any time without
> failing (or else ChromeOS will trip over).
>
> As discussed in [1], there's no reason why the ChromeOS limitation
> should prevent other fully atomic users from taking advantage of the
> overlay plane. Let's limit the check to ChromeOS.
>
> v4: fix ChromeOS detection (Harry)
>
> v5: fix conflict with linux-next
>
> [1]: https://lore.kernel.org/amd-gfx/JIQ_93_cHcshiIDsrMU1huBzx9P9LVQxucx8hQArpQu7Wk5DrCl_vTXj_Q20m_L-8C8A5dSpNcSJ8ehfcCrsQpfB5QG_Spn14EYkH9chtg0=@emersion.fr/>>
> Signed-off-by: Simon Ser <contact@emersion.fr>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Cc: Harry Wentland <hwentlan@amd.com>
> Cc: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
> Cc: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
> Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
> Cc: Sean Paul <seanpaul@chromium.org>
> Fixes: ddab8bd788f5 ("drm/amd/display: Fix two cursor duplication when using overlay")
> ---
> .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 29 +++++++++++++++++++
> 1 file changed, 29 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index f35561b5a465..2eeda1fec506 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -10594,6 +10594,31 @@ static int add_affected_mst_dsc_crtcs(struct drm_atomic_state *state, struct drm
> }
> #endif
>
> +static bool is_chromeos(void)
> +{
> + struct mm_struct *mm = current->mm;
> + struct file *exe_file;
> + bool ret;
> +
> + /* ChromeOS renames its thread to DrmThread. Also check the executable
> + * name. */
> + if (strcmp(current->comm, "DrmThread") != 0 || !mm)
> + return false;
> +
> + rcu_read_lock();
> + exe_file = rcu_dereference(mm->exe_file);
> + if (exe_file && !get_file_rcu(exe_file))
> + exe_file = NULL;
> + rcu_read_unlock();
> +
> + if (!exe_file)
> + return false;
> + ret = strcmp(exe_file->f_path.dentry->d_name.name, "chrome") == 0;
> + fput(exe_file);
> +
> + return ret;
> +}
> +
> static int validate_overlay(struct drm_atomic_state *state)
> {
> int i;
> @@ -10601,6 +10626,10 @@ static int validate_overlay(struct drm_atomic_state *state)
> struct drm_plane_state *new_plane_state;
> struct drm_plane_state *primary_state, *overlay_state = NULL;
>
> + /* This is a workaround for ChromeOS only */
> + if (!is_chromeos())
> + return 0;
> +
> /* Check if primary plane is contained inside overlay */
> for_each_new_plane_in_state_reverse(state, plane, new_plane_state, i) {
> if (plane->type == DRM_PLANE_TYPE_OVERLAY) {
>
Hi Mark,
I tested this patch on ChromeOS, and this can be helpful in two ways:
1. When ChromeOS GUI is running, the workaround for fixing the two
cursor issues works as expected.
2. When we turn off ChromeOS GUI, this patch also works by making some
of the overlay tests pass.
I think we should cherry-pick this patch to the ChromeOS tree. Is it ok
for you?
Thanks
Siqueira
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2021-10-21 18:01 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-11 15:16 [PATCH v5] amd/display: only require overlay plane to cover whole CRTC on ChromeOS Simon Ser
2021-10-12 9:08 ` Paul Menzel
2021-10-12 9:15 ` Simon Ser
2021-10-12 9:24 ` Paul Menzel
2021-10-12 9:30 ` Simon Ser
2021-10-12 14:39 ` Harry Wentland
2021-10-12 19:57 ` Alex Deucher
2021-10-12 20:57 ` Harry Wentland
2021-10-12 21:03 ` Alex Deucher
2021-10-14 15:34 ` Simon Ser
2021-10-21 18:01 ` Rodrigo Siqueira Jordao
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.