Files
linux/include/drm/intel/display_parent_interface.h
Jani Nikula 3815e8f2ff drm/{i915,xe}/display: move irq calls to parent interface
Add an irq parent driver interface for the .enabled and .synchronize
calls. This lets us drop the dependency on i915_drv.h and i915_irq.h in
multiple places, and subsequently remove the compat i915_irq.h and
i915_irq.c files along with the display/ext directory from xe
altogether.

Introduce new intel_parent.[ch] as the wrapper layer to chase the
function pointers and convert between generic and more specific display
types.

v2: Keep static wrappers in intel_display_irq.c (Ville)

v3: Full blown wrappers in intel_parent.[ch] (Ville)

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/dd62dd52ef10d9ecf77da3bdf6a70f71193d141c.1763370931.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2025-11-19 19:33:43 +02:00

54 lines
1.8 KiB
C

/* SPDX-License-Identifier: MIT */
/* Copyright © 2025 Intel Corporation x*/
#ifndef __DISPLAY_PARENT_INTERFACE_H__
#define __DISPLAY_PARENT_INTERFACE_H__
#include <linux/types.h>
struct drm_device;
struct ref_tracker;
struct intel_display_rpm_interface {
struct ref_tracker *(*get)(const struct drm_device *drm);
struct ref_tracker *(*get_raw)(const struct drm_device *drm);
struct ref_tracker *(*get_if_in_use)(const struct drm_device *drm);
struct ref_tracker *(*get_noresume)(const struct drm_device *drm);
void (*put)(const struct drm_device *drm, struct ref_tracker *wakeref);
void (*put_raw)(const struct drm_device *drm, struct ref_tracker *wakeref);
void (*put_unchecked)(const struct drm_device *drm);
bool (*suspended)(const struct drm_device *drm);
void (*assert_held)(const struct drm_device *drm);
void (*assert_block)(const struct drm_device *drm);
void (*assert_unblock)(const struct drm_device *drm);
};
struct intel_display_irq_interface {
bool (*enabled)(struct drm_device *drm);
void (*synchronize)(struct drm_device *drm);
};
/**
* struct intel_display_parent_interface - services parent driver provides to display
*
* The parent, or core, driver provides a pointer to this structure to display
* driver when calling intel_display_device_probe(). The display driver uses it
* to access services provided by the parent driver. The structure may contain
* sub-struct pointers to group function pointers by functionality.
*
* All function and sub-struct pointers must be initialized and callable unless
* explicitly marked as "optional" below. The display driver will only NULL
* check the optional pointers.
*/
struct intel_display_parent_interface {
/** @rpm: Runtime PM functions */
const struct intel_display_rpm_interface *rpm;
/** @irq: IRQ interface */
const struct intel_display_irq_interface *irq;
};
#endif