drm/i915/gen9: Allow skl_allocate_pipe_ddb() to operate on in-flight state (v3)
authorMatt Roper <matthew.d.roper@intel.com>
Thu, 12 May 2016 14:06:01 +0000 (07:06 -0700)
committerMatt Roper <matthew.d.roper@intel.com>
Fri, 13 May 2016 14:33:16 +0000 (07:33 -0700)
commitc107acfeb03187873657ccc8af4fc5c704b3626b
treeb86ac355554752567d27e05fa9bb7abdb2a5d899
parent8b4a7d0597cd9910d7127ffae6ae91d21853a8a2
drm/i915/gen9: Allow skl_allocate_pipe_ddb() to operate on in-flight state (v3)

We eventually want to calculate watermark values at atomic 'check' time
instead of atomic 'commit' time so that any requested configurations
that result in impossible watermark requirements are properly rejected.
The first step along this path is to allocate the DDB at atomic 'check'
time.  As we perform this transition, allow the main allocation function
to operate successfully on either an in-flight state or an
already-commited state.  Once we complete the transition in a future
patch, we'll come back and remove the unnecessary logic for the
already-committed case.

v2: Rebase/refactor; we should no longer need to grab extra plane states
    while allocating the DDB since we can pull cached data rates and
    minimum block counts from the CRTC state for any planes that aren't
    being modified by this transaction.

v3:
 - Simplify memsets to clear DDB plane entries.  (Maarten)
 - Drop a redundant memset of plane[pipe][PLANE_CURSOR] that was added
   by an earlier Coccinelle patch.  (Maarten)
 - Assign *num_active at the top of skl_ddb_get_pipe_allocation_limits()
   so that no code paths return without setting it.  (kbuild robot)

Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1463061971-19638-8-git-send-email-matthew.d.roper@intel.com
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/intel_pm.c