drm/i915: Do not WARN_ON with small framebuffers.
It's perfectly legal to create a fb with stride < 512, and one of the kms_plane_scaling subtests creates a very small fb. Downgrade the WARN_ON to a simple check check, and because this function is potentially called on every atomic update/pageflip, downgrade the other WARN_ON to a WARN_ON_ONCE, and do the right thing here. Cc: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180116155331.75175-1-maarten.lankhorst@linux.intel.com Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
This commit is contained in:
Родитель
ac25dfed15
Коммит
3f5b933e60
|
@ -668,11 +668,13 @@ void intel_fbc_cleanup_cfb(struct drm_i915_private *dev_priv)
|
||||||
static bool stride_is_valid(struct drm_i915_private *dev_priv,
|
static bool stride_is_valid(struct drm_i915_private *dev_priv,
|
||||||
unsigned int stride)
|
unsigned int stride)
|
||||||
{
|
{
|
||||||
/* These should have been caught earlier. */
|
/* This should have been caught earlier. */
|
||||||
WARN_ON(stride < 512);
|
if (WARN_ON_ONCE((stride & (64 - 1)) != 0))
|
||||||
WARN_ON((stride & (64 - 1)) != 0);
|
return false;
|
||||||
|
|
||||||
/* Below are the additional FBC restrictions. */
|
/* Below are the additional FBC restrictions. */
|
||||||
|
if (stride < 512)
|
||||||
|
return false;
|
||||||
|
|
||||||
if (IS_GEN2(dev_priv) || IS_GEN3(dev_priv))
|
if (IS_GEN2(dev_priv) || IS_GEN3(dev_priv))
|
||||||
return stride == 4096 || stride == 8192;
|
return stride == 4096 || stride == 8192;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче