summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm2/ecore_drm2_fb.c
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2017-06-09 13:50:22 -0400
committerChris Michael <cp.michael@samsung.com>2017-06-09 13:50:22 -0400
commita55eafd960f9061993eba023b02fcf064b834105 (patch)
treee03c3833bf774452eb7e8f43502a1b294ef75417 /src/lib/ecore_drm2/ecore_drm2_fb.c
parent6e37d13a1c1df29a12b0d15d89aa549d5c01f265 (diff)
ecore-drm2: Fix drm_mode variables to work with static lib
As we now use static_libs/libdrm to build ecore_drm2, we need to fix how our drm_mode variables are declared so we can use them. @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to '')
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_fb.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c b/src/lib/ecore_drm2/ecore_drm2_fb.c
index ea6fcec194..c6683f4d3d 100644
--- a/src/lib/ecore_drm2/ecore_drm2_fb.c
+++ b/src/lib/ecore_drm2/ecore_drm2_fb.c
@@ -19,9 +19,9 @@ EAPI Ecore_Drm2_Fb *
19ecore_drm2_fb_create(int fd, int width, int height, int depth, int bpp, unsigned int format) 19ecore_drm2_fb_create(int fd, int width, int height, int depth, int bpp, unsigned int format)
20{ 20{
21 Ecore_Drm2_Fb *fb; 21 Ecore_Drm2_Fb *fb;
22 drm_mode_create_dumb carg; 22 struct drm_mode_create_dumb carg;
23 drm_mode_destroy_dumb darg; 23 struct drm_mode_destroy_dumb darg;
24 drm_mode_map_dumb marg; 24 struct drm_mode_map_dumb marg;
25 int ret; 25 int ret;
26 26
27 EINA_SAFETY_ON_TRUE_RETURN_VAL((fd < 0), NULL); 27 EINA_SAFETY_ON_TRUE_RETURN_VAL((fd < 0), NULL);
@@ -37,7 +37,7 @@ ecore_drm2_fb_create(int fd, int width, int height, int depth, int bpp, unsigned
37 fb->format = format; 37 fb->format = format;
38 fb->ref = 1; 38 fb->ref = 1;
39 39
40 memset(&carg, 0, sizeof(drm_mode_create_dumb)); 40 memset(&carg, 0, sizeof(struct drm_mode_create_dumb));
41 carg.bpp = bpp; 41 carg.bpp = bpp;
42 carg.width = width; 42 carg.width = width;
43 carg.height = height; 43 carg.height = height;
@@ -61,7 +61,7 @@ ecore_drm2_fb_create(int fd, int width, int height, int depth, int bpp, unsigned
61 } 61 }
62 } 62 }
63 63
64 memset(&marg, 0, sizeof(drm_mode_map_dumb)); 64 memset(&marg, 0, sizeof(struct drm_mode_map_dumb));
65 marg.handle = fb->handles[0]; 65 marg.handle = fb->handles[0];
66 ret = sym_drmIoctl(fd, DRM_IOCTL_MODE_MAP_DUMB, &marg); 66 ret = sym_drmIoctl(fd, DRM_IOCTL_MODE_MAP_DUMB, &marg);
67 if (ret) 67 if (ret)
@@ -82,7 +82,7 @@ ecore_drm2_fb_create(int fd, int width, int height, int depth, int bpp, unsigned
82map_err: 82map_err:
83 sym_drmModeRmFB(fd, fb->id); 83 sym_drmModeRmFB(fd, fb->id);
84add_err: 84add_err:
85 memset(&darg, 0, sizeof(drm_mode_destroy_dumb)); 85 memset(&darg, 0, sizeof(struct drm_mode_destroy_dumb));
86 darg.handle = fb->handles[0]; 86 darg.handle = fb->handles[0];
87 sym_drmIoctl(fd, DRM_IOCTL_MODE_DESTROY_DUMB, &darg); 87 sym_drmIoctl(fd, DRM_IOCTL_MODE_DESTROY_DUMB, &darg);
88err: 88err:
@@ -93,7 +93,7 @@ err:
93EAPI Ecore_Drm2_Fb * 93EAPI Ecore_Drm2_Fb *
94ecore_drm2_fb_gbm_create(int fd, int width, int height, int depth, int bpp, unsigned int format, unsigned int handle, unsigned int stride, void *bo) 94ecore_drm2_fb_gbm_create(int fd, int width, int height, int depth, int bpp, unsigned int format, unsigned int handle, unsigned int stride, void *bo)
95{ 95{
96 drm_mode_map_dumb marg; 96 struct drm_mode_map_dumb marg;
97 Ecore_Drm2_Fb *fb; 97 Ecore_Drm2_Fb *fb;
98 int ret; 98 int ret;
99 99
@@ -127,7 +127,7 @@ ecore_drm2_fb_gbm_create(int fd, int width, int height, int depth, int bpp, unsi
127 } 127 }
128 128
129 /* mmap it if we can so screenshots are easy */ 129 /* mmap it if we can so screenshots are easy */
130 memset(&marg, 0, sizeof(drm_mode_map_dumb)); 130 memset(&marg, 0, sizeof(struct drm_mode_map_dumb));
131 marg.handle = fb->handles[0]; 131 marg.handle = fb->handles[0];
132 ret = sym_drmIoctl(fd, DRM_IOCTL_MODE_MAP_DUMB, &marg); 132 ret = sym_drmIoctl(fd, DRM_IOCTL_MODE_MAP_DUMB, &marg);
133 if (!ret) 133 if (!ret)
@@ -155,9 +155,9 @@ _ecore_drm2_fb_destroy(Ecore_Drm2_Fb *fb)
155 155
156 if (!fb->gbm && !fb->dmabuf) 156 if (!fb->gbm && !fb->dmabuf)
157 { 157 {
158 drm_mode_destroy_dumb darg; 158 struct drm_mode_destroy_dumb darg;
159 159
160 memset(&darg, 0, sizeof(drm_mode_destroy_dumb)); 160 memset(&darg, 0, sizeof(struct drm_mode_destroy_dumb));
161 darg.handle = fb->handles[0]; 161 darg.handle = fb->handles[0];
162 sym_drmIoctl(fb->fd, DRM_IOCTL_MODE_DESTROY_DUMB, &darg); 162 sym_drmIoctl(fb->fd, DRM_IOCTL_MODE_DESTROY_DUMB, &darg);
163 } 163 }
@@ -180,7 +180,6 @@ _ecore_drm2_fb_deref(Ecore_Drm2_Fb *fb)
180 _ecore_drm2_fb_destroy(fb); 180 _ecore_drm2_fb_destroy(fb);
181} 181}
182 182
183
184EAPI void 183EAPI void
185ecore_drm2_fb_discard(Ecore_Drm2_Fb *fb) 184ecore_drm2_fb_discard(Ecore_Drm2_Fb *fb)
186{ 185{