When hwcomposer is available, framebuffer_close() will be called.
Thus the allocated struct drm_framebuffer is just freed. However,
the gralloc still holds a pointer referring to the freed struct
drm_framebuffer. As a result, the following errors are repeated:
01-11 00:28:47.088 1103 1103 E drm-fb : Failed to get handle from prime fd: 9
01-11 00:28:48.062 1103 1103 E drm-fb : Failed to get handle from prime fd: 9
This patch fixes it by setting the pointer to NULL.
uint32_t current_fb, next_fb;
drmEventContext evctx;
+ struct drm_framebuffer **fb_out;
};
static drmModeConnectorPtr fb0_find_connector(int fd, drmModeResPtr res)
static int fb0_close(struct hw_device_t *dev)
{
+ struct drm_framebuffer *fb = (struct drm_framebuffer *) dev;
+ *fb->fb_out = NULL;
+
free(dev);
return 0;
}
fb->device.post = fb0_post;
fb->device.compositionComplete = fb0_composition_complete;
fb->device.enableScreen = fb0_enable_screen;
+ fb->fb_out = fb_out;
*fb_out = fb;
*dev = &fb->device.common;