#ifndef DRI_INTERFACE_H
#define DRI_INTERFACE_H
+#include <stdbool.h>
#include <stdint.h>
/**
*
* \since 15
*/
- unsigned char (*queryDmaBufFormats)(__DRIscreen *screen, int max,
- int *formats, int *count);
+ bool (*queryDmaBufFormats)(__DRIscreen *screen, int max, int *formats,
+ int *count);
/*
* dmabuf format modifier query for a given format to support
*
* \since 15
*/
- unsigned char (*queryDmaBufModifiers)(__DRIscreen *screen, int fourcc,
- int max, uint64_t *modifiers,
- unsigned int *external_only,
- int *count);
+ bool (*queryDmaBufModifiers)(__DRIscreen *screen, int fourcc, int max,
+ uint64_t *modifiers,
+ unsigned int *external_only, int *count);
/**
* dmabuf format modifier attribute query for a given format and modifier.
*
* \since 16
*/
- unsigned char (*queryDmaBufFormatModifierAttribs)(__DRIscreen *screen,
- uint32_t fourcc,
- uint64_t modifier,
- int attrib,
- uint64_t *value);
+ bool (*queryDmaBufFormatModifierAttribs)(__DRIscreen *screen,
+ uint32_t fourcc, uint64_t modifier,
+ int attrib, uint64_t *value);
/**
* Create a DRI image from the given renderbuffer.
unsigned *count)
{
const __DRIdri2LoaderExtension *loader = drawable->screen->dri2.loader;
- boolean with_format;
+ bool with_format;
__DRIbuffer *buffers;
int num_buffers;
unsigned attachments[__DRI_BUFFER_COUNT];
{
struct dri_screen *screen = drawable->screen;
struct pipe_resource templ;
- boolean alloc_depthstencil = FALSE;
+ bool alloc_depthstencil = false;
unsigned i, j, bind;
const __DRIimageLoaderExtension *image = screen->image.loader;
/* Image specific variables */
/* See if we need a depth-stencil buffer. */
for (i = 0; i < statts_count; i++) {
if (statts[i] == ST_ATTACHMENT_DEPTH_STENCIL) {
- alloc_depthstencil = TRUE;
+ alloc_depthstencil = true;
break;
}
}
if (drawable->stvis.samples > 1) {
for (i = 0; i < ST_ATTACHMENT_COUNT; i++) {
- boolean del = TRUE;
+ bool del = true;
/* Don't delete MSAA resources for the attachments which are enabled,
* we can reuse them. */
for (j = 0; j < statts_count; j++) {
if (i == statts[j]) {
- del = FALSE;
+ del = false;
break;
}
}
img->dri_components = map->dri_components;
img->dri_fourcc = fourcc;
img->dri_format = map->dri_format;
- img->imported_dmabuf = TRUE;
+ img->imported_dmabuf = true;
exit:
if (error)
strides, offsets, bind, NULL, loaderPrivate);
}
-static boolean
+static bool
dri2_query_dma_buf_modifiers(__DRIscreen *_screen, int fourcc, int max,
uint64_t *modifiers, unsigned int *external_only,
int *count)
return false;
}
-static boolean
+static bool
dri2_query_dma_buf_format_modifier_attribs(__DRIscreen *_screen,
uint32_t fourcc, uint64_t modifier,
int attrib, uint64_t *value)
static struct dri_drawable *
dri2_create_drawable(struct dri_screen *screen, const struct gl_config *visual,
- boolean isPixmap, void *loaderPrivate)
+ bool isPixmap, void *loaderPrivate)
{
struct dri_drawable *drawable = dri_create_drawable(screen, visual, isPixmap,
loaderPrivate);
}
/* This is called inside MakeCurrent to unbind the context. */
-GLboolean
+bool
dri_unbind_context(struct dri_context *ctx)
{
/* dri_util.c ensures cPriv is not null */
return GL_TRUE;
}
-GLboolean
+bool
dri_make_current(struct dri_context *ctx,
struct dri_drawable *draw,
struct dri_drawable *read)
*/
void dri_destroy_context(struct dri_context *ctx);
-boolean dri_unbind_context(struct dri_context *ctx);
+bool
+dri_unbind_context(struct dri_context *ctx);
-boolean
+bool
dri_make_current(struct dri_context *ctx,
struct dri_drawable *draw,
struct dri_drawable *read);
return img;
}
-boolean
+bool
dri2_validate_egl_image(struct dri_screen *screen, void *handle)
{
const __DRIimageLookupExtension *loader = screen->dri2.image;
return PIPE_FORMAT_NONE;
}
-boolean
+bool
dri2_yuv_dma_buf_supported(struct dri_screen *screen,
const struct dri2_format_mapping *map)
{
return true;
}
-boolean
+bool
dri2_query_dma_buf_formats(__DRIscreen *_screen, int max, int *formats,
int *count)
{
enum pipe_format
dri2_get_pipe_format_for_dri_format(int format);
-boolean
+bool
dri2_query_dma_buf_formats(__DRIscreen *_screen, int max, int *formats,
int *count);
-boolean
+bool
dri2_yuv_dma_buf_supported(struct dri_screen *screen,
const struct dri2_format_mapping *map);
__DRIimage *
dri2_lookup_egl_image(struct dri_screen *screen, void *handle);
-boolean
+bool
dri2_validate_egl_image(struct dri_screen *screen, void *handle);
__DRIimage *
}
if (!img)
- return FALSE;
+ return false;
stimg->texture = NULL;
pipe_resource_reference(&stimg->texture, img->texture);
stimg->yuv_color_space = img->yuv_color_space;
stimg->yuv_range = img->sample_range;
- return TRUE;
+ return true;
}
static bool
unsigned int api_mask;
- boolean throttle;
+ bool throttle;
struct st_config_options options;
/* drm */
int fd;
- boolean can_share_buffer;
+ bool can_share_buffer;
struct pipe_loader_device *dev;
/* gallium */
- boolean d_depth_bits_last;
- boolean sd_depth_bits_last;
- boolean auto_fake_front;
- boolean has_reset_status_query;
- boolean has_protected_context;
+ bool d_depth_bits_last;
+ bool sd_depth_bits_last;
+ bool auto_fake_front;
+ bool has_reset_status_query;
+ bool has_protected_context;
enum pipe_texture_target target;
- boolean swrast_no_present;
+ bool swrast_no_present;
/* hooks filled in by dri2 & drisw */
__DRIimage * (*lookup_egl_image)(struct dri_screen *ctx, void *handle);
- boolean (*validate_egl_image)(struct dri_screen *ctx, void *handle);
+ bool (*validate_egl_image)(struct dri_screen *ctx, void *handle);
__DRIimage * (*lookup_egl_image_validated)(struct dri_screen *ctx, void *handle);
/* DRI exts that vary based on gallium pipe_screen caps. */
struct dri_drawable *(*create_drawable)(struct dri_screen *screen,
const struct gl_config *glVis,
- GLboolean pixmapBuffer,
+ bool pixmapBuffer,
void *loaderPrivate);
__DRIbuffer *(*allocate_buffer)(struct dri_screen *screen,
void *loader_private;
- boolean imported_dmabuf;
+ bool imported_dmabuf;
/**
* Provided by EGL_EXT_image_dma_buf_import.
*/
struct dri_screen *screen;
};
-static inline boolean
+static inline bool
dri_with_format(struct dri_screen *screen)
{
const __DRIdri2LoaderExtension *loader = screen->dri2.loader;
#include "dri_helpers.h"
#include "dri_query_renderer.h"
-DEBUG_GET_ONCE_BOOL_OPTION(swrast_no_present, "SWRAST_NO_PRESENT", FALSE);
+DEBUG_GET_ONCE_BOOL_OPTION(swrast_no_present, "SWRAST_NO_PRESENT", false);
static inline void
get_drawable_info(struct dri_drawable *drawable, int *x, int *y, int *w, int *h)
whandle.type = WINSYS_HANDLE_TYPE_SHMID;
if (loader->base.version < 4 || !loader->getImageShm)
- return FALSE;
+ return false;
if (!res->screen->resource_get_handle(res->screen, NULL, res, &whandle, PIPE_HANDLE_USAGE_FRAMEBUFFER_WRITE))
- return FALSE;
+ return false;
if (loader->base.version > 5 && loader->getImageShm2)
return loader->getImageShm2(opaque_dri_drawable(drawable), x, y, width, height, whandle.handle, drawable->loaderPrivate);
loader->getImageShm(opaque_dri_drawable(drawable), x, y, width, height, whandle.handle, drawable->loaderPrivate);
- return TRUE;
+ return true;
}
static void
const __DRIswrastLoaderExtension *loader = drawable->screen->swrast_loader;
struct pipe_resource templ;
unsigned width, height;
- boolean resized;
+ bool resized;
unsigned i;
/* Wait for glthread to finish because we can't use pipe_context from
static struct dri_drawable *
drisw_create_drawable(struct dri_screen *screen, const struct gl_config * visual,
- boolean isPixmap, void *loaderPrivate)
+ bool isPixmap, void *loaderPrivate)
{
struct dri_drawable *drawable = dri_create_drawable(screen, visual, isPixmap,
loaderPrivate);
static struct dri_drawable *
kopper_create_drawable(struct dri_screen *screen, const struct gl_config *visual,
- boolean isPixmap, void *loaderPrivate);
+ bool isPixmap, void *loaderPrivate);
static inline void
kopper_invalidate_drawable(__DRIdrawable *dPriv)
struct dri_screen *screen = drawable->screen;
struct pipe_resource templ;
unsigned width, height;
- boolean resized;
+ bool resized;
unsigned i;
struct __DRIimageList images;
const __DRIimageLoaderExtension *image = screen->image.loader;
whandle.type = WINSYS_HANDLE_TYPE_SHMID;
if (loader->base.version < 4 || !loader->getImageShm)
- return FALSE;
+ return false;
if (!res->screen->resource_get_handle(res->screen, NULL, res, &whandle, PIPE_HANDLE_USAGE_FRAMEBUFFER_WRITE))
- return FALSE;
+ return false;
if (loader->base.version > 5 && loader->getImageShm2)
return loader->getImageShm2(opaque_dri_drawable(drawable), x, y, width, height, whandle.handle, drawable->loaderPrivate);
loader->getImageShm(opaque_dri_drawable(drawable), x, y, width, height, whandle.handle, drawable->loaderPrivate);
- return TRUE;
+ return true;
}
static void
static struct dri_drawable *
kopper_create_drawable(struct dri_screen *screen, const struct gl_config *visual,
- boolean isPixmap, void *loaderPrivate)
+ bool isPixmap, void *loaderPrivate)
{
/* always pass !pixmap because it isn't "handled" or relevant */
struct dri_drawable *drawable = dri_create_drawable(screen, visual, false,