2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/drivers/gpu/drm/i915/display/intel_display_conversion.c
Jani Nikula 88555f703f drm/i915/display: add struct drm_device to struct intel_display conversion function
Add a __drm_to_display() conversion function to hide the to_i915() usage
and the implicit dependency on i915_drv.h from intel_display_types.h.

The goal is for this implementation to be a transitional helper
only. One idea I've floated around in the past would be to require a
struct intel_display pointer member to be placed right after struct
drm_device member in struct drm_i915_private and struct xe_device
[1][2].

[1] https://lore.kernel.org/r/7777ff70e2be0663de4398aa6f75f0c54146cbfc.1709727127.git.jani.nikula@intel.com
[2] https://lore.kernel.org/r/0b9459da6c8cba0f74bf2781d69182fa6801cd97.1709727127.git.jani.nikula@intel.com

Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/cbbf26fa58ef662946303c972b1a1ff1547ddcfe.1732104170.git.jani.nikula@intel.com
2024-12-16 18:09:42 +02:00

15 lines
306 B
C

// SPDX-License-Identifier: MIT
/* Copyright © 2024 Intel Corporation */
#include "i915_drv.h"
struct intel_display *__i915_to_display(struct drm_i915_private *i915)
{
return &i915->display;
}
struct intel_display *__drm_to_display(struct drm_device *drm)
{
return __i915_to_display(to_i915(drm));
}