mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-02-06 18:31:57 +08:00
fix compilation errors/warnings
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user