diff mbox series

[09/23] drm/i915: Do not add all planes when checking scalers on glk+

Message ID 20190920114235.22411-9-maarten.lankhorst@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series [01/23] drm/i915/dp: Fix dsc bpp calculations, v2. | expand

Commit Message

Maarten Lankhorst Sept. 20, 2019, 11:42 a.m. UTC
We cannot switch between HQ and normal mode on GLK+, so only
add planes on platforms where it makes sense.

We could probably restrict it even more to only add when scaler
users toggles between 1 and 2, but lets just leave it for now.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_atomic.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Matt Roper Sept. 25, 2019, 4:55 a.m. UTC | #1
On Fri, Sep 20, 2019 at 01:42:21PM +0200, Maarten Lankhorst wrote:
> We cannot switch between HQ and normal mode on GLK+, so only
> add planes on platforms where it makes sense.
> 
> We could probably restrict it even more to only add when scaler
> users toggles between 1 and 2, but lets just leave it for now.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_atomic.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c
> index 158594e64bb9..c50e0b218bd6 100644
> --- a/drivers/gpu/drm/i915/display/intel_atomic.c
> +++ b/drivers/gpu/drm/i915/display/intel_atomic.c
> @@ -421,6 +421,11 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv,
>  			 */
>  			if (!plane) {
>  				struct drm_plane_state *state;
> +
> +				/* No need to reprogram, we're not changing scaling mode */
> +				if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv))
> +					continue;
> +

We could probably just combine this into the existing !plane condition
and enhance the comment above that to say "Note that GLK+ scalers don't
have a HQ mode so this isn't necessary on those platforms."

Either way,

Reviewed-by: Matt Roper <matthew.d.roper@intel.com>


>  				plane = drm_plane_from_index(&dev_priv->drm, i);
>  				state = drm_atomic_get_plane_state(drm_state, plane);
>  				if (IS_ERR(state)) {
> -- 
> 2.20.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Maarten Lankhorst Sept. 25, 2019, 12:45 p.m. UTC | #2
Op 25-09-2019 om 06:55 schreef Matt Roper:
> On Fri, Sep 20, 2019 at 01:42:21PM +0200, Maarten Lankhorst wrote:
>> We cannot switch between HQ and normal mode on GLK+, so only
>> add planes on platforms where it makes sense.
>>
>> We could probably restrict it even more to only add when scaler
>> users toggles between 1 and 2, but lets just leave it for now.
>>
>> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>> ---
>>  drivers/gpu/drm/i915/display/intel_atomic.c | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c
>> index 158594e64bb9..c50e0b218bd6 100644
>> --- a/drivers/gpu/drm/i915/display/intel_atomic.c
>> +++ b/drivers/gpu/drm/i915/display/intel_atomic.c
>> @@ -421,6 +421,11 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv,
>>  			 */
>>  			if (!plane) {
>>  				struct drm_plane_state *state;
>> +
>> +				/* No need to reprogram, we're not changing scaling mode */
>> +				if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv))
>> +					continue;
>> +
> We could probably just combine this into the existing !plane condition
> and enhance the comment above that to say "Note that GLK+ scalers don't
> have a HQ mode so this isn't necessary on those platforms."
>
> Either way,
>
> Reviewed-by: Matt Roper <matthew.d.roper@intel.com>

I changed the coment slightly, but we need the continue or we get a null pointer deref.

Thanks for review, pushed 6, 8, 9 and the first patch (although newer v5 version with Ville's R-B).

>
>>  				plane = drm_plane_from_index(&dev_priv->drm, i);
>>  				state = drm_atomic_get_plane_state(drm_state, plane);
>>  				if (IS_ERR(state)) {
>> -- 
>> 2.20.1
>>
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Ville Syrjala Sept. 25, 2019, 1:02 p.m. UTC | #3
On Tue, Sep 24, 2019 at 09:55:31PM -0700, Matt Roper wrote:
> On Fri, Sep 20, 2019 at 01:42:21PM +0200, Maarten Lankhorst wrote:
> > We cannot switch between HQ and normal mode on GLK+, so only
> > add planes on platforms where it makes sense.
> > 
> > We could probably restrict it even more to only add when scaler
> > users toggles between 1 and 2, but lets just leave it for now.
> > 
> > Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_atomic.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c
> > index 158594e64bb9..c50e0b218bd6 100644
> > --- a/drivers/gpu/drm/i915/display/intel_atomic.c
> > +++ b/drivers/gpu/drm/i915/display/intel_atomic.c
> > @@ -421,6 +421,11 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv,
> >  			 */
> >  			if (!plane) {
> >  				struct drm_plane_state *state;
> > +
> > +				/* No need to reprogram, we're not changing scaling mode */
> > +				if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv))
> > +					continue;
> > +
> 
> We could probably just combine this into the existing !plane condition
> and enhance the comment above that to say "Note that GLK+ scalers don't
> have a HQ mode so this isn't necessary on those platforms."

I'm rewriting this whole scaler mess.

> 
> Either way,
> 
> Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
> 
> 
> >  				plane = drm_plane_from_index(&dev_priv->drm, i);
> >  				state = drm_atomic_get_plane_state(drm_state, plane);
> >  				if (IS_ERR(state)) {
> > -- 
> > 2.20.1
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> -- 
> Matt Roper
> Graphics Software Engineer
> VTT-OSGC Platform Enablement
> Intel Corporation
> (916) 356-2795
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c
index 158594e64bb9..c50e0b218bd6 100644
--- a/drivers/gpu/drm/i915/display/intel_atomic.c
+++ b/drivers/gpu/drm/i915/display/intel_atomic.c
@@ -421,6 +421,11 @@  int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv,
 			 */
 			if (!plane) {
 				struct drm_plane_state *state;
+
+				/* No need to reprogram, we're not changing scaling mode */
+				if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv))
+					continue;
+
 				plane = drm_plane_from_index(&dev_priv->drm, i);
 				state = drm_atomic_get_plane_state(drm_state, plane);
 				if (IS_ERR(state)) {