diff options
author | Matthew Auld <matthew.auld@intel.com> | 2024-05-22 11:22:01 +0100 |
---|---|---|
committer | Matthew Auld <matthew.auld@intel.com> | 2024-05-22 13:22:40 +0100 |
commit | dc51c682ddb0104851c8ccbe1d644163ae38262b (patch) | |
tree | 047bc2a13d64d27b05ca970c744415cd22acaebf /drivers/gpu/drm/xe/display/xe_display.c | |
parent | 48d74a0a45201de4efa016fb2f556889db37ed28 (diff) |
drm/xe/display: move device_remove over to drmm
i915 display calls this when releasing the drm_device, match this also
in xe by using drmm. intel_display_device_remove() is freeing purely
software state for the drm_device.
v2: fix build error
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Andrzej Hajda <andrzej.hajda@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240522102143.128069-36-matthew.auld@intel.com
Diffstat (limited to 'drivers/gpu/drm/xe/display/xe_display.c')
-rw-r--r-- | drivers/gpu/drm/xe/display/xe_display.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/gpu/drm/xe/display/xe_display.c b/drivers/gpu/drm/xe/display/xe_display.c index 406bc3912f4b..347e625b53be 100644 --- a/drivers/gpu/drm/xe/display/xe_display.c +++ b/drivers/gpu/drm/xe/display/xe_display.c @@ -245,8 +245,6 @@ void xe_display_driver_remove(struct xe_device *xe) return; intel_display_driver_remove(xe); - - intel_display_device_remove(xe); } /* IRQ-related functions */ @@ -388,17 +386,31 @@ void xe_display_pm_resume(struct xe_device *xe) intel_power_domains_enable(xe); } -void xe_display_probe(struct xe_device *xe) +static void display_device_remove(struct drm_device *dev, void *arg) +{ + struct xe_device *xe = arg; + + intel_display_device_remove(xe); +} + +int xe_display_probe(struct xe_device *xe) { + int err; + if (!xe->info.enable_display) goto no_display; intel_display_device_probe(xe); + err = drmm_add_action_or_reset(&xe->drm, display_device_remove, xe); + if (err) + return err; + if (has_display(xe)) - return; + return 0; no_display: xe->info.enable_display = false; unset_display_features(xe); + return 0; } |