aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Stultz2018-05-02 12:34:13 -0500
committerandroid-build-merger2018-05-02 12:34:13 -0500
commit32dbc66ec9670bca588cb02d18f99f6c5397796f (patch)
treee5afaaeab8cc5dae563ebc15c76cc23f0a42f335
parente2a5c1423cc33520db5eb1db16a468b107c20c80 (diff)
parent1ba95114c21c3c78b6943288d23a22dac235e7d9 (diff)
downloadexternal-libdrm-32dbc66ec9670bca588cb02d18f99f6c5397796f.tar.gz
external-libdrm-32dbc66ec9670bca588cb02d18f99f6c5397796f.tar.xz
external-libdrm-32dbc66ec9670bca588cb02d18f99f6c5397796f.zip
libdrm: planetest/atomictest: Fix up build issue missed in rebasing am: 843b239004
am: 1ba95114c2 Change-Id: Ie0cbf6979440565a012802443a061f80679de840
-rw-r--r--tests/planetest/atomictest.c10
-rw-r--r--tests/planetest/modeset.c40
-rw-r--r--tests/planetest/modeset.h2
3 files changed, 26 insertions, 26 deletions
diff --git a/tests/planetest/atomictest.c b/tests/planetest/atomictest.c
index 5fec911a..891d242c 100644
--- a/tests/planetest/atomictest.c
+++ b/tests/planetest/atomictest.c
@@ -47,7 +47,7 @@ int main(int argc, char *argv[])
47 struct sp_plane **plane = NULL; 47 struct sp_plane **plane = NULL;
48 struct sp_crtc *test_crtc; 48 struct sp_crtc *test_crtc;
49 fd_set fds; 49 fd_set fds;
50 drmModePropertySetPtr pset; 50 drmModeAtomicReqPtr pset;
51 drmEventContext event_context = { 51 drmEventContext event_context = {
52 .version = DRM_EVENT_CONTEXT_VERSION, 52 .version = DRM_EVENT_CONTEXT_VERSION,
53 .page_flip_handler = page_flip_handler, 53 .page_flip_handler = page_flip_handler,
@@ -100,7 +100,7 @@ int main(int argc, char *argv[])
100 fill_bo(plane[i]->bo, 0xFF, 0xFF, 0xFF, 0xFF); 100 fill_bo(plane[i]->bo, 0xFF, 0xFF, 0xFF, 0xFF);
101 } 101 }
102 102
103 pset = drmModePropertySetAlloc(); 103 pset = drmModeAtomicAlloc();
104 if (!pset) { 104 if (!pset) {
105 printf("Failed to allocate the property set\n"); 105 printf("Failed to allocate the property set\n");
106 goto out; 106 goto out;
@@ -124,8 +124,8 @@ int main(int argc, char *argv[])
124 } 124 }
125 } 125 }
126 126
127 ret = drmModePropertySetCommit(dev->fd, 127 ret = drmModeAtomicCommit(dev->fd, pset,
128 DRM_MODE_PAGE_FLIP_EVENT, NULL, pset); 128 DRM_MODE_PAGE_FLIP_EVENT, NULL);
129 if (ret) { 129 if (ret) {
130 printf("failed to commit properties ret=%d\n", ret); 130 printf("failed to commit properties ret=%d\n", ret);
131 goto out; 131 goto out;
@@ -139,7 +139,7 @@ int main(int argc, char *argv[])
139 drmHandleEvent(dev->fd, &event_context); 139 drmHandleEvent(dev->fd, &event_context);
140 } 140 }
141 141
142 drmModePropertySetFree(pset); 142 drmModeAtomicFree(pset);
143 143
144 for (i = 0; i < num_test_planes; i++) 144 for (i = 0; i < num_test_planes; i++)
145 put_sp_plane(plane[i]); 145 put_sp_plane(plane[i]);
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}
192int set_sp_plane_pset(struct sp_dev *dev, struct sp_plane *plane, 192int 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");
diff --git a/tests/planetest/modeset.h b/tests/planetest/modeset.h
index 7e965743..54999596 100644
--- a/tests/planetest/modeset.h
+++ b/tests/planetest/modeset.h
@@ -14,6 +14,6 @@ int set_sp_plane(struct sp_dev *dev, struct sp_plane *plane,
14 struct sp_crtc *crtc, int x, int y); 14 struct sp_crtc *crtc, int x, int y);
15 15
16int set_sp_plane_pset(struct sp_dev *dev, struct sp_plane *plane, 16int set_sp_plane_pset(struct sp_dev *dev, struct sp_plane *plane,
17 drmModePropertySetPtr pset, struct sp_crtc *crtc, int x, int y); 17 drmModeAtomicReqPtr pset, struct sp_crtc *crtc, int x, int y);
18 18
19#endif /* __MODESET_H_INCLUDED__ */ 19#endif /* __MODESET_H_INCLUDED__ */