hwc: set max overlay count for assigning overlay layer to output 1 67/299067/1
authorChangyeon Lee <cyeon.lee@samsung.com>
Tue, 19 Sep 2023 06:09:55 +0000 (15:09 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Tue, 19 Sep 2023 06:09:55 +0000 (15:09 +0900)
output 0 overlay count : 9
output 1 overlay count : 8

Change-Id: I635e6831d5eb09922b4bd95752edb6da73e3a44f

src/tdm_vc4_display.c

index 39656e8..fe9d70f 100644 (file)
@@ -34,6 +34,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #include "tdm_backend_vc4.h"
 
+#define MAX_OVERLAY_COUNT 9
+
 #define LIST_INSERT_AFTER(__after, __item) \
                (__item)->prev = (__after); \
                (__item)->next = (__after)->next; \
@@ -615,6 +617,8 @@ _tdm_vc4_display_create_layer_list_type(tdm_vc4_display *display_data)
                                } else if (type == DRM_PLANE_TYPE_PRIMARY) {
                                        if (output_data->primary_layer)
                                                continue;
+                               } else if (output_data->overlay_layer_count > MAX_OVERLAY_COUNT) {
+                                       continue;
                                }
 
                                output_find = 1;