Browse Source

st/dri: inline dri2_buffer.h within dri2.c

The header was used only by dri2.c, containing a two-member struct and cast wrapper.
Just inline it where it's used/needed.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
tags/18.3-branchpoint
Emil Velikov 7 years ago
parent
commit
80b62e2d6d

+ 1
- 2
src/gallium/state_trackers/dri/Makefile.sources View File

@@ -11,8 +11,7 @@ common_SOURCES := \
dri_screen.h

dri2_SOURCES := \
dri2.c \
dri2_buffer.h
dri2.c

drisw_SOURCES := \
drisw.c

+ 14
- 1
src/gallium/state_trackers/dri/dri2.c View File

@@ -45,15 +45,28 @@
#include "main/bufferobj.h"
#include "main/texobj.h"

#include "dri_util.h"

#include "dri_helpers.h"
#include "dri_drawable.h"
#include "dri_query_renderer.h"
#include "dri2_buffer.h"

#ifndef DRM_FORMAT_MOD_INVALID
#define DRM_FORMAT_MOD_INVALID ((1ULL<<56) - 1)
#endif

struct dri2_buffer
{
__DRIbuffer base;
struct pipe_resource *resource;
};

static inline struct dri2_buffer *
dri2_buffer(__DRIbuffer * driBufferPriv)
{
return (struct dri2_buffer *) driBufferPriv;
}

static const int fourcc_formats[] = {
__DRI_IMAGE_FOURCC_ARGB2101010,
__DRI_IMAGE_FOURCC_XRGB2101010,

+ 0
- 22
src/gallium/state_trackers/dri/dri2_buffer.h View File

@@ -1,22 +0,0 @@
#ifndef DRI2_BUFFER_H
#define DRI2_BUFFER_H

#include "dri_util.h"

struct pipe_surface;

struct dri2_buffer
{
__DRIbuffer base;
struct pipe_resource *resource;
};

static inline struct dri2_buffer *
dri2_buffer(__DRIbuffer * driBufferPriv)
{
return (struct dri2_buffer *) driBufferPriv;
}

#endif

/* vim: set sw=3 ts=8 sts=3 expandtab: */

+ 1
- 1
src/gallium/state_trackers/dri/meson.build View File

@@ -38,7 +38,7 @@ if with_dri
endif

if with_dri2
files_libdri += files('dri2.c', 'dri2_buffer.h')
files_libdri += files('dri2.c')
endif

libdri_c_args = []

Loading…
Cancel
Save