Mesa-9.2.2: update

git-svn-id: svn://kolibrios.org@4373 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2013-12-17 12:52:40 +00:00
parent 32fc93ddb1
commit 1041a5895b

View File

@ -43,9 +43,12 @@
#include "egl_dri2.h" #include "egl_dri2.h"
int sna_bitmap_from_handle(bitmap_t *bitmap, uint32_t handle); void* load_library(const char *name);
void sna_set_bo_handle(bitmap_t *bitmap, int handle); void *get_proc_address(void *module, char *proc_name);
int sna_blit_tex(bitmap_t *bitmap, int scale, int dst_x, int dst_y,
int (*blit_bitmap_from_handle)(bitmap_t *bitmap, uint32_t handle);
void (*blit_set_bo_handle)(bitmap_t *bitmap, int handle);
int (*blit_blit_tex)(bitmap_t *bitmap, int scale, int dst_x, int dst_y,
int w, int h, int src_x, int src_y); int w, int h, int src_x, int src_y);
static struct gbm_bo * static struct gbm_bo *
@ -379,7 +382,7 @@ dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
bm.max_height = bo->base.base.height; bm.max_height = bo->base.base.height;
bm.flags = HW_TEX_BLIT; bm.flags = HW_TEX_BLIT;
if( sna_bitmap_from_handle(&bm, bo->base.base.handle.s32)) if( blit_bitmap_from_handle(&bm, bo->base.base.handle.s32))
{ {
printf("sna_bitmap_from_handle failed\n"); printf("sna_bitmap_from_handle failed\n");
} }
@ -391,8 +394,8 @@ dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
// bo->base.base.height, (int)bo->base.base.stride, // bo->base.base.height, (int)bo->base.base.stride,
// bo->base.base.format); // bo->base.base.format);
sna_set_bo_handle(&bm, bo->base.base.handle.s32); blit_set_bo_handle(&bm, bo->base.base.handle.s32);
sna_blit_tex(&bm, 0, 5, 20, bm.width, bm.height, 0, 0); blit_blit_tex(&bm, 0, 5, 20, bm.width, bm.height, 0, 0);
} }
} }
#endif #endif
@ -482,6 +485,8 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
{ {
struct dri2_egl_display *dri2_dpy; struct dri2_egl_display *dri2_dpy;
struct gbm_device *gbm; struct gbm_device *gbm;
void *lib;
int fd = -1; int fd = -1;
int i; int i;
@ -511,6 +516,26 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
return EGL_FALSE; return EGL_FALSE;
} }
lib = load_library("intel-sna.drv");
if(lib)
{
blit_bitmap_from_handle = get_proc_address(lib,"sna_bitmap_from_handle");
blit_set_bo_handle = get_proc_address(lib,"sna_set_bo_handle");
blit_blit_tex = get_proc_address(lib,"sna_blit_tex");
}
else
{
lib = load_library("intel-uxa.drv");
if(lib)
{
blit_bitmap_from_handle = get_proc_address(lib,"uxa_bitmap_from_handle");
blit_set_bo_handle = get_proc_address(lib,"uxa_set_bo_handle");
blit_blit_tex = get_proc_address(lib,"uxa_blit_tex");
}
else return EGL_FALSE;
}
dri2_dpy->fd = fd; dri2_dpy->fd = fd;
dri2_dpy->device_name = strdup("drm device"); //dri2_get_device_name_for_fd(dri2_dpy->fd); dri2_dpy->device_name = strdup("drm device"); //dri2_get_device_name_for_fd(dri2_dpy->fd);
dri2_dpy->driver_name = dri2_dpy->gbm_dri->base.driver_name; dri2_dpy->driver_name = dri2_dpy->gbm_dri->base.driver_name;