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/i915/panic: Clean up the variables

Use the standard variable names for things, and get rid of any
annoying aliasing variables. And sprinkle the consts in while at
it.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251119181606.17129-7-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>

+29 -33
+26 -29
drivers/gpu/drm/i915/display/intel_plane.c
··· 1274 1274 return offset; 1275 1275 } 1276 1276 1277 - static void intel_panic_flush(struct drm_plane *plane) 1277 + static void intel_panic_flush(struct drm_plane *_plane) 1278 1278 { 1279 - struct intel_plane_state *plane_state = to_intel_plane_state(plane->state); 1279 + struct intel_plane *plane = to_intel_plane(_plane); 1280 + struct intel_display *display = to_intel_display(plane); 1281 + const struct intel_plane_state *plane_state = to_intel_plane_state(plane->base.state); 1280 1282 struct intel_crtc *crtc = to_intel_crtc(plane_state->hw.crtc); 1281 - struct intel_crtc_state *crtc_state = to_intel_crtc_state(crtc->base.state); 1282 - struct intel_plane *iplane = to_intel_plane(plane); 1283 - struct intel_display *display = to_intel_display(iplane); 1284 - struct drm_framebuffer *fb = plane_state->hw.fb; 1285 - struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb); 1283 + const struct intel_crtc_state *crtc_state = to_intel_crtc_state(crtc->base.state); 1284 + const struct intel_framebuffer *fb = to_intel_framebuffer(plane_state->hw.fb); 1286 1285 1287 - intel_panic_finish(intel_fb->panic); 1286 + intel_panic_finish(fb->panic); 1288 1287 1289 1288 if (crtc_state->enable_psr2_sel_fetch) { 1290 1289 /* Force a full update for psr2 */ 1291 - intel_psr2_panic_force_full_update(display, crtc_state); 1290 + intel_psr2_panic_force_full_update(crtc_state); 1292 1291 } 1293 1292 1294 1293 /* Flush the cache and don't disable tiling if it's the fbdev framebuffer.*/ 1295 - if (intel_fb == intel_fbdev_framebuffer(display->fbdev.fbdev)) { 1294 + if (fb == intel_fbdev_framebuffer(display->fbdev.fbdev)) { 1296 1295 struct iosys_map map; 1297 1296 1298 1297 intel_fbdev_get_map(display->fbdev.fbdev, &map); 1299 - drm_clflush_virt_range(map.vaddr, fb->pitches[0] * fb->height); 1298 + drm_clflush_virt_range(map.vaddr, fb->base.pitches[0] * fb->base.height); 1300 1299 return; 1301 1300 } 1302 1301 1303 - if (fb->modifier && iplane->disable_tiling) 1304 - iplane->disable_tiling(iplane); 1302 + if (fb->base.modifier != DRM_FORMAT_MOD_LINEAR && plane->disable_tiling) 1303 + plane->disable_tiling(plane); 1305 1304 } 1306 1305 1307 1306 static unsigned int (*intel_get_tiling_func(u64 fb_modifier))(unsigned int width, ··· 1338 1339 { 1339 1340 struct intel_plane_state *plane_state; 1340 1341 struct drm_gem_object *obj; 1341 - struct drm_framebuffer *fb; 1342 - struct intel_framebuffer *intel_fb; 1342 + struct intel_framebuffer *fb; 1343 1343 struct intel_display *display = to_intel_display(plane->dev); 1344 1344 1345 1345 if (!plane->state || !plane->state->fb || !plane->state->visible) 1346 1346 return -ENODEV; 1347 1347 1348 1348 plane_state = to_intel_plane_state(plane->state); 1349 - fb = plane_state->hw.fb; 1350 - intel_fb = to_intel_framebuffer(fb); 1349 + fb = to_intel_framebuffer(plane_state->hw.fb); 1351 1350 1352 - obj = intel_fb_bo(fb); 1351 + obj = intel_fb_bo(&fb->base); 1353 1352 if (!obj) 1354 1353 return -ENODEV; 1355 1354 1356 - if (intel_fb == intel_fbdev_framebuffer(display->fbdev.fbdev)) { 1355 + if (fb == intel_fbdev_framebuffer(display->fbdev.fbdev)) { 1357 1356 intel_fbdev_get_map(display->fbdev.fbdev, &sb->map[0]); 1358 1357 } else { 1359 1358 int ret; 1360 1359 /* Can't disable tiling if DPT is in use */ 1361 - if (intel_fb_uses_dpt(fb)) { 1362 - if (fb->format->cpp[0] != 4) 1360 + if (intel_fb_uses_dpt(&fb->base)) { 1361 + if (fb->base.format->cpp[0] != 4) 1363 1362 return -EOPNOTSUPP; 1364 - intel_fb->panic_tiling = intel_get_tiling_func(fb->modifier); 1365 - if (!intel_fb->panic_tiling) 1363 + fb->panic_tiling = intel_get_tiling_func(fb->base.modifier); 1364 + if (!fb->panic_tiling) 1366 1365 return -EOPNOTSUPP; 1367 1366 } 1368 - sb->private = intel_fb; 1369 - ret = intel_panic_setup(intel_fb->panic, sb); 1367 + sb->private = fb; 1368 + ret = intel_panic_setup(fb->panic, sb); 1370 1369 if (ret) 1371 1370 return ret; 1372 1371 } 1373 - sb->width = fb->width; 1374 - sb->height = fb->height; 1372 + sb->width = fb->base.width; 1373 + sb->height = fb->base.height; 1375 1374 /* Use the generic linear format, because tiling, RC, CCS, CC 1376 1375 * will be disabled in disable_tiling() 1377 1376 */ 1378 - sb->format = drm_format_info(fb->format->format); 1379 - sb->pitch[0] = fb->pitches[0]; 1377 + sb->format = drm_format_info(fb->base.format->format); 1378 + sb->pitch[0] = fb->base.pitches[0]; 1380 1379 1381 1380 return 0; 1382 1381 }
+2 -2
drivers/gpu/drm/i915/display/intel_psr.c
··· 2992 2992 return 0; 2993 2993 } 2994 2994 2995 - void intel_psr2_panic_force_full_update(struct intel_display *display, 2996 - struct intel_crtc_state *crtc_state) 2995 + void intel_psr2_panic_force_full_update(const struct intel_crtc_state *crtc_state) 2997 2996 { 2997 + struct intel_display *display = to_intel_display(crtc_state); 2998 2998 struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); 2999 2999 enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; 3000 3000 u32 val = man_trk_ctl_enable_bit_get(display);
+1 -2
drivers/gpu/drm/i915/display/intel_psr.h
··· 59 59 struct intel_crtc *crtc); 60 60 void intel_psr2_program_trans_man_trk_ctl(struct intel_dsb *dsb, 61 61 const struct intel_crtc_state *crtc_state); 62 - void intel_psr2_panic_force_full_update(struct intel_display *display, 63 - struct intel_crtc_state *crtc_state); 62 + void intel_psr2_panic_force_full_update(const struct intel_crtc_state *crtc_state); 64 63 void intel_psr_pause(struct intel_dp *intel_dp); 65 64 void intel_psr_resume(struct intel_dp *intel_dp); 66 65 bool intel_psr_needs_vblank_notification(const struct intel_crtc_state *crtc_state);