Commit ac213c1b authored by Paulo Zanoni's avatar Paulo Zanoni

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: default avatarMahesh Kumar <mahesh1.kumar@intel.com>
Signed-off-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180522002558.29262-4-paulo.r.zanoni@intel.com
parent 9bb635d9
...@@ -5869,6 +5869,22 @@ static void i9xx_pfit_enable(struct intel_crtc *crtc) ...@@ -5869,6 +5869,22 @@ static void i9xx_pfit_enable(struct intel_crtc *crtc)
I915_WRITE(BCLRPAT(crtc->pipe), 0); I915_WRITE(BCLRPAT(crtc->pipe), 0);
} }
bool intel_port_is_tc(struct drm_i915_private *dev_priv, enum port port)
{
if (IS_ICELAKE(dev_priv))
return port >= PORT_C && port <= PORT_F;
return false;
}
enum tc_port intel_port_to_tc(struct drm_i915_private *dev_priv, enum port port)
{
if (!intel_port_is_tc(dev_priv, port))
return PORT_TC_NONE;
return port - PORT_C;
}
enum intel_display_power_domain intel_port_to_power_domain(enum port port) enum intel_display_power_domain intel_port_to_power_domain(enum port port)
{ {
switch (port) { switch (port) {
......
...@@ -126,6 +126,17 @@ enum port { ...@@ -126,6 +126,17 @@ enum port {
#define port_name(p) ((p) + 'A') #define port_name(p) ((p) + 'A')
enum tc_port {
PORT_TC_NONE = -1,
PORT_TC1 = 0,
PORT_TC2,
PORT_TC3,
PORT_TC4,
I915_MAX_TC_PORTS
};
enum dpio_channel { enum dpio_channel {
DPIO_CH0, DPIO_CH0,
DPIO_CH1 DPIO_CH1
......
...@@ -1489,6 +1489,9 @@ void intel_connector_attach_encoder(struct intel_connector *connector, ...@@ -1489,6 +1489,9 @@ void intel_connector_attach_encoder(struct intel_connector *connector,
struct intel_encoder *encoder); struct intel_encoder *encoder);
struct drm_display_mode * struct drm_display_mode *
intel_encoder_current_mode(struct intel_encoder *encoder); intel_encoder_current_mode(struct intel_encoder *encoder);
bool intel_port_is_tc(struct drm_i915_private *dev_priv, enum port port);
enum tc_port intel_port_to_tc(struct drm_i915_private *dev_priv,
enum port port);
enum pipe intel_get_pipe_from_connector(struct intel_connector *connector); enum pipe intel_get_pipe_from_connector(struct intel_connector *connector);
int intel_get_pipe_from_crtc_id_ioctl(struct drm_device *dev, void *data, int intel_get_pipe_from_crtc_id_ioctl(struct drm_device *dev, void *data,
......
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