diff options
author | Chris Michael <cp.michael@samsung.com> | 2015-04-07 10:49:45 -0400 |
---|---|---|
committer | Stefan Schmidt <s.schmidt@samsung.com> | 2015-04-09 17:40:42 +0200 |
commit | 318f2c435a8013e75c0e9804bfea6fbb223f07f4 (patch) | |
tree | df7b940887aeafe167328ca75527fab26f98d56b /src/lib/ecore_drm/ecore_drm_fb.c | |
parent | e72e1e1751b711cb041ea91cd611877f8b1f040b (diff) |
ecore-drm: Add width & height to Ecore_Drm_Fb structure
Summary: This adds a w & h field to the Ecore_Drm_Fb structure so it
can be used from within the Evas engine
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/ecore_drm/ecore_drm_fb.c')
-rw-r--r-- | src/lib/ecore_drm/ecore_drm_fb.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/lib/ecore_drm/ecore_drm_fb.c b/src/lib/ecore_drm/ecore_drm_fb.c index 67641c9113..2a48f25685 100644 --- a/src/lib/ecore_drm/ecore_drm_fb.c +++ b/src/lib/ecore_drm/ecore_drm_fb.c | |||
@@ -15,7 +15,7 @@ | |||
15 | /* TODO: DOXY !! */ | 15 | /* TODO: DOXY !! */ |
16 | 16 | ||
17 | static Eina_Bool | 17 | static Eina_Bool |
18 | _ecore_drm_fb_create2(int fd, int w, int h, Ecore_Drm_Fb *fb) | 18 | _ecore_drm_fb_create2(int fd, Ecore_Drm_Fb *fb) |
19 | { | 19 | { |
20 | struct drm_mode_fb_cmd2 cmd; | 20 | struct drm_mode_fb_cmd2 cmd; |
21 | uint32_t hdls[4], pitches[4], offsets[4], fmt; | 21 | uint32_t hdls[4], pitches[4], offsets[4], fmt; |
@@ -31,8 +31,8 @@ _ecore_drm_fb_create2(int fd, int w, int h, Ecore_Drm_Fb *fb) | |||
31 | 31 | ||
32 | memset(&cmd, 0, sizeof(struct drm_mode_fb_cmd2)); | 32 | memset(&cmd, 0, sizeof(struct drm_mode_fb_cmd2)); |
33 | cmd.fb_id = 0; | 33 | cmd.fb_id = 0; |
34 | cmd.width = w; | 34 | cmd.width = fb->w; |
35 | cmd.height = h; | 35 | cmd.height = fb->h; |
36 | cmd.pixel_format = fmt; | 36 | cmd.pixel_format = fmt; |
37 | cmd.flags = 0; | 37 | cmd.flags = 0; |
38 | memcpy(cmd.handles, hdls, 4 * sizeof(hdls[0])); | 38 | memcpy(cmd.handles, hdls, 4 * sizeof(hdls[0])); |
@@ -77,11 +77,13 @@ ecore_drm_fb_create(Ecore_Drm_Device *dev, int width, int height) | |||
77 | fb->stride = carg.pitch; | 77 | fb->stride = carg.pitch; |
78 | fb->size = carg.size; | 78 | fb->size = carg.size; |
79 | fb->fd = dev->drm.fd; | 79 | fb->fd = dev->drm.fd; |
80 | fb->w = width; | ||
81 | fb->h = height; | ||
80 | 82 | ||
81 | if (!_ecore_drm_fb_create2(dev->drm.fd, width, height, fb)) | 83 | if (!_ecore_drm_fb_create2(dev->drm.fd, fb)) |
82 | { | 84 | { |
83 | WRN("Could not add framebuffer2: %m"); | 85 | WRN("Could not add framebuffer2: %m"); |
84 | if (drmModeAddFB(dev->drm.fd, width, height, 24, 32, | 86 | if (drmModeAddFB(dev->drm.fd, fb->w, fb->h, 24, 32, |
85 | fb->stride, fb->hdl, &fb->id)) | 87 | fb->stride, fb->hdl, &fb->id)) |
86 | { | 88 | { |
87 | ERR("Could not add framebuffer: %m"); | 89 | ERR("Could not add framebuffer: %m"); |