drm/i915: Select starting pipe bpp irrespective or the primary plane
Since universal planes the primary plane might not be around, and it's kinda silly to restrict the pipe bpp to the primary plane if we might end up displaying a 10bpc video overlay. And with atomic we might very well enable a pipe without a primary plane. So just use the platform max as a starting point and then restrict appropriately. Of course this is all still a bit moot as long as we artificially compress everything to max 8bpc because we don't use the hi-bpc gamma tables. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
5678ad7367
commit
d328c9d78d
|
@ -6302,14 +6302,6 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc,
|
||||||
adjusted_mode->hsync_start == adjusted_mode->hdisplay)
|
adjusted_mode->hsync_start == adjusted_mode->hdisplay)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
if ((IS_G4X(dev) || IS_VALLEYVIEW(dev)) && pipe_config->pipe_bpp > 10*3) {
|
|
||||||
pipe_config->pipe_bpp = 10*3; /* 12bpc is gen5+ */
|
|
||||||
} else if (INTEL_INFO(dev)->gen <= 4 && pipe_config->pipe_bpp > 8*3) {
|
|
||||||
/* only a 8bpc pipe, with 6bpc dither through the panel fitter
|
|
||||||
* for lvds. */
|
|
||||||
pipe_config->pipe_bpp = 8*3;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (HAS_IPS(dev))
|
if (HAS_IPS(dev))
|
||||||
hsw_compute_ips_config(crtc, pipe_config);
|
hsw_compute_ips_config(crtc, pipe_config);
|
||||||
|
|
||||||
|
@ -10981,7 +10973,6 @@ connected_sink_compute_bpp(struct intel_connector *connector,
|
||||||
|
|
||||||
static int
|
static int
|
||||||
compute_baseline_pipe_bpp(struct intel_crtc *crtc,
|
compute_baseline_pipe_bpp(struct intel_crtc *crtc,
|
||||||
struct drm_framebuffer *fb,
|
|
||||||
struct intel_crtc_state *pipe_config)
|
struct intel_crtc_state *pipe_config)
|
||||||
{
|
{
|
||||||
struct drm_device *dev = crtc->base.dev;
|
struct drm_device *dev = crtc->base.dev;
|
||||||
|
@ -10989,41 +10980,13 @@ compute_baseline_pipe_bpp(struct intel_crtc *crtc,
|
||||||
struct intel_connector *connector;
|
struct intel_connector *connector;
|
||||||
int bpp, i;
|
int bpp, i;
|
||||||
|
|
||||||
switch (fb->pixel_format) {
|
if ((IS_G4X(dev) || IS_VALLEYVIEW(dev)))
|
||||||
case DRM_FORMAT_C8:
|
|
||||||
bpp = 8*3; /* since we go through a colormap */
|
|
||||||
break;
|
|
||||||
case DRM_FORMAT_XRGB1555:
|
|
||||||
case DRM_FORMAT_ARGB1555:
|
|
||||||
/* checked in intel_framebuffer_init already */
|
|
||||||
if (WARN_ON(INTEL_INFO(dev)->gen > 3))
|
|
||||||
return -EINVAL;
|
|
||||||
case DRM_FORMAT_RGB565:
|
|
||||||
bpp = 6*3; /* min is 18bpp */
|
|
||||||
break;
|
|
||||||
case DRM_FORMAT_XBGR8888:
|
|
||||||
case DRM_FORMAT_ABGR8888:
|
|
||||||
/* checked in intel_framebuffer_init already */
|
|
||||||
if (WARN_ON(INTEL_INFO(dev)->gen < 4))
|
|
||||||
return -EINVAL;
|
|
||||||
case DRM_FORMAT_XRGB8888:
|
|
||||||
case DRM_FORMAT_ARGB8888:
|
|
||||||
bpp = 8*3;
|
|
||||||
break;
|
|
||||||
case DRM_FORMAT_XRGB2101010:
|
|
||||||
case DRM_FORMAT_ARGB2101010:
|
|
||||||
case DRM_FORMAT_XBGR2101010:
|
|
||||||
case DRM_FORMAT_ABGR2101010:
|
|
||||||
/* checked in intel_framebuffer_init already */
|
|
||||||
if (WARN_ON(INTEL_INFO(dev)->gen < 4))
|
|
||||||
return -EINVAL;
|
|
||||||
bpp = 10*3;
|
bpp = 10*3;
|
||||||
break;
|
else if (INTEL_INFO(dev)->gen >= 5)
|
||||||
/* TODO: gen4+ supports 16 bpc floating point, too. */
|
bpp = 12*3;
|
||||||
default:
|
else
|
||||||
DRM_DEBUG_KMS("unsupported depth\n");
|
bpp = 8*3;
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
pipe_config->pipe_bpp = bpp;
|
pipe_config->pipe_bpp = bpp;
|
||||||
|
|
||||||
|
@ -11280,7 +11243,7 @@ intel_modeset_pipe_config(struct drm_crtc *crtc,
|
||||||
struct intel_connector *connector;
|
struct intel_connector *connector;
|
||||||
struct drm_connector_state *connector_state;
|
struct drm_connector_state *connector_state;
|
||||||
struct intel_crtc_state *pipe_config;
|
struct intel_crtc_state *pipe_config;
|
||||||
int plane_bpp, ret = -EINVAL;
|
int base_bpp, ret = -EINVAL;
|
||||||
int i;
|
int i;
|
||||||
bool retry = true;
|
bool retry = true;
|
||||||
|
|
||||||
|
@ -11325,9 +11288,9 @@ intel_modeset_pipe_config(struct drm_crtc *crtc,
|
||||||
* plane pixel format and any sink constraints into account. Returns the
|
* plane pixel format and any sink constraints into account. Returns the
|
||||||
* source plane bpp so that dithering can be selected on mismatches
|
* source plane bpp so that dithering can be selected on mismatches
|
||||||
* after encoders and crtc also have had their say. */
|
* after encoders and crtc also have had their say. */
|
||||||
plane_bpp = compute_baseline_pipe_bpp(to_intel_crtc(crtc),
|
base_bpp = compute_baseline_pipe_bpp(to_intel_crtc(crtc),
|
||||||
fb, pipe_config);
|
pipe_config);
|
||||||
if (plane_bpp < 0)
|
if (base_bpp < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -11395,9 +11358,9 @@ encoder_retry:
|
||||||
goto encoder_retry;
|
goto encoder_retry;
|
||||||
}
|
}
|
||||||
|
|
||||||
pipe_config->dither = pipe_config->pipe_bpp != plane_bpp;
|
pipe_config->dither = pipe_config->pipe_bpp != base_bpp;
|
||||||
DRM_DEBUG_KMS("plane bpp: %i, pipe bpp: %i, dithering: %i\n",
|
DRM_DEBUG_KMS("plane bpp: %i, pipe bpp: %i, dithering: %i\n",
|
||||||
plane_bpp, pipe_config->pipe_bpp, pipe_config->dither);
|
base_bpp, pipe_config->pipe_bpp, pipe_config->dither);
|
||||||
|
|
||||||
return pipe_config;
|
return pipe_config;
|
||||||
fail:
|
fail:
|
||||||
|
|
Loading…
Reference in New Issue