summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/display
diff options
context:
space:
mode:
authorJani Nikula <jani.nikula@intel.com>2025-09-18 11:40:57 +0300
committerJani Nikula <jani.nikula@intel.com>2025-09-19 09:32:36 +0300
commita170c6ca8ba84c3a901796814e4b1d07157f0620 (patch)
tree2070f073e2357bcf21523f6baf27f53eaa498536 /drivers/gpu/drm/xe/display
parentec4dae5e9b2cbdadcc9e22c0472f8a2749674355 (diff)
drm/{i915, xe}/fbdev: add intel_fbdev_fb_bo_destroy()
i915 and xe do different things on the failure path; i915 calls drm_gem_object_put() while xe calls xe_bo_unpin_map_no_vm(). Add a helper to enable further refactoring. v2: Call drm_gem_object_put() on intel_fbdev_fb_bo_destroy() Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://lore.kernel.org/r/22bc3c3158f5a22ab258ada8684766fdf75fefec.1758184771.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/display')
-rw-r--r--drivers/gpu/drm/xe/display/intel_fbdev_fb.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/xe/display/intel_fbdev_fb.c b/drivers/gpu/drm/xe/display/intel_fbdev_fb.c
index 3ae9d41cb62c..e1043617c3ae 100644
--- a/drivers/gpu/drm/xe/display/intel_fbdev_fb.c
+++ b/drivers/gpu/drm/xe/display/intel_fbdev_fb.c
@@ -49,6 +49,11 @@ struct drm_gem_object *intel_fbdev_fb_bo_create(struct drm_device *drm, int size
return &obj->ttm.base;
}
+void intel_fbdev_fb_bo_destroy(struct drm_gem_object *obj)
+{
+ xe_bo_unpin_map_no_vm(gem_to_xe_bo(obj));
+}
+
struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_device *drm,
struct drm_mode_fb_cmd2 *mode_cmd)
{
@@ -71,7 +76,7 @@ struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_device *drm,
mode_cmd->modifier[0]),
mode_cmd);
if (IS_ERR(fb)) {
- xe_bo_unpin_map_no_vm(gem_to_xe_bo(obj));
+ intel_fbdev_fb_bo_destroy(obj);
goto err;
}