[Intel-gfx] [PATCH 2/2] drm/i915: Use fb->format->is_yuv for the g4x+ sprite RGB vs. YUV check
Jani Nikula
jani.nikula at linux.intel.com
Mon Sep 14 15:20:17 UTC 2020
On Mon, 14 Sep 2020, Ville Syrjälä <ville.syrjala at linux.intel.com> wrote:
> On Fri, Sep 11, 2020 at 09:13:18PM +0300, Jani Nikula wrote:
>> On Thu, 06 Feb 2020, Ville Syrjala <ville.syrjala at linux.intel.com> wrote:
>> > From: Ville Syrjälä <ville.syrjala at linux.intel.com>
>> >
>> > g4x+ sprites have an extra cdclk limitation listed for RGB formats.
>> > For some random reason I chose to use cpp>=4 as the check for that.
>> > While that does actually work let's deobfuscate it by checking
>> > for !is_yuv instead. I suspect is_yuv didn't exist way back when
>> > I originally write the code.
>>
>> Mmh, there are formats with cpp >= 4 && is_yuv == true making this look
>> like a functional change... but I presume those are not relevant and/or
>> this change is the right thing to do anyway.
>
> This only applies to g4x/ilk/snb which only support
> YUYV/etc. (cpp==2), and 32/64bpp RGB (cpp==4/8).
Ack.
>
>>
>> Acked-by: Jani Nikula <jani.nikula at intel.com>
>>
>> >
>> > Also drop the duplicate comment.
>> >
>> > Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
>> > ---
>> > drivers/gpu/drm/i915/display/intel_sprite.c | 4 ++--
>> > 1 file changed, 2 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/drivers/gpu/drm/i915/display/intel_sprite.c b/drivers/gpu/drm/i915/display/intel_sprite.c
>> > index 6e2e22d9bbaa..f95fe2c99468 100644
>> > --- a/drivers/gpu/drm/i915/display/intel_sprite.c
>> > +++ b/drivers/gpu/drm/i915/display/intel_sprite.c
>> > @@ -1624,8 +1624,8 @@ static int g4x_sprite_min_cdclk(const struct intel_crtc_state *crtc_state,
>> > limit -= decimate;
>> >
>> > /* -10% for RGB */
>> > - if (fb->format->cpp[0] >= 4)
>> > - limit--; /* -10% for RGB */
>> > + if (!fb->format->is_yuv)
>> > + limit--;
>> >
>> > /*
>> > * We should also do -10% if sprite scaling is enabled
>>
>> --
>> Jani Nikula, Intel Open Source Graphics Center
--
Jani Nikula, Intel Open Source Graphics Center
More information about the Intel-gfx
mailing list