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: Extract i915_overlay_setup()

Pull the gem/gt related bits of the overlay setup into
a separate function (i915_overlay_setup()) that will eventually
move to the i915 side of the parent vs. display driver split.

For now we'll also have to pass in the overlay struct, but
that will disappear once the i915 vs. display split is completed.

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-10-ville.syrjala@linux.intel.com

+25 -15
+25 -15
drivers/gpu/drm/i915/display/intel_overlay.c
··· 1430 1430 return err; 1431 1431 } 1432 1432 1433 - void intel_overlay_setup(struct intel_display *display) 1433 + static int i915_overlay_setup(struct drm_device *drm, 1434 + struct intel_overlay *overlay, 1435 + bool needs_physical) 1434 1436 { 1435 - struct drm_i915_private *dev_priv = to_i915(display->drm); 1436 - struct intel_overlay *overlay; 1437 + struct drm_i915_private *dev_priv = to_i915(drm); 1437 1438 struct intel_engine_cs *engine; 1438 - int ret; 1439 - 1440 - if (!HAS_OVERLAY(display)) 1441 - return; 1442 1439 1443 1440 engine = to_gt(dev_priv)->engine[RCS0]; 1444 1441 if (!engine || !engine->kernel_context) 1442 + return -ENOENT; 1443 + 1444 + overlay->context = engine->kernel_context; 1445 + 1446 + i915_active_init(&overlay->last_flip, 1447 + NULL, intel_overlay_last_flip_retire, 0); 1448 + 1449 + return get_registers(overlay, needs_physical); 1450 + } 1451 + 1452 + void intel_overlay_setup(struct intel_display *display) 1453 + { 1454 + struct intel_overlay *overlay; 1455 + int ret; 1456 + 1457 + if (!HAS_OVERLAY(display)) 1445 1458 return; 1446 1459 1447 1460 overlay = kzalloc_obj(*overlay); 1448 1461 if (!overlay) 1449 1462 return; 1450 1463 1464 + ret = i915_overlay_setup(display->drm, overlay, 1465 + OVERLAY_NEEDS_PHYSICAL(display)); 1466 + if (ret) 1467 + goto out_free; 1468 + 1451 1469 overlay->display = display; 1452 - overlay->context = engine->kernel_context; 1453 1470 overlay->color_key = 0x0101fe; 1454 1471 overlay->color_key_enabled = true; 1455 1472 overlay->brightness = -19; 1456 1473 overlay->contrast = 75; 1457 1474 overlay->saturation = 146; 1458 - 1459 - i915_active_init(&overlay->last_flip, 1460 - NULL, intel_overlay_last_flip_retire, 0); 1461 - 1462 - ret = get_registers(overlay, OVERLAY_NEEDS_PHYSICAL(display)); 1463 - if (ret) 1464 - goto out_free; 1465 1475 1466 1476 memset_io(overlay->regs, 0, sizeof(struct overlay_registers)); 1467 1477 update_polyphase_filter(overlay->regs);