0001-Limited-plane-overlay-assignment-for-light-board.patch 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. From 996c95795e537ac56f99aa7f29b38ffd10a3e902 Mon Sep 17 00:00:00 2001
  2. From: Yugang <fanyugang.fyg@linux.alibaba.com>
  3. Date: Fri, 13 May 2022 21:03:59 +0800
  4. Subject: [PATCH 1/2] Limited plane overlay assignment for light board.
  5. ---
  6. libweston/backend-drm/drm.c | 18 ++++++++++++++++--
  7. 1 file changed, 16 insertions(+), 2 deletions(-)
  8. diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c
  9. index f8e3b702..a67b56dd 100644
  10. --- a/libweston/backend-drm/drm.c
  11. +++ b/libweston/backend-drm/drm.c
  12. @@ -972,7 +972,11 @@ create_sprites(struct drm_backend *b)
  13. drmModePlaneRes *kplane_res;
  14. drmModePlane *kplane;
  15. struct drm_plane *drm_plane;
  16. - uint32_t i;
  17. + uint32_t i, overlay_plane = 0;
  18. + const char *thead_po_limitation;
  19. +
  20. + thead_po_limitation = getenv("THEAD_PO_LIMITATION");
  21. +
  22. kplane_res = drmModeGetPlaneResources(b->drm.fd);
  23. if (!kplane_res) {
  24. weston_log("failed to get plane resources: %s\n",
  25. @@ -991,10 +995,20 @@ create_sprites(struct drm_backend *b)
  26. if (!drm_plane)
  27. continue;
  28. - if (drm_plane->type == WDRM_PLANE_TYPE_OVERLAY)
  29. + if (drm_plane->type == WDRM_PLANE_TYPE_OVERLAY){
  30. + if (thead_po_limitation && !strcmp(thead_po_limitation, "true")) {
  31. + weston_log("Enabled Thead plane overlay limitation\n");
  32. + if (overlay_plane <= 1)
  33. + drm_plane->possible_crtcs = (1 << 0);
  34. + else
  35. + drm_plane->possible_crtcs = (1 << 1);
  36. + }
  37. +
  38. weston_compositor_stack_plane(b->compositor,
  39. &drm_plane->base,
  40. &b->compositor->primary_plane);
  41. + overlay_plane++;
  42. + }
  43. }
  44. drmModeFreePlaneResources(kplane_res);
  45. --
  46. 2.17.1