mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-03-22 07:27:12 +08:00
drm/xe/display: Runtime pm wrappers for display parent interface
Implement runtime pm wrappers for xe driver and add them into display
parent interface.
v3:
- drop useless include
- drop xe_display_rpm_{get, put}_raw
v2:
- move xe_display_rpm_interface code into xe_display_rpm.c
- rename xe_rpm as xe_display_rpm
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://patch.msgid.link/20251030202836.1815680-5-jouni.hogander@intel.com
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
#include "intel_hotplug.h"
|
||||
#include "intel_opregion.h"
|
||||
#include "skl_watermark.h"
|
||||
#include "xe_display_rpm.h"
|
||||
#include "xe_module.h"
|
||||
|
||||
/* Ensure drm and display members are placed properly. */
|
||||
@@ -517,6 +518,7 @@ static void display_device_remove(struct drm_device *dev, void *arg)
|
||||
}
|
||||
|
||||
static const struct intel_display_parent_interface parent = {
|
||||
.rpm = &xe_display_rpm_interface,
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
/* Copyright © 2025 Intel Corporation */
|
||||
|
||||
#include <drm/intel/display_parent_interface.h>
|
||||
|
||||
#include "intel_display_core.h"
|
||||
#include "intel_display_rpm.h"
|
||||
#include "xe_device.h"
|
||||
@@ -71,3 +73,67 @@ void intel_display_rpm_assert_unblock(struct intel_display *display)
|
||||
{
|
||||
/* FIXME */
|
||||
}
|
||||
|
||||
static struct ref_tracker *xe_display_rpm_get(const struct drm_device *drm)
|
||||
{
|
||||
return xe_pm_runtime_resume_and_get(to_xe_device(drm)) ? INTEL_WAKEREF_DEF : NULL;
|
||||
}
|
||||
|
||||
static struct ref_tracker *xe_display_rpm_get_if_in_use(const struct drm_device *drm)
|
||||
{
|
||||
return xe_pm_runtime_get_if_in_use(to_xe_device(drm)) ? INTEL_WAKEREF_DEF : NULL;
|
||||
}
|
||||
|
||||
static struct ref_tracker *xe_display_rpm_get_noresume(const struct drm_device *drm)
|
||||
{
|
||||
xe_pm_runtime_get_noresume(to_xe_device(drm));
|
||||
|
||||
return INTEL_WAKEREF_DEF;
|
||||
}
|
||||
|
||||
static void xe_display_rpm_put(const struct drm_device *drm, struct ref_tracker *wakeref)
|
||||
{
|
||||
if (wakeref)
|
||||
xe_pm_runtime_put(to_xe_device(drm));
|
||||
}
|
||||
|
||||
static void xe_display_rpm_put_unchecked(const struct drm_device *drm)
|
||||
{
|
||||
xe_pm_runtime_put(to_xe_device(drm));
|
||||
}
|
||||
|
||||
static bool xe_display_rpm_suspended(const struct drm_device *drm)
|
||||
{
|
||||
struct xe_device *xe = to_xe_device(drm);
|
||||
|
||||
return pm_runtime_suspended(xe->drm.dev);
|
||||
}
|
||||
|
||||
static void xe_display_rpm_assert_held(const struct drm_device *drm)
|
||||
{
|
||||
/* FIXME */
|
||||
}
|
||||
|
||||
static void xe_display_rpm_assert_block(const struct drm_device *drm)
|
||||
{
|
||||
/* FIXME */
|
||||
}
|
||||
|
||||
static void xe_display_rpm_assert_unblock(const struct drm_device *drm)
|
||||
{
|
||||
/* FIXME */
|
||||
}
|
||||
|
||||
const struct intel_display_rpm_interface xe_display_rpm_interface = {
|
||||
.get = xe_display_rpm_get,
|
||||
.get_raw = xe_display_rpm_get,
|
||||
.get_if_in_use = xe_display_rpm_get_if_in_use,
|
||||
.get_noresume = xe_display_rpm_get_noresume,
|
||||
.put = xe_display_rpm_put,
|
||||
.put_raw = xe_display_rpm_put,
|
||||
.put_unchecked = xe_display_rpm_put_unchecked,
|
||||
.suspended = xe_display_rpm_suspended,
|
||||
.assert_held = xe_display_rpm_assert_held,
|
||||
.assert_block = xe_display_rpm_assert_block,
|
||||
.assert_unblock = xe_display_rpm_assert_unblock
|
||||
};
|
||||
|
||||
11
drivers/gpu/drm/xe/display/xe_display_rpm.h
Normal file
11
drivers/gpu/drm/xe/display/xe_display_rpm.h
Normal file
@@ -0,0 +1,11 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/*
|
||||
* Copyright © 2025 Intel Corporation
|
||||
*/
|
||||
|
||||
#ifndef _XE_DISPLAY_RPM_H_
|
||||
#define _XE_DISPLAY_RPM_H_
|
||||
|
||||
extern const struct intel_display_rpm_interface xe_display_rpm_interface;
|
||||
|
||||
#endif /* _XE_DISPLAY_RPM_H_ */
|
||||
Reference in New Issue
Block a user