drm/i915/skl+: Fail the flip if ddb min requirement exceeds pipe allocation
authorKumar, Mahesh <mahesh1.kumar@intel.com>
Wed, 17 May 2017 11:58:26 +0000 (17:28 +0530)
committerMatt Roper <matthew.d.roper@intel.com>
Wed, 17 May 2017 21:32:57 +0000 (14:32 -0700)
commit5ba6faafbe18451352747ae730392ddb316e4ed5
tree1df6c492ba1eff60ab4009fd60f2f821b1ab57a9
parent336031ea1cdb056eb2f7bd21fce46dda52fc0412
drm/i915/skl+: Fail the flip if ddb min requirement exceeds pipe allocation

DDB minimum requirement of crtc configuration (cumulative of all the
enabled planes in crtc) may exceed the allocated DDB for crtc/pipe.
This patch make changes to fail the flip/ioctl if minimum requirement
for pipe exceeds the total ddb allocated to the pipe.
Previously it succeeded but making alloc_size a negative value. Which
will make subsequent calculations for plane ddb allocation bogus & may
lead to screen corruption or system hang.

Changes from V1:
 - Improve commit message as per Ander's comment
 - Remove extra parentheses (Ander)

Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170517115831.13830-8-mahesh1.kumar@intel.com
drivers/gpu/drm/i915/intel_pm.c