mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 11:21:26 -04:00
Call the parent driver pcode functions through the parent interface function pointers instead of expecting both to have functions of the same name. In i915, add the interface to existing intel_pcode.[ch], while in xe move them to new display/xe_display_pcode.[ch] and build it only for CONFIG_DRM_XE_DISPLAY=y. Do not add separate write and write_timeout calls in the interface. Instead, handle the default 1 ms timeout in the intel_parent.c glue layer. This drops the last intel_pcode.h includes from display, and allows us to remove the corresponding xe compat header. v2: initialize .pcode in i915 Reviewed-by: Michał Grzelak <michal.grzelak@intel.com> Link: https://patch.msgid.link/20260126112925.2452171-1-jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
39 lines
1.2 KiB
C
39 lines
1.2 KiB
C
// SPDX-License-Identifier: MIT
|
|
/* Copyright © 2026 Intel Corporation */
|
|
|
|
#include <drm/intel/display_parent_interface.h>
|
|
|
|
#include "xe_device.h"
|
|
#include "xe_pcode.h"
|
|
|
|
static int xe_display_pcode_read(struct drm_device *drm, u32 mbox, u32 *val, u32 *val1)
|
|
{
|
|
struct xe_device *xe = to_xe_device(drm);
|
|
struct xe_tile *tile = xe_device_get_root_tile(xe);
|
|
|
|
return xe_pcode_read(tile, mbox, val, val1);
|
|
}
|
|
|
|
static int xe_display_pcode_write_timeout(struct drm_device *drm, u32 mbox, u32 val, int timeout_ms)
|
|
{
|
|
struct xe_device *xe = to_xe_device(drm);
|
|
struct xe_tile *tile = xe_device_get_root_tile(xe);
|
|
|
|
return xe_pcode_write_timeout(tile, mbox, val, timeout_ms);
|
|
}
|
|
|
|
static int xe_display_pcode_request(struct drm_device *drm, u32 mbox, u32 request,
|
|
u32 reply_mask, u32 reply, int timeout_base_ms)
|
|
{
|
|
struct xe_device *xe = to_xe_device(drm);
|
|
struct xe_tile *tile = xe_device_get_root_tile(xe);
|
|
|
|
return xe_pcode_request(tile, mbox, request, reply_mask, reply, timeout_base_ms);
|
|
}
|
|
|
|
const struct intel_display_pcode_interface xe_display_pcode_interface = {
|
|
.read = xe_display_pcode_read,
|
|
.write = xe_display_pcode_write_timeout,
|
|
.request = xe_display_pcode_request,
|
|
};
|