Lines Matching +full:0 +full:- +full:1023
20 return -EINVAL; \
22 } while (0)
30 plane_state->src_x = src_x; in set_src()
31 plane_state->src_y = src_y; in set_src()
32 plane_state->src_w = src_w; in set_src()
33 plane_state->src_h = src_h; in set_src()
40 if (plane_state->src.x1 < 0) { in check_src_eq()
41 pr_err("src x coordinate %x should never be below 0.\n", plane_state->src.x1); in check_src_eq()
42 drm_rect_debug_print("src: ", &plane_state->src, true); in check_src_eq()
45 if (plane_state->src.y1 < 0) { in check_src_eq()
46 pr_err("src y coordinate %x should never be below 0.\n", plane_state->src.y1); in check_src_eq()
47 drm_rect_debug_print("src: ", &plane_state->src, true); in check_src_eq()
51 if (plane_state->src.x1 != src_x || in check_src_eq()
52 plane_state->src.y1 != src_y || in check_src_eq()
53 drm_rect_width(&plane_state->src) != src_w || in check_src_eq()
54 drm_rect_height(&plane_state->src) != src_h) { in check_src_eq()
55 drm_rect_debug_print("src: ", &plane_state->src, true); in check_src_eq()
66 plane_state->crtc_x = crtc_x; in set_crtc()
67 plane_state->crtc_y = crtc_y; in set_crtc()
68 plane_state->crtc_w = crtc_w; in set_crtc()
69 plane_state->crtc_h = crtc_h; in set_crtc()
76 if (plane_state->dst.x1 != crtc_x || in check_crtc_eq()
77 plane_state->dst.y1 != crtc_y || in check_crtc_eq()
78 drm_rect_width(&plane_state->dst) != crtc_w || in check_crtc_eq()
79 drm_rect_height(&plane_state->dst) != crtc_h) { in check_crtc_eq()
80 drm_rect_debug_print("dst: ", &plane_state->dst, false); in check_crtc_eq()
97 DRM_MODE("1024x768", 0, 65000, 1024, 1048, in igt_check_plane_state()
98 1184, 1344, 0, 768, 771, 777, 806, 0, in igt_check_plane_state()
113 set_src(&plane_state, 0, 0, fb.width << 16, fb.height << 16); in igt_check_plane_state()
114 set_crtc(&plane_state, 0, 0, fb.width, fb.height); in igt_check_plane_state()
119 FAIL(ret < 0, "Simple clipping check should pass\n"); in igt_check_plane_state()
121 FAIL_ON(!check_src_eq(&plane_state, 0, 0, 1024 << 16, 768 << 16)); in igt_check_plane_state()
122 FAIL_ON(!check_crtc_eq(&plane_state, 0, 0, 1024, 768)); in igt_check_plane_state()
130 FAIL(ret < 0, "Rotated clipping check should pass\n"); in igt_check_plane_state()
132 FAIL_ON(!check_src_eq(&plane_state, 0, 0, 768 << 16, 1024 << 16)); in igt_check_plane_state()
133 FAIL_ON(!check_crtc_eq(&plane_state, 0, 0, 1024, 768)); in igt_check_plane_state()
137 set_src(&plane_state, 0, 0, 1023 << 16, 767 << 16); in igt_check_plane_state()
138 set_crtc(&plane_state, 0, 0, 1023, 767); in igt_check_plane_state()
149 FAIL(ret < 0, "Simple positioning should work\n"); in igt_check_plane_state()
151 FAIL_ON(!check_src_eq(&plane_state, 0, 0, 1023 << 16, 767 << 16)); in igt_check_plane_state()
152 FAIL_ON(!check_crtc_eq(&plane_state, 0, 0, 1023, 767)); in igt_check_plane_state()
155 set_src(&plane_state, 0, 0, 512 << 16, 384 << 16); in igt_check_plane_state()
156 set_crtc(&plane_state, 0, 0, 1024, 768); in igt_check_plane_state()
158 0x8001, in igt_check_plane_state()
163 0x8000, in igt_check_plane_state()
166 FAIL(ret < 0, "Upscaling exactly 2x should work\n"); in igt_check_plane_state()
168 FAIL_ON(!check_src_eq(&plane_state, 0, 0, 512 << 16, 384 << 16)); in igt_check_plane_state()
169 FAIL_ON(!check_crtc_eq(&plane_state, 0, 0, 1024, 768)); in igt_check_plane_state()
171 set_src(&plane_state, 0, 0, 2048 << 16, 1536 << 16); in igt_check_plane_state()
174 0x1ffff, false, false); in igt_check_plane_state()
178 0x20000, false, false); in igt_check_plane_state()
179 FAIL(ret < 0, "Should succeed with exact scaling limit\n"); in igt_check_plane_state()
181 FAIL_ON(!check_src_eq(&plane_state, 0, 0, 2048 << 16, 1536 << 16)); in igt_check_plane_state()
182 FAIL_ON(!check_crtc_eq(&plane_state, 0, 0, 1024, 768)); in igt_check_plane_state()
185 set_src(&plane_state, 0, 0, 0x40001, 0x40001); in igt_check_plane_state()
189 0x10001, in igt_check_plane_state()
191 FAIL(ret < 0, "Should succeed by clipping to exact multiple"); in igt_check_plane_state()
193 FAIL_ON(!check_src_eq(&plane_state, 0, 0, 2 << 16, 2 << 16)); in igt_check_plane_state()
196 set_src(&plane_state, 0x20001, 0x20001, 0x4040001, 0x3040001); in igt_check_plane_state()
197 set_crtc(&plane_state, -2, -2, 1028, 772); in igt_check_plane_state()
200 0x10001, in igt_check_plane_state()
202 FAIL(ret < 0, "Should succeed by clipping to exact multiple"); in igt_check_plane_state()
204 FAIL_ON(!check_src_eq(&plane_state, 0x40002, 0x40002, 1024 << 16, 768 << 16)); in igt_check_plane_state()
205 FAIL_ON(!check_crtc_eq(&plane_state, 0, 0, 1024, 768)); in igt_check_plane_state()
207 set_src(&plane_state, 0, 0, 0x3ffff, 0x3ffff); 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 /* Should not be rounded to 0x20001, which would be upscaling. */ in igt_check_plane_state()
216 FAIL_ON(!check_src_eq(&plane_state, 0, 0, 2 << 16, 2 << 16)); in igt_check_plane_state()
219 set_src(&plane_state, 0x1ffff, 0x1ffff, 0x403ffff, 0x303ffff); in igt_check_plane_state()
220 set_crtc(&plane_state, -2, -2, 1028, 772); in igt_check_plane_state()
222 0xffff, in igt_check_plane_state()
225 FAIL(ret < 0, "Should succeed by clipping to exact multiple"); in igt_check_plane_state()
227 FAIL_ON(!check_src_eq(&plane_state, 0x3fffe, 0x3fffe, 1024 << 16, 768 << 16)); in igt_check_plane_state()
228 FAIL_ON(!check_crtc_eq(&plane_state, 0, 0, 1024, 768)); in igt_check_plane_state()
230 return 0; in igt_check_plane_state()
241 return err > 0 ? 0 : err; in test_drm_helper_init()