1// SPDX-License-Identifier: MIT
2/* Copyright © 2024 Intel Corporation */
3
4#include <drm/intel/display_member.h>
5
6#include "intel_display_conversion.h"
7
8struct intel_display *__drm_to_display(struct drm_device *drm)
9{
10 /*
11 * Note: This relies on both struct drm_i915_private and struct
12 * xe_device having the struct drm_device and struct intel_display *
13 * members at the same relative offsets, as defined by struct
14 * __intel_generic_device.
15 *
16 * See also INTEL_DISPLAY_MEMBER_STATIC_ASSERT().
17 */
18 struct __intel_generic_device *d = container_of(drm, struct __intel_generic_device, drm);
19
20 return d->display;
21}
22

source code of linux/drivers/gpu/drm/i915/display/intel_display_conversion.c