summaryrefslogtreecommitdiff
path: root/dri3
diff options
context:
space:
mode:
authorEmil Velikov <emil.velikov@collabora.com>2018-04-02 16:41:12 +0100
committerAdam Jackson <ajax@redhat.com>2018-04-10 15:42:23 -0400
commit66b632bb068672f507212b00bd313b5040bf1a39 (patch)
treed22538208aa66ddbbd7a762717a5d330ff3721c1 /dri3
parentc67f2eac56518163981af59f5accb7c79bc00f6a (diff)
dri3: annotate the dri3_screen_info data as const
dri3_screen_info is the user provide dispatch. Something that we do not and should not change. When using the _ptr typecast + const the compiler barfs at us (rightfully so), so use the _rec one. [Silence a new const mismatch warning too - ajax] Fixes: 56313829886 ("dri3: Add DRI3 extension") Cc: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Diffstat (limited to 'dri3')
-rw-r--r--dri3/dri3.c2
-rw-r--r--dri3/dri3.h2
-rw-r--r--dri3/dri3_priv.h2
-rw-r--r--dri3/dri3_screen.c14
4 files changed, 10 insertions, 10 deletions
diff --git a/dri3/dri3.c b/dri3/dri3.c
index 8ac0f3ae2..ba32facd7 100644
--- a/dri3/dri3.c
+++ b/dri3/dri3.c
@@ -45,7 +45,7 @@ dri3_close_screen(ScreenPtr screen)
}
Bool
-dri3_screen_init(ScreenPtr screen, dri3_screen_info_ptr info)
+dri3_screen_init(ScreenPtr screen, const dri3_screen_info_rec *info)
{
dri3_screen_generation = serverGeneration;
diff --git a/dri3/dri3.h b/dri3/dri3.h
index 89ad13ad9..bd17522b0 100644
--- a/dri3/dri3.h
+++ b/dri3/dri3.h
@@ -104,7 +104,7 @@ typedef struct dri3_screen_info {
} dri3_screen_info_rec, *dri3_screen_info_ptr;
extern _X_EXPORT Bool
-dri3_screen_init(ScreenPtr screen, dri3_screen_info_ptr info);
+dri3_screen_init(ScreenPtr screen, const dri3_screen_info_rec *info);
extern _X_EXPORT int
dri3_send_open_reply(ClientPtr client, int fd);
diff --git a/dri3/dri3_priv.h b/dri3/dri3_priv.h
index d86f06be0..f0400a78a 100644
--- a/dri3/dri3_priv.h
+++ b/dri3/dri3_priv.h
@@ -49,7 +49,7 @@ typedef struct dri3_screen_priv {
CARD32 num_formats;
dri3_dmabuf_format_ptr formats;
- dri3_screen_info_ptr info;
+ const dri3_screen_info_rec *info;
} dri3_screen_priv_rec, *dri3_screen_priv_ptr;
#define wrap(priv,real,mem,func) {\
diff --git a/dri3/dri3_screen.c b/dri3/dri3_screen.c
index 8ccbeb40c..8d3744977 100644
--- a/dri3/dri3_screen.c
+++ b/dri3/dri3_screen.c
@@ -32,7 +32,7 @@
#include <drm_fourcc.h>
#include <unistd.h>
-static inline Bool has_open(dri3_screen_info_ptr info) {
+static inline Bool has_open(const dri3_screen_info_rec *info) {
if (info == NULL)
return FALSE;
@@ -44,7 +44,7 @@ int
dri3_open(ClientPtr client, ScreenPtr screen, RRProviderPtr provider, int *fd)
{
dri3_screen_priv_ptr ds = dri3_screen_priv(screen);
- dri3_screen_info_ptr info = ds->info;
+ const dri3_screen_info_rec *info = ds->info;
int rc;
if (!has_open(info))
@@ -69,7 +69,7 @@ dri3_pixmap_from_fds(PixmapPtr *ppixmap, ScreenPtr screen,
CARD8 depth, CARD8 bpp, CARD64 modifier)
{
dri3_screen_priv_ptr ds = dri3_screen_priv(screen);
- dri3_screen_info_ptr info = ds->info;
+ const dri3_screen_info_rec *info = ds->info;
PixmapPtr pixmap;
if (!info)
@@ -100,7 +100,7 @@ dri3_fds_from_pixmap(PixmapPtr pixmap, int *fds,
{
ScreenPtr screen = pixmap->drawable.pScreen;
dri3_screen_priv_ptr ds = dri3_screen_priv(screen);
- dri3_screen_info_ptr info = ds->info;
+ const dri3_screen_info_rec *info = ds->info;
if (!info)
return 0;
@@ -130,7 +130,7 @@ dri3_fd_from_pixmap(PixmapPtr pixmap, CARD16 *stride, CARD32 *size)
{
ScreenPtr screen = pixmap->drawable.pScreen;
dri3_screen_priv_ptr ds = dri3_screen_priv(screen);
- dri3_screen_info_ptr info = ds->info;
+ const dri3_screen_info_rec *info = ds->info;
CARD32 strides[4];
CARD32 offsets[4];
CARD64 modifier;
@@ -170,7 +170,7 @@ static int
cache_formats_and_modifiers(ScreenPtr screen)
{
dri3_screen_priv_ptr ds = dri3_screen_priv(screen);
- dri3_screen_info_ptr info = ds->info;
+ const dri3_screen_info_rec *info = ds->info;
CARD32 *formats = NULL;
CARD64 *modifiers = NULL;
int i;
@@ -230,7 +230,7 @@ dri3_get_supported_modifiers(ScreenPtr screen, DrawablePtr drawable,
CARD64 **screen_modifiers)
{
dri3_screen_priv_ptr ds = dri3_screen_priv(screen);
- dri3_screen_info_ptr info = ds->info;
+ const dri3_screen_info_rec *info = ds->info;
int i, j;
int ret;
CARD32 num_drawable_mods;