diff options
Diffstat (limited to 'tests/planetest/modeset.c')
-rw-r--r-- | tests/planetest/modeset.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/tests/planetest/modeset.c b/tests/planetest/modeset.c index 037814ec..b8f66906 100644 --- a/tests/planetest/modeset.c +++ b/tests/planetest/modeset.c | |||
@@ -15,7 +15,7 @@ static int set_crtc_mode(struct sp_dev *dev, struct sp_crtc *crtc, | |||
15 | { | 15 | { |
16 | int ret; | 16 | int ret; |
17 | struct drm_mode_create_blob create_blob; | 17 | struct drm_mode_create_blob create_blob; |
18 | drmModePropertySetPtr pset; | 18 | drmModeAtomicReqPtr pset; |
19 | 19 | ||
20 | memset(&create_blob, 0, sizeof(create_blob)); | 20 | memset(&create_blob, 0, sizeof(create_blob)); |
21 | create_blob.length = sizeof(struct drm_mode_modeinfo); | 21 | create_blob.length = sizeof(struct drm_mode_modeinfo); |
@@ -27,28 +27,28 @@ static int set_crtc_mode(struct sp_dev *dev, struct sp_crtc *crtc, | |||
27 | return ret; | 27 | return ret; |
28 | } | 28 | } |
29 | 29 | ||
30 | pset = drmModePropertySetAlloc(); | 30 | pset = drmModeAtomicAlloc(); |
31 | if (!pset) { | 31 | if (!pset) { |
32 | printf("Failed to allocate property set"); | 32 | printf("Failed to allocate property set"); |
33 | return -1; | 33 | return -1; |
34 | } | 34 | } |
35 | 35 | ||
36 | ret = drmModePropertySetAdd(pset, crtc->crtc->crtc_id, | 36 | ret = drmModeAtomicAddProperty(pset, crtc->crtc->crtc_id, |
37 | crtc->mode_pid, create_blob.blob_id) || | 37 | crtc->mode_pid, create_blob.blob_id) || |
38 | drmModePropertySetAdd(pset, crtc->crtc->crtc_id, | 38 | drmModeAtomicAddProperty(pset, crtc->crtc->crtc_id, |
39 | crtc->active_pid, 1) || | 39 | crtc->active_pid, 1) || |
40 | drmModePropertySetAdd(pset, conn->conn->connector_id, | 40 | drmModeAtomicAddProperty(pset, conn->conn->connector_id, |
41 | conn->crtc_id_pid, crtc->crtc->crtc_id); | 41 | conn->crtc_id_pid, crtc->crtc->crtc_id); |
42 | if (ret) { | 42 | if (ret) { |
43 | printf("Failed to add blob %d to pset", create_blob.blob_id); | 43 | printf("Failed to add blob %d to pset", create_blob.blob_id); |
44 | drmModePropertySetFree(pset); | 44 | drmModeAtomicFree(pset); |
45 | return ret; | 45 | return ret; |
46 | } | 46 | } |
47 | 47 | ||
48 | ret = drmModePropertySetCommit(dev->fd, DRM_MODE_ATOMIC_ALLOW_MODESET, | 48 | ret = drmModeAtomicCommit(dev->fd, pset, DRM_MODE_ATOMIC_ALLOW_MODESET, |
49 | NULL, pset); | 49 | NULL); |
50 | 50 | ||
51 | drmModePropertySetFree(pset); | 51 | drmModeAtomicFree(pset); |
52 | 52 | ||
53 | if (ret) { | 53 | if (ret) { |
54 | printf("Failed to commit pset ret=%d\n", ret); | 54 | printf("Failed to commit pset ret=%d\n", ret); |
@@ -190,7 +190,7 @@ int set_sp_plane(struct sp_dev *dev, struct sp_plane *plane, | |||
190 | return ret; | 190 | return ret; |
191 | } | 191 | } |
192 | int set_sp_plane_pset(struct sp_dev *dev, struct sp_plane *plane, | 192 | int set_sp_plane_pset(struct sp_dev *dev, struct sp_plane *plane, |
193 | drmModePropertySetPtr pset, struct sp_crtc *crtc, int x, int y) | 193 | drmModeAtomicReqPtr pset, struct sp_crtc *crtc, int x, int y) |
194 | { | 194 | { |
195 | int ret; | 195 | int ret; |
196 | uint32_t w, h; | 196 | uint32_t w, h; |
@@ -203,25 +203,25 @@ int set_sp_plane_pset(struct sp_dev *dev, struct sp_plane *plane, | |||
203 | if ((h + y) > crtc->crtc->mode.vdisplay) | 203 | if ((h + y) > crtc->crtc->mode.vdisplay) |
204 | h = crtc->crtc->mode.vdisplay - y; | 204 | h = crtc->crtc->mode.vdisplay - y; |
205 | 205 | ||
206 | ret = drmModePropertySetAdd(pset, plane->plane->plane_id, | 206 | ret = drmModeAtomicAddProperty(pset, plane->plane->plane_id, |
207 | plane->crtc_pid, crtc->crtc->crtc_id) | 207 | plane->crtc_pid, crtc->crtc->crtc_id) |
208 | || drmModePropertySetAdd(pset, plane->plane->plane_id, | 208 | || drmModeAtomicAddProperty(pset, plane->plane->plane_id, |
209 | plane->fb_pid, plane->bo->fb_id) | 209 | plane->fb_pid, plane->bo->fb_id) |
210 | || drmModePropertySetAdd(pset, plane->plane->plane_id, | 210 | || drmModeAtomicAddProperty(pset, plane->plane->plane_id, |
211 | plane->crtc_x_pid, x) | 211 | plane->crtc_x_pid, x) |
212 | || drmModePropertySetAdd(pset, plane->plane->plane_id, | 212 | || drmModeAtomicAddProperty(pset, plane->plane->plane_id, |
213 | plane->crtc_y_pid, y) | 213 | plane->crtc_y_pid, y) |
214 | || drmModePropertySetAdd(pset, plane->plane->plane_id, | 214 | || drmModeAtomicAddProperty(pset, plane->plane->plane_id, |
215 | plane->crtc_w_pid, w) | 215 | plane->crtc_w_pid, w) |
216 | || drmModePropertySetAdd(pset, plane->plane->plane_id, | 216 | || drmModeAtomicAddProperty(pset, plane->plane->plane_id, |
217 | plane->crtc_h_pid, h) | 217 | plane->crtc_h_pid, h) |
218 | || drmModePropertySetAdd(pset, plane->plane->plane_id, | 218 | || drmModeAtomicAddProperty(pset, plane->plane->plane_id, |
219 | plane->src_x_pid, 0) | 219 | plane->src_x_pid, 0) |
220 | || drmModePropertySetAdd(pset, plane->plane->plane_id, | 220 | || drmModeAtomicAddProperty(pset, plane->plane->plane_id, |
221 | plane->src_y_pid, 0) | 221 | plane->src_y_pid, 0) |
222 | || drmModePropertySetAdd(pset, plane->plane->plane_id, | 222 | || drmModeAtomicAddProperty(pset, plane->plane->plane_id, |
223 | plane->src_w_pid, w << 16) | 223 | plane->src_w_pid, w << 16) |
224 | || drmModePropertySetAdd(pset, plane->plane->plane_id, | 224 | || drmModeAtomicAddProperty(pset, plane->plane->plane_id, |
225 | plane->src_h_pid, h << 16); | 225 | plane->src_h_pid, h << 16); |
226 | if (ret) { | 226 | if (ret) { |
227 | printf("failed to add properties to the set\n"); | 227 | printf("failed to add properties to the set\n"); |