mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 08:33:17 +02:00
drm/i915/display: add intel_display_conversion.c to hide stuff better
The __to_intel_display() generics require the definition of struct drm_i915_private i.e. inclusion of i915_drv.h. Add intel_display_conversion.c with a __i915_to_display() function to do the conversion without the intel_display_conversion.h having an implicit dependency on i915_drv.h. The long term goal is to remove __to_intel_display() and the intel_display_conversion.[ch] files altoghether, and this is merely a transitional step to make the dependencies on i915_drv.h explicit. Reviewed-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/39e99b765b8c1a05d001659c39686a661ac268e2.1732104170.git.jani.nikula@intel.com
This commit is contained in:
parent
17d7072607
commit
adceb41688
|
|
@ -238,6 +238,7 @@ i915-y += \
|
|||
display/intel_crtc_state_dump.o \
|
||||
display/intel_cursor.o \
|
||||
display/intel_display.o \
|
||||
display/intel_display_conversion.o \
|
||||
display/intel_display_driver.o \
|
||||
display/intel_display_irq.o \
|
||||
display/intel_display_params.o \
|
||||
|
|
|
|||
9
drivers/gpu/drm/i915/display/intel_display_conversion.c
Normal file
9
drivers/gpu/drm/i915/display/intel_display_conversion.c
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
// 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;
|
||||
}
|
||||
|
|
@ -8,14 +8,19 @@
|
|||
#ifndef __INTEL_DISPLAY_CONVERSION__
|
||||
#define __INTEL_DISPLAY_CONVERSION__
|
||||
|
||||
struct drm_i915_private;
|
||||
struct intel_display;
|
||||
|
||||
struct intel_display *__i915_to_display(struct drm_i915_private *i915);
|
||||
|
||||
/*
|
||||
* Transitional macro to optionally convert struct drm_i915_private * to struct
|
||||
* intel_display *, also accepting the latter.
|
||||
*/
|
||||
#define __to_intel_display(p) \
|
||||
_Generic(p, \
|
||||
const struct drm_i915_private *: (&((const struct drm_i915_private *)(p))->display), \
|
||||
struct drm_i915_private *: (&((struct drm_i915_private *)(p))->display), \
|
||||
const struct drm_i915_private *: __i915_to_display((struct drm_i915_private *)(p)), \
|
||||
struct drm_i915_private *: __i915_to_display((struct drm_i915_private *)(p)), \
|
||||
const struct intel_display *: (p), \
|
||||
struct intel_display *: (p))
|
||||
|
||||
|
|
|
|||
|
|
@ -206,6 +206,7 @@ xe-$(CONFIG_DRM_XE_DISPLAY) += \
|
|||
i915-display/intel_ddi.o \
|
||||
i915-display/intel_ddi_buf_trans.o \
|
||||
i915-display/intel_display.o \
|
||||
i915-display/intel_display_conversion.o \
|
||||
i915-display/intel_display_device.o \
|
||||
i915-display/intel_display_driver.o \
|
||||
i915-display/intel_display_irq.o \
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user