fix compilation errors/warnings

This commit is contained in:
Vincent Wei
2020-03-15 22:11:16 +08:00
parent 32f29cc159
commit 6b47d74be7
3 changed files with 14 additions and 12 deletions

View File

@@ -1126,7 +1126,7 @@ static GAL_VideoDevice *DRM_CreateDevice(int devindex)
}
# endif /* not defined _MGSCHEMA_COMPOSITING */
device->RequestHWSurface = NULL; // always be NULL
#endif /* defined _MGRM_PROCESSES */
#endif /* defined _MGRM_PROCESSES */
device->AllocHWSurface = DRM_AllocHWSurface_Accl;
device->FreeHWSurface = DRM_FreeHWSurface_Accl;
@@ -1150,11 +1150,6 @@ static GAL_VideoDevice *DRM_CreateDevice(int devindex)
device->SetVideoMode = DRM_SetVideoMode_Client;
}
if (device->hidden->dbl_buff) {
device->UpdateRects = DRM_UpdateRects;
device->SyncUpdate = DRM_SyncUpdate;
}
# endif /* not defined _MGSCHEMA_COMPOSITING */
device->RequestHWSurface = NULL; // always be NULL
#endif /* defined _MGRM_PROCESSES */
@@ -1162,6 +1157,14 @@ static GAL_VideoDevice *DRM_CreateDevice(int devindex)
device->FreeHWSurface = DRM_FreeDumbSurface;
}
if (device->SetVideoMode == NULL)
device->SetVideoMode = DRM_SetVideoMode;
if (device->hidden->dbl_buff) {
device->UpdateRects = DRM_UpdateRects;
device->SyncUpdate = DRM_SyncUpdate;
}
#if IS_COMPOSITING_SCHEMA
device->AllocSharedHWSurface = DRM_AllocSharedHWSurface;
device->FreeSharedHWSurface = DRM_FreeSharedHWSurface;
@@ -1790,7 +1793,6 @@ static DrmSurfaceBuffer *drm_create_dumb_buffer_from_name(DrmVideoData* vdata,
{
int ret;
struct drm_gem_open oreq;
struct drm_mode_map_dumb mreq;
struct drm_gem_close creq;
DrmSurfaceBuffer *surface_buffer = NULL;
@@ -2049,6 +2051,8 @@ error:
drm_destroy_dumb_buffer (vdata, real_buffer);
}
}
return NULL;
}
static int DRM_AllocDumbSurface (_THIS, GAL_Surface *surface)
@@ -2560,7 +2564,6 @@ static GAL_Surface *DRM_SetVideoMode_Client(_THIS, GAL_Surface *current,
int width, int height, int bpp, Uint32 flags)
{
DrmVideoData* vdata = this->hidden;
DrmSurfaceBuffer* surface_buffer;
REQUEST req;
SHAREDSURFINFO info;

View File

@@ -302,7 +302,7 @@ void GAL_FreeSharedSurfaceData (GAL_Surface *surface)
// the file descriptor may have been closed.
if (surface->shared_header->fd >= 0) {
close (surface->shared_header->fd);
surface->shared_header->fd;
surface->shared_header->fd = -1;
}
munmap (surface->shared_header,
surface->shared_header->pixels_size
@@ -325,7 +325,7 @@ void GAL_FreeSharedSurfaceData (GAL_Surface *surface)
GAL_Surface * GAL_AttachSharedRGBSurface (int fd, size_t map_size,
Uint32 flags, BOOL with_wr)
{
GAL_VideoDevice *video;
GAL_VideoDevice *video = NULL;
GAL_Surface *surface;
void* data_map = MAP_FAILED;
GAL_SharedSurfaceHeader* hdr;
@@ -425,7 +425,7 @@ GAL_Surface * GAL_AttachSharedRGBSurface (int fd, size_t map_size,
return (surface);
error:
if (video && surface->hwdata) {
if (video && surface && surface->hwdata) {
assert (video->DettachSharedHWSurface);
video->DettachSharedHWSurface (video, surface);
}

View File

@@ -778,7 +778,6 @@ extern int __mg_clipboard_op (int cli, int clifd, void* buff, size_t len);
/* get the fake screen surface (wallpaper pattern surface) */
static int get_shared_surface (int cli, int clifd, void* buff, size_t len)
{
const char *name = buff;
SHAREDSURFINFO info;
assert (__gal_fake_screen);