Commit 2a0d7cfd9482ca4c10a4d8794791760a6a7ce40c

Authored by Daniel Vetter
1 parent cb597bb3a2

drm: Add a plane->reset hook

In general having this can't hurt, and the atomic helpers will need
it to be able to reset the state objects properly. The overall idea
is to reset in the order pixels flow, so planes -> crtcs ->
encoders -> connectors.

v2: Squash in fixup from Ville to correctly deference struct drm_plane
instead of drm_crtc when walking the plane list. Fixes an oops in
driver init and resume.

Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Showing 2 changed files with 6 additions and 0 deletions Side-by-side Diff

drivers/gpu/drm/drm_crtc.c
... ... @@ -4663,8 +4663,13 @@
4663 4663 void drm_mode_config_reset(struct drm_device *dev)
4664 4664 {
4665 4665 struct drm_crtc *crtc;
  4666 + struct drm_plane *plane;
4666 4667 struct drm_encoder *encoder;
4667 4668 struct drm_connector *connector;
  4669 +
  4670 + list_for_each_entry(plane, &dev->mode_config.plane_list, head)
  4671 + if (plane->funcs->reset)
  4672 + plane->funcs->reset(plane);
4668 4673  
4669 4674 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head)
4670 4675 if (crtc->funcs->reset)
include/drm/drm_crtc.h
... ... @@ -581,6 +581,7 @@
581 581 uint32_t src_w, uint32_t src_h);
582 582 int (*disable_plane)(struct drm_plane *plane);
583 583 void (*destroy)(struct drm_plane *plane);
  584 + void (*reset)(struct drm_plane *plane);
584 585  
585 586 int (*set_property)(struct drm_plane *plane,
586 587 struct drm_property *property, uint64_t val);