From a433755ec5c48088a0d8a340851a1a8be9e58897 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Mon, 30 May 2011 09:55:14 +0200 Subject: targets/egl: Support driver name lookup using pci lists Make use of this in drm and wayland st/egl backends. Reviewed-by: Alex Deucher --- src/gallium/state_trackers/egl/drm/native_drm.c | 33 ++---------------- .../state_trackers/egl/wayland/native_drm.c | 40 +--------------------- 2 files changed, 3 insertions(+), 70 deletions(-) (limited to 'src/gallium/state_trackers') diff --git a/src/gallium/state_trackers/egl/drm/native_drm.c b/src/gallium/state_trackers/egl/drm/native_drm.c index c89a6d4767e..725fe28e4e2 100644 --- a/src/gallium/state_trackers/egl/drm/native_drm.c +++ b/src/gallium/state_trackers/egl/drm/native_drm.c @@ -33,10 +33,6 @@ #include "native_drm.h" -/* see get_drm_screen_name */ -#include -#include "radeon/drm/radeon_drm_public.h" - #ifdef HAVE_LIBUDEV #include #endif @@ -140,27 +136,6 @@ drm_display_destroy(struct native_display *ndpy) FREE(drmdpy); } -static const char * -get_drm_screen_name(int fd, drmVersionPtr version) -{ - const char *name = version->name; - - if (name && !strcmp(name, "radeon")) { - int chip_id; - struct drm_radeon_info info; - - memset(&info, 0, sizeof(info)); - info.request = RADEON_INFO_DEVICE_ID; - info.value = pointer_to_intptr(&chip_id); - if (drmCommandWriteRead(fd, DRM_RADEON_INFO, &info, sizeof(info)) != 0) - return NULL; - - name = is_r3xx(chip_id) ? "r300" : "r600"; - } - - return name; -} - /** * Initialize KMS and pipe screen. */ @@ -169,7 +144,6 @@ drm_display_init_screen(struct native_display *ndpy) { struct drm_display *drmdpy = drm_display(ndpy); drmVersionPtr version; - const char *name; version = drmGetVersion(drmdpy->fd); if (!version) { @@ -177,11 +151,8 @@ drm_display_init_screen(struct native_display *ndpy) return FALSE; } - name = get_drm_screen_name(drmdpy->fd, version); - if (name) { - drmdpy->base.screen = - drmdpy->event_handler->new_drm_screen(&drmdpy->base, name, drmdpy->fd); - } + drmdpy->base.screen = + drmdpy->event_handler->new_drm_screen(&drmdpy->base, NULL, drmdpy->fd); drmFreeVersion(version); if (!drmdpy->base.screen) { diff --git a/src/gallium/state_trackers/egl/wayland/native_drm.c b/src/gallium/state_trackers/egl/wayland/native_drm.c index f643c7cbbba..15383e89301 100644 --- a/src/gallium/state_trackers/egl/wayland/native_drm.c +++ b/src/gallium/state_trackers/egl/wayland/native_drm.c @@ -37,10 +37,6 @@ #include "native_wayland.h" -/* see get_drm_screen_name */ -#include -#include "radeon/drm/radeon_drm_public.h" - #include #include "wayland-drm-client-protocol.h" #include "wayland-egl-priv.h" @@ -143,27 +139,6 @@ wayland_create_drm_buffer(struct wayland_display *display, width, height, wsh.stride, visual); } -static const char * -get_drm_screen_name(int fd, drmVersionPtr version) -{ - const char *name = version->name; - - if (name && !strcmp(name, "radeon")) { - int chip_id; - struct drm_radeon_info info; - - memset(&info, 0, sizeof(info)); - info.request = RADEON_INFO_DEVICE_ID; - info.value = pointer_to_intptr(&chip_id); - if (drmCommandWriteRead(fd, DRM_RADEON_INFO, &info, sizeof(info)) != 0) - return NULL; - - name = is_r3xx(chip_id) ? "r300" : "r600"; - } - - return name; -} - static void drm_handle_device(void *data, struct wl_drm *drm, const char *device) { @@ -202,8 +177,6 @@ static boolean wayland_drm_display_init_screen(struct native_display *ndpy) { struct wayland_drm_display *drmdpy = wayland_drm_display(ndpy); - drmVersionPtr version; - const char *driver_name; uint32_t id; id = wl_display_get_global(drmdpy->base.dpy, "wl_drm", 1); @@ -226,20 +199,9 @@ wayland_drm_display_init_screen(struct native_display *ndpy) if (!drmdpy->authenticated) return FALSE; - version = drmGetVersion(drmdpy->fd); - if (!version) { - _eglLog(_EGL_WARNING, "invalid fd %d", drmdpy->fd); - return FALSE; - } - - /* FIXME: share this with native_drm or egl_dri2 */ - driver_name = get_drm_screen_name(drmdpy->fd, version); - drmdpy->base.base.screen = drmdpy->event_handler->new_drm_screen(&drmdpy->base.base, - driver_name, drmdpy->fd); - drmFreeVersion(version); - + NULL, drmdpy->fd); if (!drmdpy->base.base.screen) { _eglLog(_EGL_WARNING, "failed to create DRM screen"); return FALSE; -- cgit v1.2.3 From 6b492d09767531915aa631bec470af1cf4653a6c Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Thu, 9 Jun 2011 00:23:16 +0800 Subject: st/egl: set EGL_ALPHA_MASK_SIZE --- src/gallium/state_trackers/egl/common/egl_g3d.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/gallium/state_trackers') diff --git a/src/gallium/state_trackers/egl/common/egl_g3d.c b/src/gallium/state_trackers/egl/common/egl_g3d.c index 4bd865638a3..29dbbefbf48 100644 --- a/src/gallium/state_trackers/egl/common/egl_g3d.c +++ b/src/gallium/state_trackers/egl/common/egl_g3d.c @@ -259,6 +259,10 @@ init_config_attributes(_EGLConfig *conf, const struct native_config *nconf, conf->DepthSize = depth_stencil[0]; conf->StencilSize = depth_stencil[1]; + /* st/vega will allocate the mask on demand */ + if (api_mask & EGL_OPENVG_BIT) + conf->AlphaMaskSize = 8; + conf->SurfaceType = surface_type; conf->NativeRenderable = EGL_TRUE; -- cgit v1.2.3 From 9f865646f1fb05cec72dcb1d7411670d38b0a9b4 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 8 Jun 2011 14:20:49 +0100 Subject: glx/xlib: Handle glXCreateContextAttribsARB in glXGetProcAddress. --- src/gallium/state_trackers/glx/xlib/glx_getproc.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/gallium/state_trackers') diff --git a/src/gallium/state_trackers/glx/xlib/glx_getproc.c b/src/gallium/state_trackers/glx/xlib/glx_getproc.c index 26fcae78ece..bc29c31ffa7 100644 --- a/src/gallium/state_trackers/glx/xlib/glx_getproc.c +++ b/src/gallium/state_trackers/glx/xlib/glx_getproc.c @@ -168,6 +168,9 @@ static struct name_address_pair GLX_functions[] = { /*** GLX_ARB_get_proc_address ***/ { "glXGetProcAddressARB", (__GLXextFuncPtr) glXGetProcAddressARB }, + /*** GLX_ARB_create_context ***/ + { "glXCreateContextAttribsARB", (__GLXextFuncPtr) glXCreateContextAttribsARB }, + /*** GLX_EXT_texture_from_pixmap ***/ { "glXBindTexImageEXT", (__GLXextFuncPtr) glXBindTexImageEXT }, { "glXReleaseTexImageEXT", (__GLXextFuncPtr) glXReleaseTexImageEXT }, -- cgit v1.2.3