提交 0d5f6625 编写于 作者: M Mika Kahola 提交者: Ville Syrjälä

drm/i915: Don't relay on I915_MAX_PIPES

Let's remove the dependency on I915_MAX_PIPES. Instead, get the number
of pipes from platform information.
Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: NRamalingam C <ramalingam.c@intel.com>
Signed-off-by: NMika Kahola <mika.kahola@intel.com>
Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1507630626-23806-2-git-send-email-mika.kahola@intel.com
上级 db37d8f3
...@@ -754,7 +754,7 @@ static struct intel_encoder *get_saved_enc(struct drm_i915_private *dev_priv, ...@@ -754,7 +754,7 @@ static struct intel_encoder *get_saved_enc(struct drm_i915_private *dev_priv,
{ {
struct intel_encoder *encoder; struct intel_encoder *encoder;
if (WARN_ON(pipe >= I915_MAX_PIPES)) if (WARN_ON(pipe >= INTEL_INFO(dev_priv)->num_pipes))
return NULL; return NULL;
/* MST */ /* MST */
......
...@@ -775,11 +775,12 @@ display_crc_ctl_parse_object(const char *buf, enum intel_pipe_crc_object *o) ...@@ -775,11 +775,12 @@ display_crc_ctl_parse_object(const char *buf, enum intel_pipe_crc_object *o)
return -EINVAL; return -EINVAL;
} }
static int display_crc_ctl_parse_pipe(const char *buf, enum pipe *pipe) static int display_crc_ctl_parse_pipe(struct drm_i915_private *dev_priv,
const char *buf, enum pipe *pipe)
{ {
const char name = buf[0]; const char name = buf[0];
if (name < 'A' || name >= pipe_name(I915_MAX_PIPES)) if (name < 'A' || name >= pipe_name(INTEL_INFO(dev_priv)->num_pipes))
return -EINVAL; return -EINVAL;
*pipe = name - 'A'; *pipe = name - 'A';
...@@ -828,7 +829,7 @@ static int display_crc_ctl_parse(struct drm_i915_private *dev_priv, ...@@ -828,7 +829,7 @@ static int display_crc_ctl_parse(struct drm_i915_private *dev_priv,
return -EINVAL; return -EINVAL;
} }
if (display_crc_ctl_parse_pipe(words[1], &pipe) < 0) { if (display_crc_ctl_parse_pipe(dev_priv, words[1], &pipe) < 0) {
DRM_DEBUG_DRIVER("unknown pipe %s\n", words[1]); DRM_DEBUG_DRIVER("unknown pipe %s\n", words[1]);
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册