Re: [PATCH 5/6] drm/i915/kbl: Use propper ddi buffer translation table for Kabylake ULT and ULX.

Paulo Zanoni
2015-11-06T20:26:28Z

2015-10-27 15:14 GMT-02:00 Rodrigo Vivi <rodrigo.vivi@intel.com>:
> Let's introduce ULT and ULX Kabylake definitions and start
> using it for a propper DDI buffer translation.
>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> drivers/gpu/drm/i915/i915_drv.h | 8 ++++++++
> drivers/gpu/drm/i915/intel_ddi.c | 10 +++++-----
> 2 files changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 3982d1a..e0b84c8 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -2506,6 +2506,14 @@ struct drm_i915_cmd_table {
> #define IS_SKL_ULX(dev) (INTEL_DEVID(dev) == 0x190E || \
> INTEL_DEVID(dev) == 0x1915 || \
> INTEL_DEVID(dev) == 0x191E)
> +#define IS_KBL_ULT(dev) (INTEL_DEVID(dev) == 0x5906 || \
> + INTEL_DEVID(dev) == 0x5913 || \
> + INTEL_DEVID(dev) == 0x5916 || \
> + INTEL_DEVID(dev) == 0x5921 || \
> + INTEL_DEVID(dev) == 0x5926)
> +#define IS_KBL_ULX(dev) (INTEL_DEVID(dev) == 0x590E || \
> + INTEL_DEVID(dev) == 0x5915 || \
> + INTEL_DEVID(dev) == 0x591E)

(insert bikeshed about checking just the last 4 bits, like we do for
IS_BDW_ULT())

> #define IS_SKL_GT3(dev) (IS_SKYLAKE(dev) && \
> (INTEL_DEVID(dev) & 0x00F0) == 0x0020)
> #define IS_SKL_GT4(dev) (IS_SKYLAKE(dev) && \
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> index 8dd9fae..424bccc 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -353,10 +353,10 @@ static const struct ddi_buf_trans *skl_get_buf_trans_dp(struct drm_device *dev,
> {
> const struct ddi_buf_trans *ddi_translations;
>
> - if (IS_SKL_ULX(dev)) {
> + if (IS_SKL_ULX(dev) || IS_KBL_ULX(dev)) {
> ddi_translations = skl_y_ddi_translations_dp;
> *n_entries = ARRAY_SIZE(skl_y_ddi_translations_dp);
> - } else if (IS_SKL_ULT(dev)) {
> + } else if (IS_SKL_ULT(dev) || IS_KBL_ULT(dev)) {
> ddi_translations = skl_u_ddi_translations_dp;
> *n_entries = ARRAY_SIZE(skl_u_ddi_translations_dp);
> } else {
> @@ -373,7 +373,7 @@ static const struct ddi_buf_trans *skl_get_buf_trans_edp(struct drm_device *dev,
> struct drm_i915_private *dev_priv = dev->dev_private;
> const struct ddi_buf_trans *ddi_translations;
>
> - if (IS_SKL_ULX(dev)) {
> + if (IS_SKL_ULX(dev) || IS_KBL_ULX(dev)) {

There is an extra white space before the "||" chars :)

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>

> if (dev_priv->edp_low_vswing) {
> ddi_translations = skl_y_ddi_translations_edp;
> *n_entries = ARRAY_SIZE(skl_y_ddi_translations_edp);
> @@ -381,7 +381,7 @@ static const struct ddi_buf_trans *skl_get_buf_trans_edp(struct drm_device *dev,
> ddi_translations = skl_y_ddi_translations_dp;
> *n_entries = ARRAY_SIZE(skl_y_ddi_translations_dp);
> }
> - } else if (IS_SKL_ULT(dev)) {
> + } else if (IS_SKL_ULT(dev) || IS_KBL_ULT(dev)) {
> if (dev_priv->edp_low_vswing) {
> ddi_translations = skl_u_ddi_translations_edp;
> *n_entries = ARRAY_SIZE(skl_u_ddi_translations_edp);
> @@ -408,7 +408,7 @@ skl_get_buf_trans_hdmi(struct drm_device *dev,
> {
> const struct ddi_buf_trans *ddi_translations;
>
> - if (IS_SKL_ULX(dev)) {
> + if (IS_SKL_ULX(dev) || IS_KBL_ULX(dev)) {
> ddi_translations = skl_y_ddi_translations_hdmi;
> *n_entries = ARRAY_SIZE(skl_y_ddi_translations_hdmi);
> } else {
> --
> 2.4.3
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

--
Paulo Zanoni