Skip to content

backend-drm: fix drm plane repeated picked when do state propose

when drm backend do state propose, weston view will been placed on specific drm plane for one output, on another output, this drm plane may been selected again because it only check if this drm plane has been added to its own plane list.

eg, from below log, plane 51 has been picked for both crtc 48 and crtc 38

[15:59:18.464] 				[plane] plane 51 picked from candidate list, type: overlay
[15:59:18.465] 		[atomic] testing output 1 (HDMI-A-2) state
[15:59:18.465] 			[CRTC:48] 23 (MODE_ID) -> 97 (0x61)
[15:59:18.465] 			[CRTC:48] 22 (ACTIVE) -> 1 (0x1)
[15:59:18.465] 			[CRTC:48] 24 (VRR_ENABLED) -> 0 (0x0)
[15:59:18.465] 			[CONN:50] 20 (CRTC_ID) -> 48 (0x30)
[15:59:18.465] 			[PLANE:51] 17 (FB_ID) -> 101 (0x65)
[15:59:18.465] 			[PLANE:51] 20 (CRTC_ID) -> 48 (0x30)
[15:59:18.465] 			[PLANE:51] 9 (SRC_X) -> 0 (0x0)
[15:59:18.465] 			[PLANE:51] 10 (SRC_Y) -> 0 (0x0)
[15:59:18.465] 			[PLANE:51] 11 (SRC_W) -> 83886080 (0x5000000)
[15:59:18.465] 			[PLANE:51] 12 (SRC_H) -> 52428800 (0x3200000)
[15:59:18.465] 			[PLANE:51] 13 (CRTC_X) -> 122 (0x7a)
[15:59:18.465] 			[PLANE:51] 14 (CRTC_Y) -> 32 (0x20)
[15:59:18.465] 			[PLANE:51] 15 (CRTC_W) -> 1676 (0x68c)
[15:59:18.465] 			[PLANE:51] 16 (CRTC_H) -> 1048 (0x418)
[15:59:18.465] 			[PLANE:51] FORMAT: YUYV
[15:59:18.465] 			[PLANE:51] 53 (zpos) -> 5 (0x5)
[15:59:18.465] 			[PLANE:51] 54 (alpha) -> 65535 (0xffff)
[15:59:18.465] 			[PLANE:41] 17 (FB_ID) -> 96 (0x60)
[15:59:18.465] 			[PLANE:41] 20 (CRTC_ID) -> 48 (0x30)
[15:59:18.465] 			[PLANE:41] 9 (SRC_X) -> 0 (0x0)
[15:59:18.465] 			[PLANE:41] 10 (SRC_Y) -> 0 (0x0)
[15:59:18.465] 			[PLANE:41] 11 (SRC_W) -> 125829120 (0x7800000)
[15:59:18.465] 			[PLANE:41] 12 (SRC_H) -> 70778880 (0x4380000)
[15:59:18.465] 			[PLANE:41] 13 (CRTC_X) -> 0 (0x0)
[15:59:18.465] 			[PLANE:41] 14 (CRTC_Y) -> 0 (0x0)
[15:59:18.465] 			[PLANE:41] 15 (CRTC_W) -> 1920 (0x780)
[15:59:18.465] 			[PLANE:41] 16 (CRTC_H) -> 1080 (0x438)
[15:59:18.465] 			[PLANE:41] FORMAT: XRGB8888
[15:59:18.465] 			[PLANE:41] 18 (IN_FENCE_FD) -> 99 (0x63)
[15:59:18.465] 			[PLANE:41] 43 (zpos) -> 0 (0x0)
[15:59:18.465] 			[PLANE:41] 44 (alpha) -> 65535 (0xffff)
[15:59:18.465] 		[atomic] testing output 0 (HDMI-A-1) state
[15:59:18.465] 			[CRTC:38] 23 (MODE_ID) -> 98 (0x62)
[15:59:18.465] 			[CRTC:38] 22 (ACTIVE) -> 1 (0x1)
[15:59:18.465] 			[CRTC:38] 24 (VRR_ENABLED) -> 0 (0x0)
[15:59:18.465] 			[CONN:40] 20 (CRTC_ID) -> 38 (0x26)
[15:59:18.465] 			[PLANE:31] 17 (FB_ID) -> 92 (0x5c)
[15:59:18.465] 			[PLANE:31] 20 (CRTC_ID) -> 38 (0x26)
[15:59:18.465] 			[PLANE:31] 9 (SRC_X) -> 0 (0x0)
[15:59:18.465] 			[PLANE:31] 10 (SRC_Y) -> 0 (0x0)
[15:59:18.465] 			[PLANE:31] 11 (SRC_W) -> 125829120 (0x7800000)
[15:59:18.465] 			[PLANE:31] 12 (SRC_H) -> 70778880 (0x4380000)
[15:59:18.465] 			[PLANE:31] 13 (CRTC_X) -> 0 (0x0)
[15:59:18.465] 			[PLANE:31] 14 (CRTC_Y) -> 0 (0x0)
[15:59:18.465] 			[PLANE:31] 15 (CRTC_W) -> 1920 (0x780)
[15:59:18.465] 			[PLANE:31] 16 (CRTC_H) -> 1080 (0x438)
[15:59:18.465] 			[PLANE:31] FORMAT: XRGB8888
[15:59:18.465] 			[PLANE:31] 18 (IN_FENCE_FD) -> 114 (0x72)
[15:59:18.465] 			[PLANE:31] 33 (zpos) -> 0 (0x0)
[15:59:18.466] 			[PLANE:31] 34 (alpha) -> 65535 (0xffff)
[15:59:18.466] 			[PLANE:51] 17 (FB_ID) -> 104 (0x68)
[15:59:18.466] 			[PLANE:51] 20 (CRTC_ID) -> 38 (0x26)
[15:59:18.466] 			[PLANE:51] 9 (SRC_X) -> 0 (0x0)
[15:59:18.466] 			[PLANE:51] 10 (SRC_Y) -> 0 (0x0)
[15:59:18.466] 			[PLANE:51] 11 (SRC_W) -> 16384000 (0xfa0000)
[15:59:18.466] 			[PLANE:51] 12 (SRC_H) -> 16384000 (0xfa0000)
[15:59:18.466] 			[PLANE:51] 13 (CRTC_X) -> 636 (0x27c)
[15:59:18.466] 			[PLANE:51] 14 (CRTC_Y) -> 415 (0x19f)
[15:59:18.466] 			[PLANE:51] 15 (CRTC_W) -> 250 (0xfa)
[15:59:18.466] 			[PLANE:51] 16 (CRTC_H) -> 250 (0xfa)
[15:59:18.466] 			[PLANE:51] FORMAT: ARGB8888
[15:59:18.466] 			[PLANE:51] 18 (IN_FENCE_FD) -> 115 (0x73)
[15:59:18.466] 			[PLANE:51] 53 (zpos) -> 5 (0x5)
[15:59:18.466] 			[PLANE:51] 54 (alpha) -> 65535 (0xffff)
[15:59:18.466] [atomic] drmModeAtomicCommit

Need check if this plane has been assigned to any output.

Edited by Haihua Hu

Merge request reports