mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-11 12:44:49 -04:00
drm/xe/display: move compat runtime pm stubs to the correct file
Move things that belong to intel_runtime_pm.h to the correct place. Add missing header guards while at it. Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/edefb6ef02920528eacdf01b828cfc45ce55e061.1717004739.git.jani.nikula@intel.com
This commit is contained in:
@@ -14,11 +14,9 @@
|
||||
|
||||
#include "soc/intel_pch.h"
|
||||
#include "xe_device.h"
|
||||
#include "xe_pm.h"
|
||||
#include "i915_reg_defs.h"
|
||||
#include "i915_utils.h"
|
||||
#include "intel_runtime_pm.h"
|
||||
#include <linux/pm_runtime.h>
|
||||
|
||||
static inline struct drm_i915_private *to_i915(const struct drm_device *dev)
|
||||
{
|
||||
@@ -112,58 +110,12 @@ static inline struct drm_i915_private *kdev_to_i915(struct device *kdev)
|
||||
|
||||
#define HAS_128_BYTE_Y_TILING(xe) (xe || 1)
|
||||
|
||||
#include "intel_wakeref.h"
|
||||
|
||||
static inline intel_wakeref_t intel_runtime_pm_get(struct xe_runtime_pm *pm)
|
||||
{
|
||||
struct xe_device *xe = container_of(pm, struct xe_device, runtime_pm);
|
||||
|
||||
return xe_pm_runtime_resume_and_get(xe);
|
||||
}
|
||||
|
||||
static inline intel_wakeref_t intel_runtime_pm_get_if_in_use(struct xe_runtime_pm *pm)
|
||||
{
|
||||
struct xe_device *xe = container_of(pm, struct xe_device, runtime_pm);
|
||||
|
||||
return xe_pm_runtime_get_if_in_use(xe);
|
||||
}
|
||||
|
||||
static inline intel_wakeref_t intel_runtime_pm_get_noresume(struct xe_runtime_pm *pm)
|
||||
{
|
||||
struct xe_device *xe = container_of(pm, struct xe_device, runtime_pm);
|
||||
|
||||
xe_pm_runtime_get_noresume(xe);
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline void intel_runtime_pm_put_unchecked(struct xe_runtime_pm *pm)
|
||||
{
|
||||
struct xe_device *xe = container_of(pm, struct xe_device, runtime_pm);
|
||||
|
||||
xe_pm_runtime_put(xe);
|
||||
}
|
||||
|
||||
static inline void intel_runtime_pm_put(struct xe_runtime_pm *pm, intel_wakeref_t wakeref)
|
||||
{
|
||||
if (wakeref)
|
||||
intel_runtime_pm_put_unchecked(pm);
|
||||
}
|
||||
|
||||
#define intel_runtime_pm_get_raw intel_runtime_pm_get
|
||||
#define intel_runtime_pm_put_raw intel_runtime_pm_put
|
||||
#define assert_rpm_wakelock_held(x) do { } while (0)
|
||||
#define assert_rpm_raw_wakeref_held(x) do { } while (0)
|
||||
|
||||
#define I915_PRIORITY_DISPLAY 0
|
||||
struct i915_sched_attr {
|
||||
int priority;
|
||||
};
|
||||
#define i915_gem_fence_wait_priority(fence, attr) do { (void) attr; } while (0)
|
||||
|
||||
#define with_intel_runtime_pm(rpm, wf) \
|
||||
for ((wf) = intel_runtime_pm_get(rpm); (wf); \
|
||||
intel_runtime_pm_put((rpm), (wf)), (wf) = 0)
|
||||
|
||||
#define pdev_to_i915 pdev_to_xe_device
|
||||
#define RUNTIME_INFO(xe) (&(xe)->info.i915_runtime)
|
||||
|
||||
|
||||
@@ -3,7 +3,12 @@
|
||||
* Copyright © 2023 Intel Corporation
|
||||
*/
|
||||
|
||||
#ifndef __INTEL_RUNTIME_PM_H__
|
||||
#define __INTEL_RUNTIME_PM_H__
|
||||
|
||||
#include "intel_wakeref.h"
|
||||
#include "xe_device_types.h"
|
||||
#include "xe_pm.h"
|
||||
|
||||
#define intel_runtime_pm xe_runtime_pm
|
||||
|
||||
@@ -14,3 +19,49 @@ static inline void disable_rpm_wakeref_asserts(void *rpm)
|
||||
static inline void enable_rpm_wakeref_asserts(void *rpm)
|
||||
{
|
||||
}
|
||||
|
||||
static inline intel_wakeref_t intel_runtime_pm_get(struct xe_runtime_pm *pm)
|
||||
{
|
||||
struct xe_device *xe = container_of(pm, struct xe_device, runtime_pm);
|
||||
|
||||
return xe_pm_runtime_resume_and_get(xe);
|
||||
}
|
||||
|
||||
static inline intel_wakeref_t intel_runtime_pm_get_if_in_use(struct xe_runtime_pm *pm)
|
||||
{
|
||||
struct xe_device *xe = container_of(pm, struct xe_device, runtime_pm);
|
||||
|
||||
return xe_pm_runtime_get_if_in_use(xe);
|
||||
}
|
||||
|
||||
static inline intel_wakeref_t intel_runtime_pm_get_noresume(struct xe_runtime_pm *pm)
|
||||
{
|
||||
struct xe_device *xe = container_of(pm, struct xe_device, runtime_pm);
|
||||
|
||||
xe_pm_runtime_get_noresume(xe);
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline void intel_runtime_pm_put_unchecked(struct xe_runtime_pm *pm)
|
||||
{
|
||||
struct xe_device *xe = container_of(pm, struct xe_device, runtime_pm);
|
||||
|
||||
xe_pm_runtime_put(xe);
|
||||
}
|
||||
|
||||
static inline void intel_runtime_pm_put(struct xe_runtime_pm *pm, intel_wakeref_t wakeref)
|
||||
{
|
||||
if (wakeref)
|
||||
intel_runtime_pm_put_unchecked(pm);
|
||||
}
|
||||
|
||||
#define intel_runtime_pm_get_raw intel_runtime_pm_get
|
||||
#define intel_runtime_pm_put_raw intel_runtime_pm_put
|
||||
#define assert_rpm_wakelock_held(x) do { } while (0)
|
||||
#define assert_rpm_raw_wakeref_held(x) do { } while (0)
|
||||
|
||||
#define with_intel_runtime_pm(rpm, wf) \
|
||||
for ((wf) = intel_runtime_pm_get(rpm); (wf); \
|
||||
intel_runtime_pm_put((rpm), (wf)), (wf) = 0)
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user