Message ID | 20221026113906.10551-10-ville.syrjala@linux.intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm/i915: More gamma work | expand |
LGTM. Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com> On 10/26/2022 5:09 PM, Ville Syrjala wrote: > From: Ville Syrjälä <ville.syrjala@linux.intel.com> > > Since the pipe CSC sits between the degamma and gamma LUTs there > is no way to make us it for RGB->YCbCr conversion when both LUTs > are also active. Simply reject such combos. > > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> > --- > drivers/gpu/drm/i915/display/intel_color.c | 18 ++++++++++++++++-- > 1 file changed, 16 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c > index 435394cad359..926784f266f2 100644 > --- a/drivers/gpu/drm/i915/display/intel_color.c > +++ b/drivers/gpu/drm/i915/display/intel_color.c > @@ -1556,7 +1556,14 @@ static int ivb_color_check(struct intel_crtc_state *crtc_state) > if (crtc_state->output_format != INTEL_OUTPUT_FORMAT_RGB && > crtc_state->hw.ctm) { > drm_dbg_kms(&i915->drm, > - "YCBCR and CTM together are not possible\n"); > + "YCbCr and CTM together are not possible\n"); > + return -EINVAL; > + } > + > + if (crtc_state->output_format != INTEL_OUTPUT_FORMAT_RGB && > + crtc_state->hw.degamma_lut && crtc_state->hw.gamma_lut) { > + drm_dbg_kms(&i915->drm, > + "YCbCr and degamma+gamma together are not possible\n"); > return -EINVAL; > } > > @@ -1622,7 +1629,14 @@ static int glk_color_check(struct intel_crtc_state *crtc_state) > if (crtc_state->output_format != INTEL_OUTPUT_FORMAT_RGB && > crtc_state->hw.ctm) { > drm_dbg_kms(&i915->drm, > - "YCBCR and CTM together are not possible\n"); > + "YCbCr and CTM together are not possible\n"); > + return -EINVAL; > + } > + > + if (crtc_state->output_format != INTEL_OUTPUT_FORMAT_RGB && > + crtc_state->hw.degamma_lut && crtc_state->hw.gamma_lut) { > + drm_dbg_kms(&i915->drm, > + "YCbCr and degamma+gamma together are not possible\n"); > return -EINVAL; > } >
diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c index 435394cad359..926784f266f2 100644 --- a/drivers/gpu/drm/i915/display/intel_color.c +++ b/drivers/gpu/drm/i915/display/intel_color.c @@ -1556,7 +1556,14 @@ static int ivb_color_check(struct intel_crtc_state *crtc_state) if (crtc_state->output_format != INTEL_OUTPUT_FORMAT_RGB && crtc_state->hw.ctm) { drm_dbg_kms(&i915->drm, - "YCBCR and CTM together are not possible\n"); + "YCbCr and CTM together are not possible\n"); + return -EINVAL; + } + + if (crtc_state->output_format != INTEL_OUTPUT_FORMAT_RGB && + crtc_state->hw.degamma_lut && crtc_state->hw.gamma_lut) { + drm_dbg_kms(&i915->drm, + "YCbCr and degamma+gamma together are not possible\n"); return -EINVAL; } @@ -1622,7 +1629,14 @@ static int glk_color_check(struct intel_crtc_state *crtc_state) if (crtc_state->output_format != INTEL_OUTPUT_FORMAT_RGB && crtc_state->hw.ctm) { drm_dbg_kms(&i915->drm, - "YCBCR and CTM together are not possible\n"); + "YCbCr and CTM together are not possible\n"); + return -EINVAL; + } + + if (crtc_state->output_format != INTEL_OUTPUT_FORMAT_RGB && + crtc_state->hw.degamma_lut && crtc_state->hw.gamma_lut) { + drm_dbg_kms(&i915->drm, + "YCbCr and degamma+gamma together are not possible\n"); return -EINVAL; }