Commit 6c0fd451 authored by Damien Lespiau's avatar Damien Lespiau Committed by Daniel Vetter

drm/i915: Tighten the exposure ARGB/ABGR 8888 formats

ARGB8888 is used for cursors on all platforms so we need to allow it
everywhere.

ABGR8888 is currently only honoured:
  - on VLV/CHV in sprite planes
  - on SKL+ for primary and sprite planes
so only allow it for those platforms.

Note that we only support ARGB8888/ABGR8888 on the primary plane for
SKL/BXT because we have in line of sight the pipe bottom color on those
platforms and because the primary plane programming on VLV/CHV doesn't
anything different for those formats today.

v2: Fix the logic to forbid the creation ABGR2101010 fbs (Ville)
v3: Still allow the creation of ARGB8888 fbs now that cursor planes use
    real fb objects (found by PRTS).
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarDamien Lespiau <damien.lespiau@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent c965d995
...@@ -51,11 +51,19 @@ static const uint32_t i8xx_primary_formats[] = { ...@@ -51,11 +51,19 @@ static const uint32_t i8xx_primary_formats[] = {
DRM_FORMAT_RGB565, DRM_FORMAT_RGB565,
DRM_FORMAT_XRGB1555, DRM_FORMAT_XRGB1555,
DRM_FORMAT_XRGB8888, DRM_FORMAT_XRGB8888,
DRM_FORMAT_ARGB8888,
}; };
/* Primary plane formats for gen >= 4 */ /* Primary plane formats for gen >= 4 */
static const uint32_t i965_primary_formats[] = { static const uint32_t i965_primary_formats[] = {
DRM_FORMAT_C8,
DRM_FORMAT_RGB565,
DRM_FORMAT_XRGB8888,
DRM_FORMAT_XBGR8888,
DRM_FORMAT_XRGB2101010,
DRM_FORMAT_XBGR2101010,
};
static const uint32_t skl_primary_formats[] = {
DRM_FORMAT_C8, DRM_FORMAT_C8,
DRM_FORMAT_RGB565, DRM_FORMAT_RGB565,
DRM_FORMAT_XRGB8888, DRM_FORMAT_XRGB8888,
...@@ -2704,11 +2712,9 @@ static void i9xx_update_primary_plane(struct drm_crtc *crtc, ...@@ -2704,11 +2712,9 @@ static void i9xx_update_primary_plane(struct drm_crtc *crtc,
dspcntr |= DISPPLANE_BGRX565; dspcntr |= DISPPLANE_BGRX565;
break; break;
case DRM_FORMAT_XRGB8888: case DRM_FORMAT_XRGB8888:
case DRM_FORMAT_ARGB8888:
dspcntr |= DISPPLANE_BGRX888; dspcntr |= DISPPLANE_BGRX888;
break; break;
case DRM_FORMAT_XBGR8888: case DRM_FORMAT_XBGR8888:
case DRM_FORMAT_ABGR8888:
dspcntr |= DISPPLANE_RGBX888; dspcntr |= DISPPLANE_RGBX888;
break; break;
case DRM_FORMAT_XRGB2101010: case DRM_FORMAT_XRGB2101010:
...@@ -2810,11 +2816,9 @@ static void ironlake_update_primary_plane(struct drm_crtc *crtc, ...@@ -2810,11 +2816,9 @@ static void ironlake_update_primary_plane(struct drm_crtc *crtc,
dspcntr |= DISPPLANE_BGRX565; dspcntr |= DISPPLANE_BGRX565;
break; break;
case DRM_FORMAT_XRGB8888: case DRM_FORMAT_XRGB8888:
case DRM_FORMAT_ARGB8888:
dspcntr |= DISPPLANE_BGRX888; dspcntr |= DISPPLANE_BGRX888;
break; break;
case DRM_FORMAT_XBGR8888: case DRM_FORMAT_XBGR8888:
case DRM_FORMAT_ABGR8888:
dspcntr |= DISPPLANE_RGBX888; dspcntr |= DISPPLANE_RGBX888;
break; break;
case DRM_FORMAT_XRGB2101010: case DRM_FORMAT_XRGB2101010:
...@@ -13293,12 +13297,15 @@ static struct drm_plane *intel_primary_plane_create(struct drm_device *dev, ...@@ -13293,12 +13297,15 @@ static struct drm_plane *intel_primary_plane_create(struct drm_device *dev,
if (HAS_FBC(dev) && INTEL_INFO(dev)->gen < 4) if (HAS_FBC(dev) && INTEL_INFO(dev)->gen < 4)
primary->plane = !pipe; primary->plane = !pipe;
if (INTEL_INFO(dev)->gen <= 3) { if (INTEL_INFO(dev)->gen >= 9) {
intel_primary_formats = i8xx_primary_formats; intel_primary_formats = skl_primary_formats;
num_formats = ARRAY_SIZE(i8xx_primary_formats); num_formats = ARRAY_SIZE(skl_primary_formats);
} else { } else if (INTEL_INFO(dev)->gen >= 4) {
intel_primary_formats = i965_primary_formats; intel_primary_formats = i965_primary_formats;
num_formats = ARRAY_SIZE(i965_primary_formats); num_formats = ARRAY_SIZE(i965_primary_formats);
} else {
intel_primary_formats = i8xx_primary_formats;
num_formats = ARRAY_SIZE(i8xx_primary_formats);
} }
drm_universal_plane_init(dev, &primary->base, 0, drm_universal_plane_init(dev, &primary->base, 0,
...@@ -13985,8 +13992,14 @@ static int intel_framebuffer_init(struct drm_device *dev, ...@@ -13985,8 +13992,14 @@ static int intel_framebuffer_init(struct drm_device *dev,
return -EINVAL; return -EINVAL;
} }
break; break;
case DRM_FORMAT_XBGR8888:
case DRM_FORMAT_ABGR8888: case DRM_FORMAT_ABGR8888:
if (!IS_VALLEYVIEW(dev) && INTEL_INFO(dev)->gen < 9) {
DRM_DEBUG("unsupported pixel format: %s\n",
drm_get_format_name(mode_cmd->pixel_format));
return -EINVAL;
}
break;
case DRM_FORMAT_XBGR8888:
case DRM_FORMAT_XRGB2101010: case DRM_FORMAT_XRGB2101010:
case DRM_FORMAT_XBGR2101010: case DRM_FORMAT_XBGR2101010:
if (INTEL_INFO(dev)->gen < 4) { if (INTEL_INFO(dev)->gen < 4) {
......
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