diff options
author | marha <marha@users.sourceforge.net> | 2014-08-22 21:57:21 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2014-08-22 21:57:21 +0200 |
commit | 112d89481850102f28b6e7ff4f40b65c41e11f6c (patch) | |
tree | 9e22963aeda3f588d4aa3aa270fdba74922028c7 /mesalib/src/mesa/drivers/dri | |
parent | bcb354180f20f0c410a77bd32cbf2c1e799632d5 (diff) | |
parent | 6c0c95d6045d2d2b4e6a3a2f11457850031c57bc (diff) | |
download | vcxsrv-112d89481850102f28b6e7ff4f40b65c41e11f6c.tar.gz vcxsrv-112d89481850102f28b6e7ff4f40b65c41e11f6c.tar.bz2 vcxsrv-112d89481850102f28b6e7ff4f40b65c41e11f6c.zip |
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/mesa/drivers/dri')
-rw-r--r-- | mesalib/src/mesa/drivers/dri/Android.mk | 6 | ||||
-rw-r--r-- | mesalib/src/mesa/drivers/dri/common/Android.mk | 4 | ||||
-rw-r--r-- | mesalib/src/mesa/drivers/dri/common/utils.c | 4 | ||||
-rw-r--r-- | mesalib/src/mesa/drivers/dri/swrast/swrast.c | 73 |
4 files changed, 80 insertions, 7 deletions
diff --git a/mesalib/src/mesa/drivers/dri/Android.mk b/mesalib/src/mesa/drivers/dri/Android.mk index e0cf51c58..935722c53 100644 --- a/mesalib/src/mesa/drivers/dri/Android.mk +++ b/mesalib/src/mesa/drivers/dri/Android.mk @@ -35,15 +35,15 @@ MESA_DRI_CFLAGS := \ -DHAVE_ANDROID_PLATFORM MESA_DRI_C_INCLUDES := \ + $(MESA_TOP)/src \ $(call intermediates-dir-for,STATIC_LIBRARIES,libmesa_dri_common) \ $(addprefix $(MESA_TOP)/, $(mesa_dri_common_INCLUDES)) \ - $(DRM_TOP) \ - $(DRM_TOP)/include/drm \ + $(TARGET_OUT_HEADERS)/libdrm \ external/expat/lib MESA_DRI_WHOLE_STATIC_LIBRARIES := \ libmesa_glsl \ - libmegadriver_stub \ + libmesa_megadriver_stub \ libmesa_dri_common \ libmesa_dricore diff --git a/mesalib/src/mesa/drivers/dri/common/Android.mk b/mesalib/src/mesa/drivers/dri/common/Android.mk index a172a0bc6..b95feb679 100644 --- a/mesalib/src/mesa/drivers/dri/common/Android.mk +++ b/mesalib/src/mesa/drivers/dri/common/Android.mk @@ -88,13 +88,13 @@ include $(MESA_COMMON_MK) include $(BUILD_STATIC_LIBRARY) # -# Build libmegadriver_stub +# Build libmesa_megadriver_stub # include $(CLEAR_VARS) include $(LOCAL_PATH)/Makefile.sources -LOCAL_MODULE := libmegadriver_stub +LOCAL_MODULE := libmesa_megadriver_stub LOCAL_MODULE_CLASS := STATIC_LIBRARIES LOCAL_C_INCLUDES := \ $(MESA_DRI_C_INCLUDES) diff --git a/mesalib/src/mesa/drivers/dri/common/utils.c b/mesalib/src/mesa/drivers/dri/common/utils.c index eee77ec69..e0b3db8cf 100644 --- a/mesalib/src/mesa/drivers/dri/common/utils.c +++ b/mesalib/src/mesa/drivers/dri/common/utils.c @@ -519,6 +519,10 @@ driQueryRendererIntegerCommon(__DRIscreen *psp, int param, unsigned int *value) value[2] = v[2]; return 0; } + case __DRI2_RENDERER_PREFERRED_PROFILE: + value[0] = (psp->max_gl_core_version != 0) + ? (1U << __DRI_API_OPENGL_CORE) : (1U << __DRI_API_OPENGL); + return 0; case __DRI2_RENDERER_OPENGL_CORE_PROFILE_VERSION: value[0] = psp->max_gl_core_version / 10; value[1] = psp->max_gl_core_version % 10; diff --git a/mesalib/src/mesa/drivers/dri/swrast/swrast.c b/mesalib/src/mesa/drivers/dri/swrast/swrast.c index b9a5d71ef..738bee250 100644 --- a/mesalib/src/mesa/drivers/dri/swrast/swrast.c +++ b/mesalib/src/mesa/drivers/dri/swrast/swrast.c @@ -66,6 +66,9 @@ PUBLIC const __DRIextension **__driDriverGetExtensions_swrast(void); +const char const *swrast_vendor_string = "Mesa Project"; +const char const *swrast_renderer_string = "Software Rasterizer"; + /** * Screen and config-related functions */ @@ -122,8 +125,74 @@ static const __DRItexBufferExtension swrastTexBufferExtension = { .releaseTexBuffer = NULL, }; + +static int +swrast_query_renderer_integer(__DRIscreen *psp, int param, + unsigned int *value) +{ + switch (param) { + case __DRI2_RENDERER_VENDOR_ID: + case __DRI2_RENDERER_DEVICE_ID: + /* Return 0xffffffff for both vendor and device id */ + value[0] = 0xffffffff; + return 0; + case __DRI2_RENDERER_ACCELERATED: + value[0] = 0; + return 0; + case __DRI2_RENDERER_VIDEO_MEMORY: { + /* XXX: Do we want to return the full amount of system memory ? */ + const long system_memory_pages = sysconf(_SC_PHYS_PAGES); + const long system_page_size = sysconf(_SC_PAGE_SIZE); + + if (system_memory_pages <= 0 || system_page_size <= 0) + return -1; + + const uint64_t system_memory_bytes = (uint64_t) system_memory_pages + * (uint64_t) system_page_size; + + const unsigned system_memory_megabytes = + (unsigned) (system_memory_bytes / (1024 * 1024)); + + value[0] = system_memory_megabytes; + return 0; + } + case __DRI2_RENDERER_UNIFIED_MEMORY_ARCHITECTURE: + /** + * XXX: Perhaps we should return 1 ? + * See issue #7 from the spec, currently UNRESOLVED. + */ + value[0] = 0; + return 0; + default: + return driQueryRendererIntegerCommon(psp, param, value); + } +} + +static int +swrast_query_renderer_string(__DRIscreen *psp, int param, const char **value) +{ + switch (param) { + case __DRI2_RENDERER_VENDOR_ID: + value[0] = swrast_vendor_string; + return 0; + case __DRI2_RENDERER_DEVICE_ID: + value[0] = swrast_renderer_string; + return 0; + default: + return -1; + } +} + +static const __DRI2rendererQueryExtension swrast_query_renderer_extension = { + .base = { __DRI2_RENDERER_QUERY, 1 }, + + .queryInteger = swrast_query_renderer_integer, + .queryString = swrast_query_renderer_string +}; + static const __DRIextension *dri_screen_extensions[] = { &swrastTexBufferExtension.base, + &swrast_query_renderer_extension.base, NULL }; @@ -604,9 +673,9 @@ get_string(struct gl_context *ctx, GLenum pname) (void) ctx; switch (pname) { case GL_VENDOR: - return (const GLubyte *) "Mesa Project"; + return (const GLubyte *) swrast_vendor_string; case GL_RENDERER: - return (const GLubyte *) "Software Rasterizer"; + return (const GLubyte *) swrast_renderer_string; default: return NULL; } |