@@ -724,10 +724,24 @@ static const struct intel_display_device_info xe_lpdp_display = {
724724 BIT (PORT_TC1 ) | BIT (PORT_TC2 ) | BIT (PORT_TC3 ) | BIT (PORT_TC4 ),
725725};
726726
727+ /*
728+ * Separate detection for no display cases to keep the display id array simple.
729+ *
730+ * IVB Q requires subvendor and subdevice matching to differentiate from IVB D
731+ * GT2 server.
732+ */
733+ static bool has_no_display (struct pci_dev * pdev )
734+ {
735+ static const struct pci_device_id ids [] = {
736+ INTEL_IVB_Q_IDS (0 ),
737+ {}
738+ };
739+
740+ return pci_match_id (ids , pdev );
741+ }
742+
727743#undef INTEL_VGA_DEVICE
728- #undef INTEL_QUANTA_VGA_DEVICE
729744#define INTEL_VGA_DEVICE (id , info ) { id, info }
730- #define INTEL_QUANTA_VGA_DEVICE (info ) { 0x16a, info }
731745
732746static const struct {
733747 u32 devid ;
@@ -752,7 +766,6 @@ static const struct {
752766 INTEL_IRONLAKE_M_IDS (& ilk_m_display ),
753767 INTEL_SNB_D_IDS (& snb_display ),
754768 INTEL_SNB_M_IDS (& snb_display ),
755- INTEL_IVB_Q_IDS (NULL ), /* must be first IVB in list */
756769 INTEL_IVB_M_IDS (& ivb_display ),
757770 INTEL_IVB_D_IDS (& ivb_display ),
758771 INTEL_HSW_IDS (& hsw_display ),
@@ -800,6 +813,15 @@ probe_gmdid_display(struct drm_i915_private *i915, u16 *ver, u16 *rel, u16 *step
800813 u32 val ;
801814 int i ;
802815
816+ /* The caller expects to ver, rel and step to be initialized
817+ * here, and there's no good way to check when there was a
818+ * failure and no_display was returned. So initialize all these
819+ * values here zero, to be sure.
820+ */
821+ * ver = 0 ;
822+ * rel = 0 ;
823+ * step = 0 ;
824+
803825 addr = pci_iomap_range (pdev , 0 , i915_mmio_reg_offset (GMD_ID_DISPLAY ), sizeof (u32 ));
804826 if (!addr ) {
805827 drm_err (& i915 -> drm , "Cannot map MMIO BAR to read display GMD_ID\n" );
@@ -809,9 +831,10 @@ probe_gmdid_display(struct drm_i915_private *i915, u16 *ver, u16 *rel, u16 *step
809831 val = ioread32 (addr );
810832 pci_iounmap (pdev , addr );
811833
812- if (val == 0 )
813- /* Platform doesn't have display */
834+ if (val == 0 ) {
835+ drm_dbg_kms ( & i915 -> drm , "Device doesn't have display\n" );
814836 return & no_display ;
837+ }
815838
816839 * ver = REG_FIELD_GET (GMD_ID_ARCH_MASK , val );
817840 * rel = REG_FIELD_GET (GMD_ID_RELEASE_MASK , val );
@@ -837,6 +860,11 @@ intel_display_device_probe(struct drm_i915_private *i915, bool has_gmdid,
837860 if (has_gmdid )
838861 return probe_gmdid_display (i915 , gmdid_ver , gmdid_rel , gmdid_step );
839862
863+ if (has_no_display (pdev )) {
864+ drm_dbg_kms (& i915 -> drm , "Device doesn't have display\n" );
865+ return & no_display ;
866+ }
867+
840868 for (i = 0 ; i < ARRAY_SIZE (intel_display_ids ); i ++ ) {
841869 if (intel_display_ids [i ].devid == pdev -> device )
842870 return intel_display_ids [i ].info ;
@@ -858,7 +886,7 @@ void intel_display_device_info_runtime_init(struct drm_i915_private *i915)
858886 BUILD_BUG_ON (BITS_PER_TYPE (display_runtime -> port_mask ) < I915_MAX_PORTS );
859887
860888 /* Wa_14011765242: adl-s A0,A1 */
861- if (IS_ADLS_DISPLAY_STEP (i915 , STEP_A0 , STEP_A2 ))
889+ if (IS_ALDERLAKE_S ( i915 ) && IS_DISPLAY_STEP (i915 , STEP_A0 , STEP_A2 ))
862890 for_each_pipe (i915 , pipe )
863891 display_runtime -> num_scalers [pipe ] = 0 ;
864892 else if (DISPLAY_VER (i915 ) >= 11 ) {
0 commit comments