summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/intel
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/intel')
-rw-r--r--src/mesa/drivers/dri/intel/intel_context.c7
-rw-r--r--src/mesa/drivers/dri/intel/intel_context.h2
-rw-r--r--src/mesa/drivers/dri/intel/intel_regions.c5
-rw-r--r--src/mesa/drivers/dri/intel/intel_regions.h3
-rw-r--r--src/mesa/drivers/dri/intel/intel_screen.c73
-rw-r--r--src/mesa/drivers/dri/intel/intel_screen.h42
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_image.c8
7 files changed, 52 insertions, 88 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c
index 0adee6131e..e9315a50fe 100644
--- a/src/mesa/drivers/dri/intel/intel_context.c
+++ b/src/mesa/drivers/dri/intel/intel_context.c
@@ -581,7 +581,7 @@ intelInitContext(struct intel_context *intel,
GLcontext *ctx = &intel->ctx;
GLcontext *shareCtx = (GLcontext *) sharedContextPrivate;
__DRIscreen *sPriv = driContextPriv->driScreenPriv;
- intelScreenPrivate *intelScreen = (intelScreenPrivate *) sPriv->private;
+ struct intel_screen *intelScreen = sPriv->private;
int bo_reuse_mode;
if (!_mesa_initialize_context(&intel->ctx, mesaVis, shareCtx,
@@ -718,11 +718,6 @@ intelInitContext(struct intel_context *intel,
intel->RenderIndex = ~0;
- if (intel->gen >= 4 && !intel->intelScreen->irq_active) {
- _mesa_printf("IRQs not active. Exiting\n");
- exit(1);
- }
-
intelInitExtensions(ctx);
INTEL_DEBUG = driParseDebugString(getenv("INTEL_DEBUG"), debug_control);
diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h
index 36abef470a..0f0a194b3f 100644
--- a/src/mesa/drivers/dri/intel/intel_context.h
+++ b/src/mesa/drivers/dri/intel/intel_context.h
@@ -246,7 +246,7 @@ struct intel_context
__DRIdrawable *driDrawable;
__DRIdrawable *driReadDrawable;
__DRIscreen *driScreen;
- intelScreenPrivate *intelScreen;
+ struct intel_screen *intelScreen;
/**
* Configuration cache
diff --git a/src/mesa/drivers/dri/intel/intel_regions.c b/src/mesa/drivers/dri/intel/intel_regions.c
index 301c3df17c..e2859e44f9 100644
--- a/src/mesa/drivers/dri/intel/intel_regions.c
+++ b/src/mesa/drivers/dri/intel/intel_regions.c
@@ -287,11 +287,6 @@ intel_region_release(struct intel_region **region_handle)
region->pbo = NULL;
dri_bo_unreference(region->buffer);
- if (region->classic_map != NULL) {
- drmUnmap(region->classic_map,
- region->pitch * region->cpp * region->height);
- }
-
free(region);
}
*region_handle = NULL;
diff --git a/src/mesa/drivers/dri/intel/intel_regions.h b/src/mesa/drivers/dri/intel/intel_regions.h
index 535fcd7be0..860ae11bd2 100644
--- a/src/mesa/drivers/dri/intel/intel_regions.h
+++ b/src/mesa/drivers/dri/intel/intel_regions.h
@@ -52,7 +52,7 @@ struct intel_buffer_object;
*/
struct intel_region
{
- dri_bo *buffer; /**< buffer manager's buffer */
+ drm_intel_bo *buffer; /**< buffer manager's buffer */
GLuint refcount; /**< Reference count for region */
GLuint cpp; /**< bytes per pixel */
GLuint width; /**< in pixels */
@@ -66,7 +66,6 @@ struct intel_region
uint32_t tiling; /**< Which tiling mode the region is in */
uint32_t bit_6_swizzle; /**< GEM flag for address swizzling requirement */
- drmAddress classic_map; /**< drmMap of the region when not in GEM mode */
struct intel_buffer_object *pbo; /* zero-copy uploads */
};
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
index c9ef1647a3..6dc20d0fef 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -169,7 +169,7 @@ intel_get_param(__DRIscreen *psp, int param, int *value)
static void
intelDestroyScreen(__DRIscreen * sPriv)
{
- intelScreenPrivate *intelScreen = (intelScreenPrivate *) sPriv->private;
+ struct intel_screen *intelScreen = sPriv->private;
dri_bufmgr_destroy(intelScreen->bufmgr);
driDestroyOptionInfo(&intelScreen->optionCache);
@@ -283,7 +283,7 @@ intelCreateContext(const __GLcontextModes * mesaVis,
void *sharedContextPrivate)
{
__DRIscreen *sPriv = driContextPriv->driScreenPriv;
- intelScreenPrivate *intelScreen = (intelScreenPrivate *) sPriv->private;
+ struct intel_screen *intelScreen = sPriv->private;
#ifdef I915
if (IS_9XX(intelScreen->deviceID)) {
@@ -304,7 +304,7 @@ intelCreateContext(const __GLcontextModes * mesaVis,
}
static GLboolean
-intel_init_bufmgr(intelScreenPrivate *intelScreen)
+intel_init_bufmgr(struct intel_screen *intelScreen)
{
__DRIscreen *spriv = intelScreen->driScrnPriv;
int num_fences = 0;
@@ -336,20 +336,19 @@ intel_init_bufmgr(intelScreenPrivate *intelScreen)
static const
__DRIconfig **intelInitScreen2(__DRIscreen *psp)
{
- intelScreenPrivate *intelScreen;
+ struct intel_screen *intelScreen;
GLenum fb_format[3];
GLenum fb_type[3];
static const GLenum back_buffer_modes[] = {
- GLX_NONE, GLX_SWAP_UNDEFINED_OML,
- GLX_SWAP_EXCHANGE_OML, GLX_SWAP_COPY_OML
+ GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML
};
uint8_t depth_bits[4], stencil_bits[4], msaa_samples_array[1];
int color;
__DRIconfig **configs = NULL;
/* Allocate the private area */
- intelScreen = (intelScreenPrivate *) CALLOC(sizeof(intelScreenPrivate));
+ intelScreen = CALLOC(sizeof *intelScreen);
if (!intelScreen) {
fprintf(stderr, "\nERROR! Allocating private area failed\n");
return GL_FALSE;
@@ -361,8 +360,6 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp)
intelScreen->driScrnPriv = psp;
psp->private = (void *) intelScreen;
- intelScreen->drmMinor = psp->drm_version.minor;
-
/* Determine chipset ID */
if (!intel_get_param(psp, I915_PARAM_CHIPSET_ID,
&intelScreen->deviceID))
@@ -371,18 +368,8 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp)
if (!intel_init_bufmgr(intelScreen))
return GL_FALSE;
- intelScreen->irq_active = 1;
psp->extensions = intelScreenExtensions;
- depth_bits[0] = 0;
- stencil_bits[0] = 0;
- depth_bits[1] = 16;
- stencil_bits[1] = 0;
- depth_bits[2] = 24;
- stencil_bits[2] = 0;
- depth_bits[3] = 24;
- stencil_bits[3] = 8;
-
msaa_samples_array[0] = 0;
fb_format[0] = GL_RGB;
@@ -397,27 +384,27 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp)
depth_bits[0] = 0;
stencil_bits[0] = 0;
+ /* Generate a rich set of useful configs that do not include an
+ * accumulation buffer.
+ */
for (color = 0; color < ARRAY_SIZE(fb_format); color++) {
__DRIconfig **new_configs;
int depth_factor;
- /* With DRI2 right now, GetBuffers always returns a depth/stencil buffer
- * with the same cpp as the drawable. So we can't support depth cpp !=
- * color cpp currently.
+ /* Starting with DRI2 protocol version 1.1 we can request a depth/stencil
+ * buffer that has a diffferent number of bits per pixel than the color
+ * buffer. This isn't yet supported here.
*/
if (fb_type[color] == GL_UNSIGNED_SHORT_5_6_5) {
depth_bits[1] = 16;
stencil_bits[1] = 0;
-
- depth_factor = 2;
} else {
depth_bits[1] = 24;
- stencil_bits[1] = 0;
- depth_bits[2] = 24;
- stencil_bits[2] = 8;
-
- depth_factor = 3;
+ stencil_bits[1] = 8;
}
+
+ depth_factor = 2;
+
new_configs = driCreateConfigs(fb_format[color], fb_type[color],
depth_bits,
stencil_bits,
@@ -425,7 +412,33 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp)
back_buffer_modes,
ARRAY_SIZE(back_buffer_modes),
msaa_samples_array,
- ARRAY_SIZE(msaa_samples_array));
+ ARRAY_SIZE(msaa_samples_array),
+ GL_FALSE);
+ if (configs == NULL)
+ configs = new_configs;
+ else
+ configs = driConcatConfigs(configs, new_configs);
+ }
+
+ /* Generate the minimum possible set of configs that include an
+ * accumulation buffer.
+ */
+ for (color = 0; color < ARRAY_SIZE(fb_format); color++) {
+ __DRIconfig **new_configs;
+
+ if (fb_type[color] == GL_UNSIGNED_SHORT_5_6_5) {
+ depth_bits[0] = 16;
+ stencil_bits[0] = 0;
+ } else {
+ depth_bits[0] = 24;
+ stencil_bits[0] = 8;
+ }
+
+ new_configs = driCreateConfigs(fb_format[color], fb_type[color],
+ depth_bits, stencil_bits, 1,
+ back_buffer_modes + 1, 1,
+ msaa_samples_array, 1,
+ GL_TRUE);
if (configs == NULL)
configs = new_configs;
else
diff --git a/src/mesa/drivers/dri/intel/intel_screen.h b/src/mesa/drivers/dri/intel/intel_screen.h
index e87e306d86..c31b836552 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.h
+++ b/src/mesa/drivers/dri/intel/intel_screen.h
@@ -34,46 +34,14 @@
#include "i915_drm.h"
#include "xmlconfig.h"
-/* XXX: change name or eliminate to avoid conflict with "struct
- * intel_region"!!!
- */
-typedef struct
+struct intel_screen
{
- drm_handle_t handle;
- drmSize size; /* region size in bytes */
- char *map; /* memory map */
- int offset; /* from start of video mem, in bytes */
- unsigned int bo_handle; /* buffer object id if available, or -1 */
- /**
- * Flags if the region is tiled.
- *
- * Not included is Y versus X tiling.
- */
- GLboolean tiled;
-} intelRegion;
-
-typedef struct
-{
- intelRegion front;
- intelRegion back;
- intelRegion depth;
- intelRegion tex;
-
int deviceID;
- int width;
- int height;
- int pitch; /* common row stride, in pixels */
int logTextureGranularity;
__DRIscreen *driScrnPriv;
- volatile drm_i915_sarea_t *sarea;
-
- int drmMinor;
-
- int irq_active;
-
GLboolean no_hw;
GLboolean no_vbo;
@@ -84,14 +52,10 @@ typedef struct
* Configuration cache with default values for all contexts
*/
driOptionCache optionCache;
-} intelScreenPrivate;
-
-
+};
extern GLboolean intelMapScreenRegions(__DRIscreen * sPriv);
-extern void intelUnmapScreenRegions(intelScreenPrivate * intelScreen);
-
extern void intelDestroyContext(__DRIcontext * driContextPriv);
extern GLboolean intelUnbindContext(__DRIcontext * driContextPriv);
@@ -101,6 +65,4 @@ intelMakeCurrent(__DRIcontext * driContextPriv,
__DRIdrawable * driDrawPriv,
__DRIdrawable * driReadPriv);
-extern struct intel_context *intelScreenContext(intelScreenPrivate *intelScreen);
-
#endif
diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c
index 6402141170..d63292edd3 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_image.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_image.c
@@ -728,7 +728,7 @@ intelSetTexOffset(__DRIcontext *pDRICtx, GLint texname,
void
intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
- GLint glx_texture_format,
+ GLint texture_format,
__DRIdrawable *dPriv)
{
struct gl_framebuffer *fb = dPriv->driverPrivate;
@@ -758,7 +758,7 @@ intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
if (rb->region == NULL)
return;
- if (glx_texture_format == GLX_TEXTURE_FORMAT_RGB_EXT)
+ if (texture_format == __DRI_TEXTURE_FORMAT_RGB)
internalFormat = GL_RGB;
else
internalFormat = GL_RGBA;
@@ -788,7 +788,7 @@ intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
intelImage->face = target_to_face(target);
intelImage->level = level;
- if (glx_texture_format == GLX_TEXTURE_FORMAT_RGB_EXT)
+ if (texture_format == __DRI_TEXTURE_FORMAT_RGB)
texImage->TexFormat = MESA_FORMAT_XRGB8888;
else
texImage->TexFormat = MESA_FORMAT_ARGB8888;
@@ -808,7 +808,7 @@ intelSetTexBuffer(__DRIcontext *pDRICtx, GLint target, __DRIdrawable *dPriv)
/* The old interface didn't have the format argument, so copy our
* implementation's behavior at the time.
*/
- intelSetTexBuffer2(pDRICtx, target, GLX_TEXTURE_FORMAT_RGBA_EXT, dPriv);
+ intelSetTexBuffer2(pDRICtx, target, __DRI_TEXTURE_FORMAT_RGBA, dPriv);
}