Skip to content

Commit ed428ff

Browse files
vsyrjalarodrigovivi
authored andcommitted
drm/i915: Nuke INTEL_OUTPUT_FORMAT_INVALID
We tend to use output_format!=RGB as a shorthand for YCbCr, but this fails if we have a disabled crtc where output_format==INVALID. We're now getting some fail from intel_color_check() when we have: hw.enable==false hw.ctm!=NULL output_format==INVALID Let's avoid that by throwing INTEL_OUTPUT_FORMAT_INVALID to the dumpster, and thus everything defaults to RGB when the crtc is disabled. This does beg the deeper question of how much of the state should we in fact be validating when hw/uapi.enable==false. And should we even be doing the uapi->hw copy when uapi.enable==false? So far I've not been able to come up with satisfactory answers for myself, so I'm putting it off for the moment. Cc: Lee Shawn C <[email protected]> Fixes: 0aa5c38 ("drm/i915: support two CSC module on gen11 and later") Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/2964 Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: José Roberto de Souza <[email protected]> (cherry picked from commit 7e07c68) Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent 34b07d4 commit ed428ff

File tree

3 files changed

+1
-4
lines changed

3 files changed

+1
-4
lines changed

drivers/gpu/drm/i915/display/intel_crtc.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ void intel_crtc_state_reset(struct intel_crtc_state *crtc_state,
109109
crtc_state->cpu_transcoder = INVALID_TRANSCODER;
110110
crtc_state->master_transcoder = INVALID_TRANSCODER;
111111
crtc_state->hsw_workaround_pipe = INVALID_PIPE;
112-
crtc_state->output_format = INTEL_OUTPUT_FORMAT_INVALID;
113112
crtc_state->scaler_state.scaler_id = -1;
114113
crtc_state->mst_master_transcoder = INVALID_TRANSCODER;
115114
}

drivers/gpu/drm/i915/display/intel_display.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10211,7 +10211,6 @@ static void snprintf_output_types(char *buf, size_t len,
1021110211
}
1021210212

1021310213
static const char * const output_format_str[] = {
10214-
[INTEL_OUTPUT_FORMAT_INVALID] = "Invalid",
1021510214
[INTEL_OUTPUT_FORMAT_RGB] = "RGB",
1021610215
[INTEL_OUTPUT_FORMAT_YCBCR420] = "YCBCR4:2:0",
1021710216
[INTEL_OUTPUT_FORMAT_YCBCR444] = "YCBCR4:4:4",
@@ -10220,7 +10219,7 @@ static const char * const output_format_str[] = {
1022010219
static const char *output_formats(enum intel_output_format format)
1022110220
{
1022210221
if (format >= ARRAY_SIZE(output_format_str))
10223-
format = INTEL_OUTPUT_FORMAT_INVALID;
10222+
return "invalid";
1022410223
return output_format_str[format];
1022510224
}
1022610225

drivers/gpu/drm/i915/display/intel_display_types.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,6 @@ struct intel_crtc_wm_state {
830830
};
831831

832832
enum intel_output_format {
833-
INTEL_OUTPUT_FORMAT_INVALID,
834833
INTEL_OUTPUT_FORMAT_RGB,
835834
INTEL_OUTPUT_FORMAT_YCBCR420,
836835
INTEL_OUTPUT_FORMAT_YCBCR444,

0 commit comments

Comments
 (0)