Skip to content

Commit

Permalink
drm: Initialize offset with psurface.
Browse files Browse the repository at this point in the history
Also memset() the psurface.
This used to let uninitialized values being printed through DRM_DEBUG.

Signed-off-by: Eric Chanudet <[email protected]>
(cherry picked from commit 694546b)
Signed-off-by: Eric Chanudet <[email protected]>
  • Loading branch information
Eric Chanudet committed Jul 25, 2019
1 parent e74cb66 commit 46810bd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/drm/src/drm-plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ INTERNAL surfman_psurface_t drmp_get_psurface_from_surface(surfman_plugin_t *plu
(void) plugin;
struct drm_surface *s;

s = malloc(sizeof (*s));
s = calloc(1, sizeof (*s));
if (!s) {
DRM_ERR("Could not allocate memory (%s).", strerror(errno));
return NULL;
Expand All @@ -292,6 +292,7 @@ INTERNAL surfman_psurface_t drmp_get_psurface_from_surface(surfman_plugin_t *plu
}
s->fb.pitch = surfman_surface->stride;
s->fb.size = surfman_surface->page_count * XC_PAGE_SIZE;
s->fb.offset = surfman_surface->offset;
s->fb.map = surface_map(surfman_surface);
s->domid = surfman_surface->pages_domid;

Expand Down

0 comments on commit 46810bd

Please sign in to comment.