OSDN Git Service

drm/i915/psr: Get pipe id following atomic guidelines
authorJosé Roberto de Souza <jose.souza@intel.com>
Wed, 28 Nov 2018 07:28:38 +0000 (23:28 -0800)
committerJosé Roberto de Souza <jose.souza@intel.com>
Fri, 30 Nov 2018 17:58:02 +0000 (09:58 -0800)
commitf0ad62a631e040ae4413286a4b46a90c5ce42d07
tree04de8bc4e597fb8a5f5928bfbb1cfbd4e5e7630e
parentb9f78d675230a9f65611600496235cdbd369d55d
drm/i915/psr: Get pipe id following atomic guidelines

As stated in struct drm_encoder, crtc field should only be used
by non-atomic drivers.

So here caching the pipe id in intel_psr_enable() what is way more
simple and efficient than at every call to
intel_psr_flush()/invalidate() get the
drm.mode_config.connection_mutex lock to safely be able to get the
pipe id by reading drm_connector_state.crtc.

This should fix the null pointer dereference crash below as the
previous way to get the pipe id was prone to race conditions.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105959
Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181128072838.22773-1-jose.souza@intel.com
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/intel_psr.c