[Intel-gfx] [PATCH v6 0/7] drm/i915/display: Don't use port enum as register offset

Balasubramani Vivekanandan balasubramani.vivekanandan at intel.com
Tue Oct 4 12:53:37 UTC 2022


Prior to display version 12, platforms had DDI ports A,B,C,D,E,F                  
represented by enums PORT_A,PORT_B...PORT_F. The DDI register offsets of          
the ports were in the same order as the ports. So the port enums                   
were directly used as index to calculate the register offset of the               
ports.                                                                            
Starting in display version 12, TypeC ports were introduced in the                
platforms. These were defined as new enums PORT_TC1,PORT_TC2... The               
later generation platforms had DDI register offests of TypeC and                  
non-TypeC ports interleaved and the existing port enums didn't match the          
order of the DDI register offests. So the enums could no more be used as          
index to calculate the register offest.                                           
This led to the creation of new platform specific enums for the ports             
like PORT_D_XELPD, PORT_E_XELPD to match the index of the ports in those          
platforms and additional code to handle the special enums.                        
                                                                                  
So we want to make the port enums not tied to DDI register offset and             
use the index from somewhere else to calculate the register offsets.              
The index of the DDI ports in the platform is now defined as part of              
device info.

Series includes few patches at the end which does some cleanup and
fixing made possible because of unique enums for the ports.

v2: ddi_index defined for platforms starting from Gen75. Many platforms
from Gen75 has ddi support.
v3: Updated DDI_CLK_SEL macro to use new index for DDI register offset
caculation.
v4: After removing d13_port_domains array, d12_port_domains is used for
all platforms with DISPLAY_VER 12 and above. So the port_end member had
to fixed to extend it for ports D and E.

Cc: Jani Nikula <jani.nikula at linux.intel.com>
Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>

Balasubramani Vivekanandan (7):
  drm/i915/display: Pass struct drm_i915_private to DDI_BUF_CTL macro
  drm/i915/display: Pass struct drm_i915_private to DDI_CLK_SEL macro
  drm/i915/display: Define the DDI port indices inside device info
  drm/i915/display: Free port enums from tied to register offset
  drm/i915/display: Remove PORT_D_XELPD/PORT_E_XELPD platform specific
    defintions
  drm/i915/display: Fix port_identifier function
  drm/i915/display: cleanup unused DDI port enums

 drivers/gpu/drm/i915/display/icl_dsi.c        | 12 +--
 drivers/gpu/drm/i915/display/intel_bios.c     |  7 +-
 drivers/gpu/drm/i915/display/intel_ddi.c      | 80 ++++++++-----------
 drivers/gpu/drm/i915/display/intel_display.c  | 12 +--
 drivers/gpu/drm/i915/display/intel_display.h  | 29 ++++---
 .../drm/i915/display/intel_display_power.c    | 44 +---------
 drivers/gpu/drm/i915/display/intel_fdi.c      | 14 ++--
 drivers/gpu/drm/i915/display/intel_tc.c       |  6 +-
 drivers/gpu/drm/i915/gvt/display.c            | 30 +++----
 drivers/gpu/drm/i915/gvt/handlers.c           | 17 ++--
 drivers/gpu/drm/i915/i915_pci.c               | 46 ++++++++++-
 drivers/gpu/drm/i915/i915_reg.h               |  7 +-
 drivers/gpu/drm/i915/intel_device_info.h      |  1 +
 drivers/gpu/drm/i915/intel_gvt_mmio_table.c   | 10 +--
 include/drm/i915_component.h                  |  2 +-
 15 files changed, 153 insertions(+), 164 deletions(-)

-- 
2.34.1



More information about the Intel-gfx mailing list