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/overlay: Make i830_overlay_clock_gating() i915 specific

i830_overlay_clock_gating() will remain on the i915 side of the
parent vs. display driver split. Stop using display specific stuff
inside it.

The one annoyance here is access to the display engine's
DSPCLK_GATE_D register. The proper way to deal with that might
be to move it to the display side, but that seems a bit hard right
now. So leave it where it is for now.

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

+15 -9
+15 -9
drivers/gpu/drm/i915/display/intel_overlay.c
··· 210 210 void (*flip_complete)(struct intel_overlay *ovl); 211 211 }; 212 212 213 - static void i830_overlay_clock_gating(struct intel_display *display, 213 + static void i830_overlay_clock_gating(struct drm_i915_private *i915, 214 214 bool enable) 215 215 { 216 - struct pci_dev *pdev = to_pci_dev(display->drm->dev); 216 + struct pci_dev *pdev = to_pci_dev(i915->drm.dev); 217 217 u8 val; 218 218 219 - /* WA_OVERLAY_CLKGATE:alm */ 219 + /* 220 + * WA_OVERLAY_CLKGATE:alm 221 + * 222 + * FIXME should perhaps be done on the display side? 223 + */ 220 224 if (enable) 221 - intel_de_write(display, DSPCLK_GATE_D, 0); 225 + intel_uncore_write(&i915->uncore, DSPCLK_GATE_D, 0); 222 226 else 223 - intel_de_write(display, DSPCLK_GATE_D, OVRUNIT_CLOCK_GATE_DISABLE); 227 + intel_uncore_write(&i915->uncore, DSPCLK_GATE_D, OVRUNIT_CLOCK_GATE_DISABLE); 224 228 225 229 /* WA_DISABLE_L2CACHE_CLOCK_GATING:alm */ 226 230 pci_bus_read_config_byte(pdev->bus, ··· 270 266 static int i915_overlay_on(struct drm_device *drm, 271 267 u32 frontbuffer_bits) 272 268 { 269 + struct drm_i915_private *i915 = to_i915(drm); 273 270 struct intel_display *display = to_intel_display(drm); 274 271 struct intel_overlay *overlay = display->overlay; 275 272 struct i915_request *rq; ··· 290 285 291 286 overlay->frontbuffer_bits = frontbuffer_bits; 292 287 293 - if (display->platform.i830) 294 - i830_overlay_clock_gating(display, false); 288 + if (IS_I830(i915)) 289 + i830_overlay_clock_gating(i915, false); 295 290 296 291 *cs++ = MI_OVERLAY_FLIP | MI_OVERLAY_ON; 297 292 *cs++ = overlay->flip_addr | OFC_UPDATE; ··· 388 383 static void i915_overlay_off_tail(struct intel_overlay *overlay) 389 384 { 390 385 struct intel_display *display = overlay->display; 386 + struct drm_i915_private *i915 = to_i915(display->drm); 391 387 392 388 i915_overlay_release_old_vma(overlay); 393 389 394 390 overlay->frontbuffer_bits = 0; 395 391 396 - if (display->platform.i830) 397 - i830_overlay_clock_gating(display, true); 392 + if (IS_I830(i915)) 393 + i830_overlay_clock_gating(i915, true); 398 394 } 399 395 400 396 static void i915_overlay_last_flip_retire(struct i915_active *active)