i965: Rename intel_image_format and intel_buffer to brw_*

Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9207>
This commit is contained in:
Kenneth Graunke
2021-02-22 11:43:46 -08:00
committed by Marge Bot
parent d2e38c2648
commit d994090e7c
4 changed files with 37 additions and 37 deletions

View File

@@ -51,7 +51,7 @@ extern "C" {
* Used with images created with image_from_names * Used with images created with image_from_names
* to help support planar images. * to help support planar images.
*/ */
struct intel_image_format { struct brw_image_format {
int fourcc; int fourcc;
int components; int components;
int nplanes; int nplanes;
@@ -81,7 +81,7 @@ struct __DRIimageRec {
*/ */
uint32_t strides[3]; uint32_t strides[3];
uint32_t offsets[3]; uint32_t offsets[3];
const struct intel_image_format *planar_format; const struct brw_image_format *planar_format;
/* particular miptree level */ /* particular miptree level */
GLuint width; GLuint width;

View File

@@ -667,7 +667,7 @@ miptree_create_for_planar_image(struct brw_context *brw,
__DRIimage *image, GLenum target, __DRIimage *image, GLenum target,
enum isl_tiling tiling) enum isl_tiling tiling)
{ {
const struct intel_image_format *f = image->planar_format; const struct brw_image_format *f = image->planar_format;
struct brw_mipmap_tree *planar_mt = NULL; struct brw_mipmap_tree *planar_mt = NULL;
for (int i = 0; i < f->nplanes; i++) { for (int i = 0; i < f->nplanes; i++) {

View File

@@ -196,7 +196,7 @@ static const struct __DRI2flushExtensionRec intelFlushExtension = {
.flush_with_flags = intel_dri2_flush_with_flags, .flush_with_flags = intel_dri2_flush_with_flags,
}; };
static const struct intel_image_format intel_image_formats[] = { static const struct brw_image_format brw_image_formats[] = {
{ DRM_FORMAT_ABGR16161616F, __DRI_IMAGE_COMPONENTS_RGBA, 1, { DRM_FORMAT_ABGR16161616F, __DRI_IMAGE_COMPONENTS_RGBA, 1,
{ { 0, 0, 0, __DRI_IMAGE_FORMAT_ABGR16161616F, 8 } } }, { { 0, 0, 0, __DRI_IMAGE_FORMAT_ABGR16161616F, 8 } } },
@@ -355,7 +355,7 @@ static const struct {
static bool static bool
modifier_is_supported(const struct gen_device_info *devinfo, modifier_is_supported(const struct gen_device_info *devinfo,
const struct intel_image_format *fmt, int dri_format, const struct brw_image_format *fmt, int dri_format,
uint64_t modifier) uint64_t modifier)
{ {
const struct isl_drm_modifier_info *modinfo = const struct isl_drm_modifier_info *modinfo =
@@ -427,12 +427,12 @@ intel_image_warn_if_unaligned(__DRIimage *image, const char *func)
} }
} }
static const struct intel_image_format * static const struct brw_image_format *
intel_image_format_lookup(int fourcc) brw_image_format_lookup(int fourcc)
{ {
for (unsigned i = 0; i < ARRAY_SIZE(intel_image_formats); i++) { for (unsigned i = 0; i < ARRAY_SIZE(brw_image_formats); i++) {
if (intel_image_formats[i].fourcc == fourcc) if (brw_image_formats[i].fourcc == fourcc)
return &intel_image_formats[i]; return &brw_image_formats[i];
} }
return NULL; return NULL;
@@ -446,9 +446,9 @@ intel_image_get_fourcc(__DRIimage *image, int *fourcc)
return true; return true;
} }
for (unsigned i = 0; i < ARRAY_SIZE(intel_image_formats); i++) { for (unsigned i = 0; i < ARRAY_SIZE(brw_image_formats); i++) {
if (intel_image_formats[i].planes[0].dri_format == image->dri_format) { if (brw_image_formats[i].planes[0].dri_format == image->dri_format) {
*fourcc = intel_image_formats[i].fourcc; *fourcc = brw_image_formats[i].fourcc;
return true; return true;
} }
} }
@@ -983,7 +983,7 @@ intel_query_format_modifier_attribs(__DRIscreen *dri_screen,
int attrib, uint64_t *value) int attrib, uint64_t *value)
{ {
struct brw_screen *screen = dri_screen->driverPrivate; struct brw_screen *screen = dri_screen->driverPrivate;
const struct intel_image_format *f = intel_image_format_lookup(fourcc); const struct brw_image_format *f = brw_image_format_lookup(fourcc);
if (!modifier_is_supported(&screen->devinfo, f, 0, modifier)) if (!modifier_is_supported(&screen->devinfo, f, 0, modifier))
return false; return false;
@@ -1051,14 +1051,14 @@ intel_create_image_from_names(__DRIscreen *dri_screen,
int *strides, int *offsets, int *strides, int *offsets,
void *loaderPrivate) void *loaderPrivate)
{ {
const struct intel_image_format *f = NULL; const struct brw_image_format *f = NULL;
__DRIimage *image; __DRIimage *image;
int i, index; int i, index;
if (dri_screen == NULL || names == NULL || num_names != 1) if (dri_screen == NULL || names == NULL || num_names != 1)
return NULL; return NULL;
f = intel_image_format_lookup(fourcc); f = brw_image_format_lookup(fourcc);
if (f == NULL) if (f == NULL)
return NULL; return NULL;
@@ -1088,7 +1088,7 @@ intel_create_image_from_fds_common(__DRIscreen *dri_screen,
void *loaderPrivate) void *loaderPrivate)
{ {
struct brw_screen *screen = dri_screen->driverPrivate; struct brw_screen *screen = dri_screen->driverPrivate;
const struct intel_image_format *f; const struct brw_image_format *f;
__DRIimage *image; __DRIimage *image;
int i, index; int i, index;
bool ok; bool ok;
@@ -1096,7 +1096,7 @@ intel_create_image_from_fds_common(__DRIscreen *dri_screen,
if (fds == NULL || num_fds < 1) if (fds == NULL || num_fds < 1)
return NULL; return NULL;
f = intel_image_format_lookup(fourcc); f = brw_image_format_lookup(fourcc);
if (f == NULL) if (f == NULL)
return NULL; return NULL;
@@ -1281,7 +1281,7 @@ intel_create_image_from_dma_bufs2(__DRIscreen *dri_screen,
void *loaderPrivate) void *loaderPrivate)
{ {
__DRIimage *image; __DRIimage *image;
const struct intel_image_format *f = intel_image_format_lookup(fourcc); const struct brw_image_format *f = brw_image_format_lookup(fourcc);
if (!f) { if (!f) {
*error = __DRI_IMAGE_ERROR_BAD_MATCH; *error = __DRI_IMAGE_ERROR_BAD_MATCH;
@@ -1337,10 +1337,10 @@ intel_create_image_from_dma_bufs(__DRIscreen *dri_screen,
} }
static bool static bool
intel_image_format_is_supported(const struct gen_device_info *devinfo, brw_image_format_is_supported(const struct gen_device_info *devinfo,
const struct intel_image_format *fmt) const struct brw_image_format *fmt)
{ {
/* Currently, all formats with an intel_image_format are available on all /* Currently, all formats with an brw_image_format are available on all
* platforms so there's really nothing to check there. * platforms so there's really nothing to check there.
*/ */
@@ -1367,25 +1367,25 @@ intel_query_dma_buf_formats(__DRIscreen *_screen, int max,
struct brw_screen *screen = _screen->driverPrivate; struct brw_screen *screen = _screen->driverPrivate;
int num_formats = 0, i; int num_formats = 0, i;
for (i = 0; i < ARRAY_SIZE(intel_image_formats); i++) { for (i = 0; i < ARRAY_SIZE(brw_image_formats); i++) {
/* These formats are valid DRI formats but do not exist in drm_fourcc.h /* These formats are valid DRI formats but do not exist in drm_fourcc.h
* in the Linux kernel. We don't want to accidentally advertise them * in the Linux kernel. We don't want to accidentally advertise them
* them through the EGL layer. * them through the EGL layer.
*/ */
if (intel_image_formats[i].fourcc == __DRI_IMAGE_FOURCC_SARGB8888 || if (brw_image_formats[i].fourcc == __DRI_IMAGE_FOURCC_SARGB8888 ||
intel_image_formats[i].fourcc == __DRI_IMAGE_FOURCC_SABGR8888 || brw_image_formats[i].fourcc == __DRI_IMAGE_FOURCC_SABGR8888 ||
intel_image_formats[i].fourcc == __DRI_IMAGE_FOURCC_SXRGB8888) brw_image_formats[i].fourcc == __DRI_IMAGE_FOURCC_SXRGB8888)
continue; continue;
if (!intel_image_format_is_supported(&screen->devinfo, if (!brw_image_format_is_supported(&screen->devinfo,
&intel_image_formats[i])) &brw_image_formats[i]))
continue; continue;
num_formats++; num_formats++;
if (max == 0) if (max == 0)
continue; continue;
formats[num_formats - 1] = intel_image_formats[i].fourcc; formats[num_formats - 1] = brw_image_formats[i].fourcc;
if (num_formats >= max) if (num_formats >= max)
break; break;
} }
@@ -1401,14 +1401,14 @@ intel_query_dma_buf_modifiers(__DRIscreen *_screen, int fourcc, int max,
int *count) int *count)
{ {
struct brw_screen *screen = _screen->driverPrivate; struct brw_screen *screen = _screen->driverPrivate;
const struct intel_image_format *f; const struct brw_image_format *f;
int num_mods = 0, i; int num_mods = 0, i;
f = intel_image_format_lookup(fourcc); f = brw_image_format_lookup(fourcc);
if (f == NULL) if (f == NULL)
return false; return false;
if (!intel_image_format_is_supported(&screen->devinfo, f)) if (!brw_image_format_is_supported(&screen->devinfo, f))
return false; return false;
for (i = 0; i < ARRAY_SIZE(supported_modifiers); i++) { for (i = 0; i < ARRAY_SIZE(supported_modifiers); i++) {
@@ -1457,7 +1457,7 @@ intel_from_planar(__DRIimage *parent, int plane, void *loaderPrivate)
width = parent->width; width = parent->width;
height = parent->height; height = parent->height;
const struct intel_image_format *f = parent->planar_format; const struct brw_image_format *f = parent->planar_format;
if (f && plane < f->nplanes) { if (f && plane < f->nplanes) {
/* Use the planar format definition. */ /* Use the planar format definition. */
@@ -2886,7 +2886,7 @@ __DRIconfig **intelInitScreen2(__DRIscreen *dri_screen)
return (const __DRIconfig**) brw_screen_make_configs(dri_screen); return (const __DRIconfig**) brw_screen_make_configs(dri_screen);
} }
struct intel_buffer { struct brw_buffer {
__DRIbuffer base; __DRIbuffer base;
struct brw_bo *bo; struct brw_bo *bo;
}; };
@@ -2896,7 +2896,7 @@ intelAllocateBuffer(__DRIscreen *dri_screen,
unsigned attachment, unsigned format, unsigned attachment, unsigned format,
int width, int height) int width, int height)
{ {
struct intel_buffer *intelBuffer; struct brw_buffer *intelBuffer;
struct brw_screen *screen = dri_screen->driverPrivate; struct brw_screen *screen = dri_screen->driverPrivate;
assert(attachment == __DRI_BUFFER_FRONT_LEFT || assert(attachment == __DRI_BUFFER_FRONT_LEFT ||
@@ -2937,7 +2937,7 @@ intelAllocateBuffer(__DRIscreen *dri_screen,
static void static void
intelReleaseBuffer(UNUSED __DRIscreen *dri_screen, __DRIbuffer *buffer) intelReleaseBuffer(UNUSED __DRIscreen *dri_screen, __DRIbuffer *buffer)
{ {
struct intel_buffer *intelBuffer = (struct intel_buffer *) buffer; struct brw_buffer *intelBuffer = (struct brw_buffer *) buffer;
brw_bo_unreference(intelBuffer->bo); brw_bo_unreference(intelBuffer->bo);
free(intelBuffer); free(intelBuffer);

View File

@@ -62,7 +62,7 @@ struct brw_texture_object
*/ */
mesa_format _Format; mesa_format _Format;
const struct intel_image_format *planar_format; const struct brw_image_format *planar_format;
unsigned int yuv_color_space; unsigned int yuv_color_space;
}; };