Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit d9b61ce2 authored by Anjaneya Prasad Musunuri's avatar Anjaneya Prasad Musunuri Committed by LuK1337
Browse files

minui: Set client cap properties for planes before accessing them

Set the client cap properties for planes before
getting plane_resources.

Change-Id: I08371b44bc34c95d7a97a4808cc8abcb6e063f0e
CRs-Fixed: 2354871
parent 3697dcfc
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -691,14 +691,14 @@ GRSurface* MinuiBackendDrmQti::Init() {

  drmModeFreeResources(res);

  drmSetClientCap(drm_fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);
  drmSetClientCap(drm_fd, DRM_CLIENT_CAP_ATOMIC, 1);

  /* Get possible plane_ids */
  drmModePlaneRes* plane_options = drmModeGetPlaneResources(drm_fd);
  if (!plane_options || !plane_options->planes || (plane_options->count_planes < number_of_lms))
    return NULL;

  drmSetClientCap(drm_fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);
  drmSetClientCap(drm_fd, DRM_CLIENT_CAP_ATOMIC, 1);

  /* Set crtc resources */
  crtc_res.props =
      drmModeObjectGetProperties(drm_fd, drm[DRM_MAIN].monitor_crtc->crtc_id, DRM_MODE_OBJECT_CRTC);