Message ID | 1518584256-25253-15-git-send-email-vidya.srinivas@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Regards Shashank On 2/14/2018 10:27 AM, Vidya Srinivas wrote: > + if ((INTEL_GEN(dev_priv) == 9 && !IS_GEMINILAKE(dev_priv) && > + (plane != 0 || pipe == PIPE_C)) || > + ((INTEL_GEN(dev_priv) == 10 || > + IS_GEMINILAKE(dev_priv)) && plane != 0)) > + num_plane_formats -= 1; Please correct me if I am wrong, but as far as I see, this whole complex if(cond) can be replaced by more readable if's like: if (IS_GEMINILAKE(dev_priv) || IS_GEN10(dev_priv)) { if (plane != 0) num_planes_format -=1; } else { /* GEN9 */ if (plane != 0 || pipe != PIPE_C) num_planes_format -=1; } Or May be even below: if (IS_GEN9(dev_priv) && pipe == PIPE_C) num_planes_format -=1; else if (plane != 0) num_planes_format -=1; Regards Shashank
> -----Original Message----- > From: Sharma, Shashank > Sent: Thursday, February 15, 2018 2:24 PM > To: Srinivas, Vidya <vidya.srinivas@intel.com>; intel- > gfx@lists.freedesktop.org > Cc: maarten.lankhorst@linux.intel.com; Kamath, Sunil > <sunil.kamath@intel.com>; Shankar, Uma <uma.shankar@intel.com>; > Konduru, Chandra <chandra.konduru@intel.com>; Maiti, Nabendu Bikash > <nabendu.bikash.maiti@intel.com> > Subject: Re: [PATCH 14/16] drm/i915: Add NV12 as supported format for > sprite plane > > Regards > > Shashank > > > On 2/14/2018 10:27 AM, Vidya Srinivas wrote: > > + if ((INTEL_GEN(dev_priv) == 9 && !IS_GEMINILAKE(dev_priv) > && > > + (plane != 0 || pipe == PIPE_C)) || > > + ((INTEL_GEN(dev_priv) == 10 || > > + IS_GEMINILAKE(dev_priv)) && plane != 0)) > > + num_plane_formats -= 1; > Please correct me if I am wrong, but as far as I see, this whole complex > if(cond) can be replaced by more readable if's like: > if (IS_GEMINILAKE(dev_priv) || IS_GEN10(dev_priv)) { > if (plane != 0) > num_planes_format -=1; > } else { /* GEN9 */ > if (plane != 0 || pipe != PIPE_C) > num_planes_format -=1; > } Agree :) Thanks. Will fix it. Regards Vidya > > Or May be even below: > > if (IS_GEN9(dev_priv) && pipe == PIPE_C) > num_planes_format -=1; > else if (plane != 0) > num_planes_format -=1; > > Regards > Shashank
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c index 77a5433..4290a23 100644 --- a/drivers/gpu/drm/i915/intel_sprite.c +++ b/drivers/gpu/drm/i915/intel_sprite.c @@ -1171,6 +1171,7 @@ static uint32_t skl_plane_formats[] = { DRM_FORMAT_YVYU, DRM_FORMAT_UYVY, DRM_FORMAT_VYUY, + DRM_FORMAT_NV12, }; static const uint64_t skl_plane_format_modifiers_noccs[] = { @@ -1369,6 +1370,12 @@ intel_sprite_plane_create(struct drm_i915_private *dev_priv, plane_formats = skl_plane_formats; num_plane_formats = ARRAY_SIZE(skl_plane_formats); + if ((INTEL_GEN(dev_priv) == 9 && !IS_GEMINILAKE(dev_priv) && + (plane != 0 || pipe == PIPE_C)) || + ((INTEL_GEN(dev_priv) == 10 || + IS_GEMINILAKE(dev_priv)) && plane != 0)) + num_plane_formats -= 1; + if (skl_plane_has_ccs(dev_priv, pipe, PLANE_SPRITE0 + plane)) modifiers = skl_plane_format_modifiers_ccs; else