Skip to content

Commit ac213c1

Browse files
committed
drm/i915/icl: introduce tc_port
Add and enum for TC ports and auxiliary functions to handle them. Icelake brings a lot of registers and other things that only apply to the TC ports and are indexed starting from 0, so having an enum for tc_ports that starts at 0 really helps the indexing. This patch is based on previous patches written by Dhinakaran Pandiyan and Mahesh Kumar. Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Cc: Mahesh Kumar <mahesh1.kumar@intel.com> Reviewed-by: Mahesh Kumar <mahesh1.kumar@intel.com> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180522002558.29262-4-paulo.r.zanoni@intel.com
1 parent 9bb635d commit ac213c1

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

drivers/gpu/drm/i915/intel_display.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5869,6 +5869,22 @@ static void i9xx_pfit_enable(struct intel_crtc *crtc)
58695869
I915_WRITE(BCLRPAT(crtc->pipe), 0);
58705870
}
58715871

5872+
bool intel_port_is_tc(struct drm_i915_private *dev_priv, enum port port)
5873+
{
5874+
if (IS_ICELAKE(dev_priv))
5875+
return port >= PORT_C && port <= PORT_F;
5876+
5877+
return false;
5878+
}
5879+
5880+
enum tc_port intel_port_to_tc(struct drm_i915_private *dev_priv, enum port port)
5881+
{
5882+
if (!intel_port_is_tc(dev_priv, port))
5883+
return PORT_TC_NONE;
5884+
5885+
return port - PORT_C;
5886+
}
5887+
58725888
enum intel_display_power_domain intel_port_to_power_domain(enum port port)
58735889
{
58745890
switch (port) {

drivers/gpu/drm/i915/intel_display.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,17 @@ enum port {
126126

127127
#define port_name(p) ((p) + 'A')
128128

129+
enum tc_port {
130+
PORT_TC_NONE = -1,
131+
132+
PORT_TC1 = 0,
133+
PORT_TC2,
134+
PORT_TC3,
135+
PORT_TC4,
136+
137+
I915_MAX_TC_PORTS
138+
};
139+
129140
enum dpio_channel {
130141
DPIO_CH0,
131142
DPIO_CH1

drivers/gpu/drm/i915/intel_drv.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1489,6 +1489,9 @@ void intel_connector_attach_encoder(struct intel_connector *connector,
14891489
struct intel_encoder *encoder);
14901490
struct drm_display_mode *
14911491
intel_encoder_current_mode(struct intel_encoder *encoder);
1492+
bool intel_port_is_tc(struct drm_i915_private *dev_priv, enum port port);
1493+
enum tc_port intel_port_to_tc(struct drm_i915_private *dev_priv,
1494+
enum port port);
14921495

14931496
enum pipe intel_get_pipe_from_connector(struct intel_connector *connector);
14941497
int intel_get_pipe_from_crtc_id_ioctl(struct drm_device *dev, void *data,

0 commit comments

Comments
 (0)