Commit e672f9e9 authored by Jani Nikula's avatar Jani Nikula

drm/i915: move display device and runtime info to struct intel_display

Continue moving all things display further into display files and
structures.

v2: Sort includes (Matt)

Cc: Matt Roper <matthew.d.roper@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: default avatarMatt Roper <matthew.d.roper@intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/fc9ad69a0c7fa972380c654c3b80070ce2f4bf0f.1687878757.git.jani.nikula@intel.com
parent 5f25966e
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <drm/drm_modeset_lock.h> #include <drm/drm_modeset_lock.h>
#include "intel_cdclk.h" #include "intel_cdclk.h"
#include "intel_display_device.h"
#include "intel_display_limits.h" #include "intel_display_limits.h"
#include "intel_display_power.h" #include "intel_display_power.h"
#include "intel_dpll_mgr.h" #include "intel_dpll_mgr.h"
...@@ -429,6 +430,14 @@ struct intel_display { ...@@ -429,6 +430,14 @@ struct intel_display {
u32 state; u32 state;
} hti; } hti;
struct {
/* Access with DISPLAY_INFO() */
const struct intel_display_device_info *__device_info;
/* Access with DISPLAY_RUNTIME_INFO() */
struct intel_display_runtime_info __runtime_info;
} info;
struct { struct {
bool false_color; bool false_color;
} ips; } ips;
......
...@@ -205,7 +205,6 @@ struct drm_i915_private { ...@@ -205,7 +205,6 @@ struct drm_i915_private {
const struct intel_device_info __info; /* Use INTEL_INFO() to access. */ const struct intel_device_info __info; /* Use INTEL_INFO() to access. */
struct intel_runtime_info __runtime; /* Use RUNTIME_INFO() to access. */ struct intel_runtime_info __runtime; /* Use RUNTIME_INFO() to access. */
struct intel_display_runtime_info __display_runtime; /* Access with DISPLAY_RUNTIME_INFO() */
struct intel_driver_caps caps; struct intel_driver_caps caps;
struct i915_dsm dsm; struct i915_dsm dsm;
...@@ -417,9 +416,9 @@ static inline struct intel_gt *to_gt(struct drm_i915_private *i915) ...@@ -417,9 +416,9 @@ static inline struct intel_gt *to_gt(struct drm_i915_private *i915)
(engine__) = rb_to_uabi_engine(rb_next(&(engine__)->uabi_node))) (engine__) = rb_to_uabi_engine(rb_next(&(engine__)->uabi_node)))
#define INTEL_INFO(i915) (&(i915)->__info) #define INTEL_INFO(i915) (&(i915)->__info)
#define DISPLAY_INFO(i915) (INTEL_INFO(i915)->display)
#define RUNTIME_INFO(i915) (&(i915)->__runtime) #define RUNTIME_INFO(i915) (&(i915)->__runtime)
#define DISPLAY_RUNTIME_INFO(i915) (&(i915)->__display_runtime) #define DISPLAY_INFO(i915) ((i915)->display.info.__device_info)
#define DISPLAY_RUNTIME_INFO(i915) (&(i915)->display.info.__runtime_info)
#define DRIVER_CAPS(i915) (&(i915)->caps) #define DRIVER_CAPS(i915) (&(i915)->caps)
#define INTEL_DEVID(i915) (RUNTIME_INFO(i915)->device_id) #define INTEL_DEVID(i915) (RUNTIME_INFO(i915)->device_id)
......
...@@ -391,7 +391,6 @@ static const struct intel_display_device_info no_display = {}; ...@@ -391,7 +391,6 @@ static const struct intel_display_device_info no_display = {};
*/ */
void intel_device_info_runtime_init(struct drm_i915_private *dev_priv) void intel_device_info_runtime_init(struct drm_i915_private *dev_priv)
{ {
struct intel_device_info *info = mkwrite_device_info(dev_priv);
struct intel_runtime_info *runtime = RUNTIME_INFO(dev_priv); struct intel_runtime_info *runtime = RUNTIME_INFO(dev_priv);
if (HAS_DISPLAY(dev_priv)) if (HAS_DISPLAY(dev_priv))
...@@ -401,7 +400,7 @@ void intel_device_info_runtime_init(struct drm_i915_private *dev_priv) ...@@ -401,7 +400,7 @@ void intel_device_info_runtime_init(struct drm_i915_private *dev_priv)
if (!HAS_DISPLAY(dev_priv)) { if (!HAS_DISPLAY(dev_priv)) {
dev_priv->drm.driver_features &= ~(DRIVER_MODESET | dev_priv->drm.driver_features &= ~(DRIVER_MODESET |
DRIVER_ATOMIC); DRIVER_ATOMIC);
info->display = &no_display; dev_priv->display.info.__device_info = &no_display;
} }
/* Disable nuclear pageflip by default on pre-g4x */ /* Disable nuclear pageflip by default on pre-g4x */
...@@ -444,8 +443,8 @@ void intel_device_info_driver_create(struct drm_i915_private *i915, ...@@ -444,8 +443,8 @@ void intel_device_info_driver_create(struct drm_i915_private *i915,
memcpy(runtime, &INTEL_INFO(i915)->__runtime, sizeof(*runtime)); memcpy(runtime, &INTEL_INFO(i915)->__runtime, sizeof(*runtime));
/* Probe display support */ /* Probe display support */
info->display = intel_display_device_probe(i915, info->has_gmd_id, i915->display.info.__device_info = intel_display_device_probe(i915, info->has_gmd_id,
&ver, &rel, &step); &ver, &rel, &step);
memcpy(DISPLAY_RUNTIME_INFO(i915), memcpy(DISPLAY_RUNTIME_INFO(i915),
&DISPLAY_INFO(i915)->__runtime_defaults, &DISPLAY_INFO(i915)->__runtime_defaults,
sizeof(*DISPLAY_RUNTIME_INFO(i915))); sizeof(*DISPLAY_RUNTIME_INFO(i915)));
......
...@@ -29,8 +29,6 @@ ...@@ -29,8 +29,6 @@
#include "intel_step.h" #include "intel_step.h"
#include "display/intel_display_device.h"
#include "gt/intel_engine_types.h" #include "gt/intel_engine_types.h"
#include "gt/intel_context_types.h" #include "gt/intel_context_types.h"
#include "gt/intel_sseu.h" #include "gt/intel_sseu.h"
...@@ -240,8 +238,6 @@ struct intel_device_info { ...@@ -240,8 +238,6 @@ struct intel_device_info {
DEV_INFO_FOR_EACH_FLAG(DEFINE_FLAG); DEV_INFO_FOR_EACH_FLAG(DEFINE_FLAG);
#undef DEFINE_FLAG #undef DEFINE_FLAG
const struct intel_display_device_info *display;
/* /*
* Initial runtime info. Do not access outside of i915_driver_create(). * Initial runtime info. Do not access outside of i915_driver_create().
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment