]> git.baikalelectronics.ru Git - kernel.git/commit
drm: Store the plane's index
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 27 May 2016 19:05:00 +0000 (20:05 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 2 Jun 2016 22:02:23 +0000 (00:02 +0200)
commit705fbc0d79c78744c16a237b604e5fcdd939eb4e
tree77e6dfde9d3cf61330c91af848de7327e41fce63
parent549a7e00e7c3e7515eb9c2f60a5a510ae59e718c
drm: Store the plane's index

Currently the plane's index is determined by walking the list of all
planes in the mode and finding the position of that plane in the list. A
linear walk, especially a linear walk within a linear walk as frequently
conceived by i915.ko [O(N^2)] quickly comes to dominate profiles.

The plane's index is constant for as long as no earlier planes are
removed from the list. For all drivers, planes are static, determined
at boot and then untouched until shutdown. In fact, there is no locking
provided to allow for dynamic removal of planes/encoders/crtcs.

v2: Convert drm_crtc_index() and drm_encoder_index() as well.
v3: Stop adjusting the indices upon removal; consider the list
construct-only.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Matt Roper <matthew.d.roper@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
[danvet: Fixup typo in kerneldoc that Matt spotted.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1464375900-2542-1-git-send-email-chris@chris-wilson.co.uk
drivers/gpu/drm/drm_crtc.c
include/drm/drm_crtc.h