Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/vc4: kms: Store channel in local variable

We use the channel from our vc4_crtc_state structure in multiple places,
let's store it in a local variable to make it cleaner.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://lore.kernel.org/r/20220328153659.2382206-5-maxime@cerno.tech

+8 -7
+8 -7
drivers/gpu/drm/vc4/vc4_kms.c
··· 283 283 for_each_new_crtc_in_state(state, crtc, crtc_state, i) { 284 284 struct vc4_crtc_state *vc4_state = to_vc4_crtc_state(crtc_state); 285 285 struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); 286 + unsigned int channel = vc4_state->assigned_channel; 286 287 287 288 if (!vc4_state->update_muxing) 288 289 continue; 289 290 290 291 switch (vc4_crtc->data->hvs_output) { 291 292 case 2: 292 - mux = (vc4_state->assigned_channel == 2) ? 0 : 1; 293 + mux = (channel == 2) ? 0 : 1; 293 294 reg = HVS_READ(SCALER_DISPECTRL); 294 295 HVS_WRITE(SCALER_DISPECTRL, 295 296 (reg & ~SCALER_DISPECTRL_DSP2_MUX_MASK) | ··· 298 297 break; 299 298 300 299 case 3: 301 - if (vc4_state->assigned_channel == VC4_HVS_CHANNEL_DISABLED) 300 + if (channel == VC4_HVS_CHANNEL_DISABLED) 302 301 mux = 3; 303 302 else 304 - mux = vc4_state->assigned_channel; 303 + mux = channel; 305 304 306 305 reg = HVS_READ(SCALER_DISPCTRL); 307 306 HVS_WRITE(SCALER_DISPCTRL, ··· 310 309 break; 311 310 312 311 case 4: 313 - if (vc4_state->assigned_channel == VC4_HVS_CHANNEL_DISABLED) 312 + if (channel == VC4_HVS_CHANNEL_DISABLED) 314 313 mux = 3; 315 314 else 316 - mux = vc4_state->assigned_channel; 315 + mux = channel; 317 316 318 317 reg = HVS_READ(SCALER_DISPEOLN); 319 318 HVS_WRITE(SCALER_DISPEOLN, ··· 323 322 break; 324 323 325 324 case 5: 326 - if (vc4_state->assigned_channel == VC4_HVS_CHANNEL_DISABLED) 325 + if (channel == VC4_HVS_CHANNEL_DISABLED) 327 326 mux = 3; 328 327 else 329 - mux = vc4_state->assigned_channel; 328 + mux = channel; 330 329 331 330 reg = HVS_READ(SCALER_DISPDITHER); 332 331 HVS_WRITE(SCALER_DISPDITHER,