Skip to content

Commit e672f9e

Browse files
committed
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: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/fc9ad69a0c7fa972380c654c3b80070ce2f4bf0f.1687878757.git.jani.nikula@intel.com
1 parent 5f25966 commit e672f9e

4 files changed

Lines changed: 14 additions & 11 deletions

File tree

drivers/gpu/drm/i915/display/intel_display_core.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <drm/drm_modeset_lock.h>
1818

1919
#include "intel_cdclk.h"
20+
#include "intel_display_device.h"
2021
#include "intel_display_limits.h"
2122
#include "intel_display_power.h"
2223
#include "intel_dpll_mgr.h"
@@ -429,6 +430,14 @@ struct intel_display {
429430
u32 state;
430431
} hti;
431432

433+
struct {
434+
/* Access with DISPLAY_INFO() */
435+
const struct intel_display_device_info *__device_info;
436+
437+
/* Access with DISPLAY_RUNTIME_INFO() */
438+
struct intel_display_runtime_info __runtime_info;
439+
} info;
440+
432441
struct {
433442
bool false_color;
434443
} ips;

drivers/gpu/drm/i915/i915_drv.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ struct drm_i915_private {
205205

206206
const struct intel_device_info __info; /* Use INTEL_INFO() to access. */
207207
struct intel_runtime_info __runtime; /* Use RUNTIME_INFO() to access. */
208-
struct intel_display_runtime_info __display_runtime; /* Access with DISPLAY_RUNTIME_INFO() */
209208
struct intel_driver_caps caps;
210209

211210
struct i915_dsm dsm;
@@ -417,9 +416,9 @@ static inline struct intel_gt *to_gt(struct drm_i915_private *i915)
417416
(engine__) = rb_to_uabi_engine(rb_next(&(engine__)->uabi_node)))
418417

419418
#define INTEL_INFO(i915) (&(i915)->__info)
420-
#define DISPLAY_INFO(i915) (INTEL_INFO(i915)->display)
421419
#define RUNTIME_INFO(i915) (&(i915)->__runtime)
422-
#define DISPLAY_RUNTIME_INFO(i915) (&(i915)->__display_runtime)
420+
#define DISPLAY_INFO(i915) ((i915)->display.info.__device_info)
421+
#define DISPLAY_RUNTIME_INFO(i915) (&(i915)->display.info.__runtime_info)
423422
#define DRIVER_CAPS(i915) (&(i915)->caps)
424423

425424
#define INTEL_DEVID(i915) (RUNTIME_INFO(i915)->device_id)

drivers/gpu/drm/i915/intel_device_info.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,6 @@ static const struct intel_display_device_info no_display = {};
391391
*/
392392
void intel_device_info_runtime_init(struct drm_i915_private *dev_priv)
393393
{
394-
struct intel_device_info *info = mkwrite_device_info(dev_priv);
395394
struct intel_runtime_info *runtime = RUNTIME_INFO(dev_priv);
396395

397396
if (HAS_DISPLAY(dev_priv))
@@ -401,7 +400,7 @@ void intel_device_info_runtime_init(struct drm_i915_private *dev_priv)
401400
if (!HAS_DISPLAY(dev_priv)) {
402401
dev_priv->drm.driver_features &= ~(DRIVER_MODESET |
403402
DRIVER_ATOMIC);
404-
info->display = &no_display;
403+
dev_priv->display.info.__device_info = &no_display;
405404
}
406405

407406
/* Disable nuclear pageflip by default on pre-g4x */
@@ -444,8 +443,8 @@ void intel_device_info_driver_create(struct drm_i915_private *i915,
444443
memcpy(runtime, &INTEL_INFO(i915)->__runtime, sizeof(*runtime));
445444

446445
/* Probe display support */
447-
info->display = intel_display_device_probe(i915, info->has_gmd_id,
448-
&ver, &rel, &step);
446+
i915->display.info.__device_info = intel_display_device_probe(i915, info->has_gmd_id,
447+
&ver, &rel, &step);
449448
memcpy(DISPLAY_RUNTIME_INFO(i915),
450449
&DISPLAY_INFO(i915)->__runtime_defaults,
451450
sizeof(*DISPLAY_RUNTIME_INFO(i915)));

drivers/gpu/drm/i915/intel_device_info.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929

3030
#include "intel_step.h"
3131

32-
#include "display/intel_display_device.h"
33-
3432
#include "gt/intel_engine_types.h"
3533
#include "gt/intel_context_types.h"
3634
#include "gt/intel_sseu.h"
@@ -240,8 +238,6 @@ struct intel_device_info {
240238
DEV_INFO_FOR_EACH_FLAG(DEFINE_FLAG);
241239
#undef DEFINE_FLAG
242240

243-
const struct intel_display_device_info *display;
244-
245241
/*
246242
* Initial runtime info. Do not access outside of i915_driver_create().
247243
*/

0 commit comments

Comments
 (0)