if (intel->gen < 4)
INTEL_FIREVERTICES(intel);
- intel->need_throttle = GL_TRUE;
+ intel->need_throttle = true;
if (intel->batch.used)
intel_batchbuffer_flush(intel);
image->internal_format = GL_RGBA;
image->data_type = GL_UNSIGNED_BYTE;
break;
+ case __DRI_IMAGE_FORMAT_ABGR8888:
+ image->format = MESA_FORMAT_RGBA8888_REV;
+ image->internal_format = GL_RGBA;
+ image->data_type = GL_UNSIGNED_BYTE;
+ break;
default:
free(image);
return NULL;
image->internal_format = GL_RGBA;
image->data_type = GL_UNSIGNED_BYTE;
break;
+ case __DRI_IMAGE_FORMAT_ABGR8888:
+ image->format = MESA_FORMAT_RGBA8888_REV;
+ image->internal_format = GL_RGBA;
+ image->data_type = GL_UNSIGNED_BYTE;
+ break;
default:
free(image);
return NULL;
image->region =
intel_region_alloc(intelScreen, tiling,
- cpp, width, height, GL_TRUE);
+ cpp, width, height, true);
if (image->region == NULL) {
FREE(image);
return NULL;
switch (attrib) {
case __DRI_IMAGE_ATTRIB_STRIDE:
*value = image->region->pitch * image->region->cpp;
- return GL_TRUE;
+ return true;
case __DRI_IMAGE_ATTRIB_HANDLE:
- *value = image->region->buffer->handle;
- return GL_TRUE;
+ *value = image->region->bo->handle;
+ return true;
case __DRI_IMAGE_ATTRIB_NAME:
return intel_region_flink(image->region, (uint32_t *) value);
default:
- return GL_FALSE;
+ return false;
+ }
+}
+
+static __DRIimage *
+intel_dup_image(__DRIimage *orig_image, void *loaderPrivate)
+{
+ __DRIimage *image;
+
+ image = CALLOC(sizeof *image);
+ if (image == NULL)
+ return NULL;
+
+ intel_region_reference(&image->region, orig_image->region);
+ if (image->region == NULL) {
+ FREE(image);
+ return NULL;
}
+
+ image->internal_format = orig_image->internal_format;
+ image->format = orig_image->format;
+ image->data_type = orig_image->data_type;
+ image->data = loaderPrivate;
+
+ return image;
}
static struct __DRIimageExtensionRec intelImageExtension = {
intel_create_image_from_renderbuffer,
intel_destroy_image,
intel_create_image,
- intel_query_image
+ intel_query_image,
+ intel_dup_image
};
static const __DRIextension *intelScreenExtensions[] = {
- &driReadDrawableExtension,
&intelTexBufferExtension.base,
&intelFlushExtension.base,
&intelImageExtension.base,
NULL
};
-static GLboolean
+static bool
intel_get_param(__DRIscreen *psp, int param, int *value)
{
int ret;
if (ret) {
if (ret != -EINVAL)
_mesa_warning(NULL, "drm_i915_getparam: %d", ret);
- return GL_FALSE;
+ return false;
}
- return GL_TRUE;
+ return true;
}
-static GLboolean
+static bool
intel_get_boolean(__DRIscreen *psp, int param)
{
int value = 0;
struct intel_screen *screen = (struct intel_screen*) driScrnPriv->private;
if (isPixmap) {
- return GL_FALSE; /* not implemented */
+ return false; /* not implemented */
}
else {
gl_format rgbFormat;
struct gl_framebuffer *fb = CALLOC_STRUCT(gl_framebuffer);
if (!fb)
- return GL_FALSE;
+ return false;
_mesa_initialize_window_framebuffer(fb, mesaVis);
/* now add any/all software-based renderbuffers we may need */
_mesa_add_soft_renderbuffers(fb,
- GL_FALSE, /* never sw color */
- GL_FALSE, /* never sw depth */
- GL_FALSE, /* never sw stencil */
+ false, /* never sw color */
+ false, /* never sw depth */
+ false, /* never sw stencil */
mesaVis->accumRedBits > 0,
- GL_FALSE, /* never sw alpha */
- GL_FALSE /* never sw aux */ );
+ false, /* never sw alpha */
+ false /* never sw aux */ );
driDrawPriv->driverPrivate = fb;
- return GL_TRUE;
+ return true;
}
}
* init-designated function to register chipids and createcontext
* functions.
*/
-extern GLboolean i830CreateContext(const struct gl_config * mesaVis,
- __DRIcontext * driContextPriv,
- void *sharedContextPrivate);
-
-extern GLboolean i915CreateContext(int api,
- const struct gl_config * mesaVis,
- __DRIcontext * driContextPriv,
- void *sharedContextPrivate);
-extern GLboolean brwCreateContext(int api,
- const struct gl_config * mesaVis,
- __DRIcontext * driContextPriv,
- void *sharedContextPrivate);
+extern bool
+i830CreateContext(const struct gl_config *mesaVis,
+ __DRIcontext *driContextPriv,
+ void *sharedContextPrivate);
+
+extern bool
+i915CreateContext(int api,
+ const struct gl_config *mesaVis,
+ __DRIcontext *driContextPriv,
+ void *sharedContextPrivate);
+extern bool
+brwCreateContext(int api,
+ const struct gl_config *mesaVis,
+ __DRIcontext *driContextPriv,
+ void *sharedContextPrivate);
static GLboolean
intelCreateContext(gl_api api,
sharedContextPrivate);
}
} else {
- intelScreen->no_vbo = GL_TRUE;
+ intelScreen->no_vbo = true;
return i830CreateContext(mesaVis, driContextPriv, sharedContextPrivate);
}
#else
driContextPriv, sharedContextPrivate);
#endif
fprintf(stderr, "Unrecognized deviceID 0x%x\n", intelScreen->deviceID);
- return GL_FALSE;
+ return false;
}
-static GLboolean
+static bool
intel_init_bufmgr(struct intel_screen *intelScreen)
{
__DRIscreen *spriv = intelScreen->driScrnPriv;
if (intelScreen->bufmgr == NULL) {
fprintf(stderr, "[%s:%u] Error initializing buffer manager.\n",
__func__, __LINE__);
- return GL_FALSE;
+ return false;
}
if (!intel_get_param(spriv, I915_PARAM_NUM_FENCES_AVAIL, &num_fences) ||
num_fences == 0) {
fprintf(stderr, "[%s: %u] Kernel 2.6.29 required.\n", __func__, __LINE__);
- return GL_FALSE;
+ return false;
}
drm_intel_bufmgr_gem_enable_fenced_relocs(intelScreen->bufmgr);
intelScreen->relaxed_relocations |=
intel_get_boolean(spriv, I915_PARAM_HAS_RELAXED_DELTA) << 0;
- return GL_TRUE;
+ return true;
}
/**
intelScreen = CALLOC(sizeof *intelScreen);
if (!intelScreen) {
fprintf(stderr, "\nERROR! Allocating private area failed\n");
- return GL_FALSE;
+ return false;
}
/* parse information in __driConfigOptions */
driParseOptionInfo(&intelScreen->optionCache,
/* Determine chipset ID */
if (!intel_get_param(psp, I915_PARAM_CHIPSET_ID,
&intelScreen->deviceID))
- return GL_FALSE;
+ return false;
/* Allow an override of the device ID for the purpose of making the
* driver produce dumps for debugging of new chipset enablement.
psp->api_mask = api_mask;
if (!intel_init_bufmgr(intelScreen))
- return GL_FALSE;
+ return false;
psp->extensions = intelScreenExtensions;
ARRAY_SIZE(back_buffer_modes),
msaa_samples_array,
ARRAY_SIZE(msaa_samples_array),
- GL_FALSE);
+ false);
if (configs == NULL)
configs = new_configs;
else
depth_bits, stencil_bits, 1,
back_buffer_modes + 1, 1,
msaa_samples_array, 1,
- GL_TRUE);
+ true);
if (configs == NULL)
configs = new_configs;
else
tiling = I915_TILING_X;
intelBuffer->region = intel_region_alloc(intelScreen, tiling,
- format / 8, width, height, GL_TRUE);
+ format / 8, width, height, true);
if (intelBuffer->region == NULL) {
FREE(intelBuffer);