Lines Matching +full:0 +full:- +full:1023

1 // SPDX-License-Identifier: GPL-2.0
12 #include "test-drm_modeset_common.h"
18 plane_state->src_x = src_x; in set_src()
19 plane_state->src_y = src_y; in set_src()
20 plane_state->src_w = src_w; in set_src()
21 plane_state->src_h = src_h; in set_src()
28 if (plane_state->src.x1 < 0) { in check_src_eq()
29 pr_err("src x coordinate %x should never be below 0.\n", plane_state->src.x1); in check_src_eq()
30 drm_rect_debug_print("src: ", &plane_state->src, true); in check_src_eq()
33 if (plane_state->src.y1 < 0) { in check_src_eq()
34 pr_err("src y coordinate %x should never be below 0.\n", plane_state->src.y1); in check_src_eq()
35 drm_rect_debug_print("src: ", &plane_state->src, true); in check_src_eq()
39 if (plane_state->src.x1 != src_x || in check_src_eq()
40 plane_state->src.y1 != src_y || in check_src_eq()
41 drm_rect_width(&plane_state->src) != src_w || in check_src_eq()
42 drm_rect_height(&plane_state->src) != src_h) { in check_src_eq()
43 drm_rect_debug_print("src: ", &plane_state->src, true); in check_src_eq()
54 plane_state->crtc_x = crtc_x; in set_crtc()
55 plane_state->crtc_y = crtc_y; in set_crtc()
56 plane_state->crtc_w = crtc_w; in set_crtc()
57 plane_state->crtc_h = crtc_h; in set_crtc()
64 if (plane_state->dst.x1 != crtc_x || in check_crtc_eq()
65 plane_state->dst.y1 != crtc_y || in check_crtc_eq()
66 drm_rect_width(&plane_state->dst) != crtc_w || in check_crtc_eq()
67 drm_rect_height(&plane_state->dst) != crtc_h) { in check_crtc_eq()
68 drm_rect_debug_print("dst: ", &plane_state->dst, false); in check_crtc_eq()
85 DRM_MODE("1024x768", 0, 65000, 1024, 1048, in igt_check_plane_state()
86 1184, 1344, 0, 768, 771, 777, 806, 0, in igt_check_plane_state()
101 set_src(&plane_state, 0, 0, fb.width << 16, fb.height << 16); in igt_check_plane_state()
102 set_crtc(&plane_state, 0, 0, fb.width, fb.height); in igt_check_plane_state()
107 FAIL(ret < 0, "Simple clipping check should pass\n"); in igt_check_plane_state()
109 FAIL_ON(!check_src_eq(&plane_state, 0, 0, 1024 << 16, 768 << 16)); in igt_check_plane_state()
110 FAIL_ON(!check_crtc_eq(&plane_state, 0, 0, 1024, 768)); in igt_check_plane_state()
118 FAIL(ret < 0, "Rotated clipping check should pass\n"); in igt_check_plane_state()
120 FAIL_ON(!check_src_eq(&plane_state, 0, 0, 768 << 16, 1024 << 16)); in igt_check_plane_state()
121 FAIL_ON(!check_crtc_eq(&plane_state, 0, 0, 1024, 768)); in igt_check_plane_state()
125 set_src(&plane_state, 0, 0, 1023 << 16, 767 << 16); in igt_check_plane_state()
126 set_crtc(&plane_state, 0, 0, 1023, 767); in igt_check_plane_state()
137 FAIL(ret < 0, "Simple positioning should work\n"); in igt_check_plane_state()
139 FAIL_ON(!check_src_eq(&plane_state, 0, 0, 1023 << 16, 767 << 16)); in igt_check_plane_state()
140 FAIL_ON(!check_crtc_eq(&plane_state, 0, 0, 1023, 767)); in igt_check_plane_state()
143 set_src(&plane_state, 0, 0, 512 << 16, 384 << 16); in igt_check_plane_state()
144 set_crtc(&plane_state, 0, 0, 1024, 768); in igt_check_plane_state()
146 0x8001, in igt_check_plane_state()
151 0x8000, in igt_check_plane_state()
154 FAIL(ret < 0, "Upscaling exactly 2x should work\n"); in igt_check_plane_state()
156 FAIL_ON(!check_src_eq(&plane_state, 0, 0, 512 << 16, 384 << 16)); in igt_check_plane_state()
157 FAIL_ON(!check_crtc_eq(&plane_state, 0, 0, 1024, 768)); in igt_check_plane_state()
159 set_src(&plane_state, 0, 0, 2048 << 16, 1536 << 16); in igt_check_plane_state()
162 0x1ffff, false, false); in igt_check_plane_state()
166 0x20000, false, false); in igt_check_plane_state()
167 FAIL(ret < 0, "Should succeed with exact scaling limit\n"); in igt_check_plane_state()
169 FAIL_ON(!check_src_eq(&plane_state, 0, 0, 2048 << 16, 1536 << 16)); in igt_check_plane_state()
170 FAIL_ON(!check_crtc_eq(&plane_state, 0, 0, 1024, 768)); in igt_check_plane_state()
173 set_src(&plane_state, 0, 0, 0x40001, 0x40001); in igt_check_plane_state()
177 0x10001, in igt_check_plane_state()
179 FAIL(ret < 0, "Should succeed by clipping to exact multiple"); in igt_check_plane_state()
181 FAIL_ON(!check_src_eq(&plane_state, 0, 0, 2 << 16, 2 << 16)); in igt_check_plane_state()
184 set_src(&plane_state, 0x20001, 0x20001, 0x4040001, 0x3040001); in igt_check_plane_state()
185 set_crtc(&plane_state, -2, -2, 1028, 772); in igt_check_plane_state()
188 0x10001, in igt_check_plane_state()
190 FAIL(ret < 0, "Should succeed by clipping to exact multiple"); in igt_check_plane_state()
192 FAIL_ON(!check_src_eq(&plane_state, 0x40002, 0x40002, 1024 << 16, 768 << 16)); in igt_check_plane_state()
193 FAIL_ON(!check_crtc_eq(&plane_state, 0, 0, 1024, 768)); in igt_check_plane_state()
195 set_src(&plane_state, 0, 0, 0x3ffff, 0x3ffff); in igt_check_plane_state()
198 0xffff, in igt_check_plane_state()
201 FAIL(ret < 0, "Should succeed by clipping to exact multiple"); in igt_check_plane_state()
203 /* Should not be rounded to 0x20001, which would be upscaling. */ in igt_check_plane_state()
204 FAIL_ON(!check_src_eq(&plane_state, 0, 0, 2 << 16, 2 << 16)); in igt_check_plane_state()
207 set_src(&plane_state, 0x1ffff, 0x1ffff, 0x403ffff, 0x303ffff); in igt_check_plane_state()
208 set_crtc(&plane_state, -2, -2, 1028, 772); in igt_check_plane_state()
210 0xffff, in igt_check_plane_state()
213 FAIL(ret < 0, "Should succeed by clipping to exact multiple"); in igt_check_plane_state()
215 FAIL_ON(!check_src_eq(&plane_state, 0x3fffe, 0x3fffe, 1024 << 16, 768 << 16)); in igt_check_plane_state()
216 FAIL_ON(!check_crtc_eq(&plane_state, 0, 0, 1024, 768)); in igt_check_plane_state()
218 return 0; in igt_check_plane_state()