* Re: [PATCH] drm/i915/display: Fix NV12 sub plane atomic state
2020-08-10 15:16 [PATCH] drm/i915/display: Fix NV12 sub plane atomic state Uma Shankar
@ 2020-08-10 14:47 ` Maarten Lankhorst
2020-08-10 14:56 ` Shankar, Uma
0 siblings, 1 reply; 3+ messages in thread
From: Maarten Lankhorst @ 2020-08-10 14:47 UTC (permalink / raw)
To: Uma Shankar, intel-gfx; +Cc: alex.zuo, Abhishek Kumar, stable
Op 10-08-2020 om 17:16 schreef Uma Shankar:
> From: Abhishek Kumar <abhishek4.kumar@intel.com>
>
> For NV12 display sub plane is also configured and drivers internally
> create plane atomic state. Driver copies all of the param of main
> plane atomic state to sub planer atomic state but in sub plane
> atomic state crtc is not added ,so when drm atomic state is configured
> for commit ,fake commit handler is created for sub plane and also
> state is not cleared when NV12 buffer is not displayed.
>
> Fixes: 1f594b209fe1 ("drm/i915: Remove special case slave handling during hw programming")
> Change-Id: I447b16bf433dfb5b43b2e4cade258fc775aee065
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: stable@vger.kernel.org
> Signed-off-by: Abhishek Kumar <abhishek4.kumar@intel.com>
> Signed-off-by: Uma Shankar <uma.shankar@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_display.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 522c772a2111..76da2189b01d 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -12502,6 +12502,7 @@ static int icl_check_nv12_planes(struct intel_crtc_state *crtc_state)
> struct intel_atomic_state *state = to_intel_atomic_state(crtc_state->uapi.state);
> struct intel_plane *plane, *linked;
> struct intel_plane_state *plane_state;
> + int ret;
> int i;
>
> if (INTEL_GEN(dev_priv) < 11)
> @@ -12576,6 +12577,11 @@ static int icl_check_nv12_planes(struct intel_crtc_state *crtc_state)
> linked_state->uapi.src = plane_state->uapi.src;
> linked_state->uapi.dst = plane_state->uapi.dst;
>
> + /* Update Linked plane crtc same as of main plane */
> + ret = drm_atomic_set_crtc_for_plane(&linked_state->uapi, plane_state->uapi.crtc);
> + if(ret)
> + return ret;
> +
> if (icl_is_hdr_plane(dev_priv, plane->id)) {
> if (linked->id == PLANE_SPRITE5)
> plane_state->cus_ctl |= PLANE_CUS_PLANE_7;
That shouldnt be done, uapi.crtc should be NULL for the slave plane.
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH] drm/i915/display: Fix NV12 sub plane atomic state
2020-08-10 14:47 ` Maarten Lankhorst
@ 2020-08-10 14:56 ` Shankar, Uma
0 siblings, 0 replies; 3+ messages in thread
From: Shankar, Uma @ 2020-08-10 14:56 UTC (permalink / raw)
To: Maarten Lankhorst, intel-gfx@lists.freedesktop.org
Cc: Zuo, Alex, Kumar, Abhishek4, stable@vger.kernel.org
> -----Original Message-----
> From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Sent: Monday, August 10, 2020 8:17 PM
> To: Shankar, Uma <uma.shankar@intel.com>; intel-gfx@lists.freedesktop.org
> Cc: Zuo, Alex <alex.zuo@intel.com>; Kumar, Abhishek4
> <abhishek4.kumar@intel.com>; stable@vger.kernel.org
> Subject: Re: [PATCH] drm/i915/display: Fix NV12 sub plane atomic state
>
> Op 10-08-2020 om 17:16 schreef Uma Shankar:
> > From: Abhishek Kumar <abhishek4.kumar@intel.com>
> >
> > For NV12 display sub plane is also configured and drivers internally
> > create plane atomic state. Driver copies all of the param of main
> > plane atomic state to sub planer atomic state but in sub plane atomic
> > state crtc is not added ,so when drm atomic state is configured for
> > commit ,fake commit handler is created for sub plane and also state is
> > not cleared when NV12 buffer is not displayed.
> >
> > Fixes: 1f594b209fe1 ("drm/i915: Remove special case slave handling
> > during hw programming")
> > Change-Id: I447b16bf433dfb5b43b2e4cade258fc775aee065
> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Abhishek Kumar <abhishek4.kumar@intel.com>
> > Signed-off-by: Uma Shankar <uma.shankar@intel.com>
> > ---
> > drivers/gpu/drm/i915/display/intel_display.c | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_display.c
> > b/drivers/gpu/drm/i915/display/intel_display.c
> > index 522c772a2111..76da2189b01d 100644
> > --- a/drivers/gpu/drm/i915/display/intel_display.c
> > +++ b/drivers/gpu/drm/i915/display/intel_display.c
> > @@ -12502,6 +12502,7 @@ static int icl_check_nv12_planes(struct
> intel_crtc_state *crtc_state)
> > struct intel_atomic_state *state = to_intel_atomic_state(crtc_state-
> >uapi.state);
> > struct intel_plane *plane, *linked;
> > struct intel_plane_state *plane_state;
> > + int ret;
> > int i;
> >
> > if (INTEL_GEN(dev_priv) < 11)
> > @@ -12576,6 +12577,11 @@ static int icl_check_nv12_planes(struct
> intel_crtc_state *crtc_state)
> > linked_state->uapi.src = plane_state->uapi.src;
> > linked_state->uapi.dst = plane_state->uapi.dst;
> >
> > + /* Update Linked plane crtc same as of main plane */
> > + ret = drm_atomic_set_crtc_for_plane(&linked_state->uapi,
> plane_state->uapi.crtc);
> > + if(ret)
> > + return ret;
> > +
> > if (icl_is_hdr_plane(dev_priv, plane->id)) {
> > if (linked->id == PLANE_SPRITE5)
> > plane_state->cus_ctl |= PLANE_CUS_PLANE_7;
>
> That shouldnt be done, uapi.crtc should be NULL for the slave plane.
Hi Maarten,
We seem to get EBUSY from commit and flips fail with NV12, RGB seems to work fine.
This change is making things work. What could be possibly going wrong ?
This is being tested with Chrome browser app while switching tabs with videos being
played on each of these tabs.
Regards,
Uma Shankar
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] drm/i915/display: Fix NV12 sub plane atomic state
@ 2020-08-10 15:16 Uma Shankar
2020-08-10 14:47 ` Maarten Lankhorst
0 siblings, 1 reply; 3+ messages in thread
From: Uma Shankar @ 2020-08-10 15:16 UTC (permalink / raw)
To: intel-gfx
Cc: alex.zuo, Abhishek Kumar, Maarten Lankhorst, stable, Uma Shankar
From: Abhishek Kumar <abhishek4.kumar@intel.com>
For NV12 display sub plane is also configured and drivers internally
create plane atomic state. Driver copies all of the param of main
plane atomic state to sub planer atomic state but in sub plane
atomic state crtc is not added ,so when drm atomic state is configured
for commit ,fake commit handler is created for sub plane and also
state is not cleared when NV12 buffer is not displayed.
Fixes: 1f594b209fe1 ("drm/i915: Remove special case slave handling during hw programming")
Change-Id: I447b16bf433dfb5b43b2e4cade258fc775aee065
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Abhishek Kumar <abhishek4.kumar@intel.com>
Signed-off-by: Uma Shankar <uma.shankar@intel.com>
---
drivers/gpu/drm/i915/display/intel_display.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 522c772a2111..76da2189b01d 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -12502,6 +12502,7 @@ static int icl_check_nv12_planes(struct intel_crtc_state *crtc_state)
struct intel_atomic_state *state = to_intel_atomic_state(crtc_state->uapi.state);
struct intel_plane *plane, *linked;
struct intel_plane_state *plane_state;
+ int ret;
int i;
if (INTEL_GEN(dev_priv) < 11)
@@ -12576,6 +12577,11 @@ static int icl_check_nv12_planes(struct intel_crtc_state *crtc_state)
linked_state->uapi.src = plane_state->uapi.src;
linked_state->uapi.dst = plane_state->uapi.dst;
+ /* Update Linked plane crtc same as of main plane */
+ ret = drm_atomic_set_crtc_for_plane(&linked_state->uapi, plane_state->uapi.crtc);
+ if(ret)
+ return ret;
+
if (icl_is_hdr_plane(dev_priv, plane->id)) {
if (linked->id == PLANE_SPRITE5)
plane_state->cus_ctl |= PLANE_CUS_PLANE_7;
--
2.26.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-08-10 14:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-10 15:16 [PATCH] drm/i915/display: Fix NV12 sub plane atomic state Uma Shankar
2020-08-10 14:47 ` Maarten Lankhorst
2020-08-10 14:56 ` Shankar, Uma
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox