Commit 69d43981 authored by Matt Roper's avatar Matt Roper

drm/i915/display: Make display responsible for probing its own IP

Rather than selecting the display IP and feature flags at the same time
the general PCI probing happens, move this step into the display code
itself so that it can be more easily re-used outside of i915 (i.e., by
the Xe driver).

v2:
 - Make intel_display_device_probe() always return a non-NULL pointer
   and simplify copying of runtime_defaults.  (Andrzej)
v3:
 - Redefine INTEL_VGA_DEVICE/INTEL_QUANTA_DEVICE to eliminate a cast and
   an include of linux/mod_devicetable.h.  (Jani)
 - Keep explicit memcpy for runtime defaults.  (Jani)

Cc: Andrzej Hajda <andrzej.hajda@intel.com>
Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
Reviewed-by: default avatarAndrzej Hajda <andrzej.hajda@intel.com>
Acked-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230523195609.73627-5-matthew.d.roper@intel.com
parent 18e0deee
...@@ -25,6 +25,7 @@ subdir-ccflags-$(CONFIG_DRM_I915_WERROR) += -Werror ...@@ -25,6 +25,7 @@ subdir-ccflags-$(CONFIG_DRM_I915_WERROR) += -Werror
# Fine grained warnings disable # Fine grained warnings disable
CFLAGS_i915_pci.o = $(call cc-disable-warning, override-init) CFLAGS_i915_pci.o = $(call cc-disable-warning, override-init)
CFLAGS_display/intel_display_device.o = $(call cc-disable-warning, override-init)
CFLAGS_display/intel_fbdev.o = $(call cc-disable-warning, override-init) CFLAGS_display/intel_fbdev.o = $(call cc-disable-warning, override-init)
subdir-ccflags-y += -I$(srctree)/$(src) subdir-ccflags-y += -I$(srctree)/$(src)
...@@ -307,6 +308,7 @@ i915-y += \ ...@@ -307,6 +308,7 @@ i915-y += \
display/intel_cx0_phy.o \ display/intel_cx0_phy.o \
display/intel_ddi.o \ display/intel_ddi.o \
display/intel_ddi_buf_trans.o \ display/intel_ddi_buf_trans.o \
display/intel_display_device.o \
display/intel_display_trace.o \ display/intel_display_trace.o \
display/intel_dkl_phy.o \ display/intel_dkl_phy.o \
display/intel_dp.o \ display/intel_dp.o \
......
This diff is collapsed.
...@@ -80,4 +80,7 @@ struct intel_display_device_info { ...@@ -80,4 +80,7 @@ struct intel_display_device_info {
} color; } color;
}; };
const struct intel_display_device_info *
intel_display_device_probe(u16 pci_devid);
#endif #endif
This diff is collapsed.
...@@ -1966,15 +1966,6 @@ ...@@ -1966,15 +1966,6 @@
#define _TRANS_VSYNC_DSI1 0x6b814 #define _TRANS_VSYNC_DSI1 0x6b814
#define _TRANS_VSYNCSHIFT_DSI1 0x6b828 #define _TRANS_VSYNCSHIFT_DSI1 0x6b828
#define TRANSCODER_A_OFFSET 0x60000
#define TRANSCODER_B_OFFSET 0x61000
#define TRANSCODER_C_OFFSET 0x62000
#define CHV_TRANSCODER_C_OFFSET 0x63000
#define TRANSCODER_D_OFFSET 0x63000
#define TRANSCODER_EDP_OFFSET 0x6f000
#define TRANSCODER_DSI0_OFFSET 0x6b000
#define TRANSCODER_DSI1_OFFSET 0x6b800
#define TRANS_HTOTAL(trans) _MMIO_TRANS2((trans), _TRANS_HTOTAL_A) #define TRANS_HTOTAL(trans) _MMIO_TRANS2((trans), _TRANS_HTOTAL_A)
#define TRANS_HBLANK(trans) _MMIO_TRANS2((trans), _TRANS_HBLANK_A) #define TRANS_HBLANK(trans) _MMIO_TRANS2((trans), _TRANS_HBLANK_A)
#define TRANS_HSYNC(trans) _MMIO_TRANS2((trans), _TRANS_HSYNC_A) #define TRANS_HSYNC(trans) _MMIO_TRANS2((trans), _TRANS_HSYNC_A)
...@@ -2622,23 +2613,6 @@ ...@@ -2622,23 +2613,6 @@
#define PIPESTAT_INT_ENABLE_MASK 0x7fff0000 #define PIPESTAT_INT_ENABLE_MASK 0x7fff0000
#define PIPESTAT_INT_STATUS_MASK 0x0000ffff #define PIPESTAT_INT_STATUS_MASK 0x0000ffff
#define PIPE_A_OFFSET 0x70000
#define PIPE_B_OFFSET 0x71000
#define PIPE_C_OFFSET 0x72000
#define PIPE_D_OFFSET 0x73000
#define CHV_PIPE_C_OFFSET 0x74000
/*
* There's actually no pipe EDP. Some pipe registers have
* simply shifted from the pipe to the transcoder, while
* keeping their original offset. Thus we need PIPE_EDP_OFFSET
* to access such registers in transcoder EDP.
*/
#define PIPE_EDP_OFFSET 0x7f000
/* ICL DSI 0 and 1 */
#define PIPE_DSI0_OFFSET 0x7b000
#define PIPE_DSI1_OFFSET 0x7b800
#define TRANSCONF(trans) _MMIO_PIPE2((trans), _TRANSACONF) #define TRANSCONF(trans) _MMIO_PIPE2((trans), _TRANSACONF)
#define PIPEDSL(pipe) _MMIO_PIPE2(pipe, _PIPEADSL) #define PIPEDSL(pipe) _MMIO_PIPE2(pipe, _PIPEADSL)
#define PIPEFRAME(pipe) _MMIO_PIPE2(pipe, _PIPEAFRAMEHIGH) #define PIPEFRAME(pipe) _MMIO_PIPE2(pipe, _PIPEAFRAMEHIGH)
...@@ -3099,13 +3073,6 @@ ...@@ -3099,13 +3073,6 @@
#define CUR_CHICKEN(pipe) _MMIO_CURSOR2(pipe, _CUR_CHICKEN_A) #define CUR_CHICKEN(pipe) _MMIO_CURSOR2(pipe, _CUR_CHICKEN_A)
#define CURSURFLIVE(pipe) _MMIO_CURSOR2(pipe, _CURASURFLIVE) #define CURSURFLIVE(pipe) _MMIO_CURSOR2(pipe, _CURASURFLIVE)
#define CURSOR_A_OFFSET 0x70080
#define CURSOR_B_OFFSET 0x700c0
#define CHV_CURSOR_C_OFFSET 0x700e0
#define IVB_CURSOR_B_OFFSET 0x71080
#define IVB_CURSOR_C_OFFSET 0x72080
#define TGL_CURSOR_D_OFFSET 0x73080
/* Display A control */ /* Display A control */
#define _DSPAADDR_VLV 0x7017C /* vlv/chv */ #define _DSPAADDR_VLV 0x7017C /* vlv/chv */
#define _DSPACNTR 0x70180 #define _DSPACNTR 0x70180
......
...@@ -574,7 +574,6 @@ void intel_device_info_driver_create(struct drm_i915_private *i915, ...@@ -574,7 +574,6 @@ void intel_device_info_driver_create(struct drm_i915_private *i915,
{ {
struct intel_device_info *info; struct intel_device_info *info;
struct intel_runtime_info *runtime; struct intel_runtime_info *runtime;
struct intel_display_runtime_info *display_runtime;
/* Setup the write-once "constant" device info */ /* Setup the write-once "constant" device info */
info = mkwrite_device_info(i915); info = mkwrite_device_info(i915);
...@@ -583,9 +582,12 @@ void intel_device_info_driver_create(struct drm_i915_private *i915, ...@@ -583,9 +582,12 @@ void intel_device_info_driver_create(struct drm_i915_private *i915,
/* Initialize initial runtime info from static const data and pdev. */ /* Initialize initial runtime info from static const data and pdev. */
runtime = RUNTIME_INFO(i915); runtime = RUNTIME_INFO(i915);
memcpy(runtime, &INTEL_INFO(i915)->__runtime, sizeof(*runtime)); memcpy(runtime, &INTEL_INFO(i915)->__runtime, sizeof(*runtime));
display_runtime = DISPLAY_RUNTIME_INFO(i915);
memcpy(display_runtime, &DISPLAY_INFO(i915)->__runtime_defaults, /* Probe display support */
sizeof(*display_runtime)); info->display = intel_display_device_probe(device_id);
memcpy(DISPLAY_RUNTIME_INFO(i915),
&DISPLAY_INFO(i915)->__runtime_defaults,
sizeof(*DISPLAY_RUNTIME_INFO(i915)));
runtime->device_id = device_id; runtime->device_id = device_id;
} }
......
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