minigbm: re-const-ify driver backends

minigbm driver creation needs to be re-entrant (see CL:674528). Let's
re-constify to make this behavior explicit.

BUG=none
TEST=emerge-eve {minigbm, arc-cros-gralloc}

Change-Id: I037966199d4aa6de60432127e10fea1fb602694b
Reviewed-on: https://chromium-review.googlesource.com/758142
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
This commit is contained in:
Gurchetan Singh 2017-10-31 10:36:25 -07:00 committed by chrome-bot
parent a29bf678db
commit 3e9d3830dc
17 changed files with 33 additions and 33 deletions

View file

@ -426,7 +426,7 @@ static uint32_t amdgpu_resolve_format(uint32_t format, uint64_t use_flags)
}
}
struct backend backend_amdgpu = {
const struct backend backend_amdgpu = {
.name = "amdgpu",
.init = amdgpu_init,
.close = amdgpu_close,

34
drv.c
View file

@ -21,40 +21,40 @@
#include "util.h"
#ifdef DRV_AMDGPU
extern struct backend backend_amdgpu;
extern const struct backend backend_amdgpu;
#endif
extern struct backend backend_evdi;
extern const struct backend backend_evdi;
#ifdef DRV_EXYNOS
extern struct backend backend_exynos;
extern const struct backend backend_exynos;
#endif
extern struct backend backend_gma500;
extern const struct backend backend_gma500;
#ifdef DRV_I915
extern struct backend backend_i915;
extern const struct backend backend_i915;
#endif
#ifdef DRV_MARVELL
extern struct backend backend_marvell;
extern const struct backend backend_marvell;
#endif
#ifdef DRV_MEDIATEK
extern struct backend backend_mediatek;
extern const struct backend backend_mediatek;
#endif
extern struct backend backend_nouveau;
extern const struct backend backend_nouveau;
#ifdef DRV_RADEON
extern struct backend backend_radeon;
extern const struct backend backend_radeon;
#endif
#ifdef DRV_ROCKCHIP
extern struct backend backend_rockchip;
extern const struct backend backend_rockchip;
#endif
#ifdef DRV_TEGRA
extern struct backend backend_tegra;
extern const struct backend backend_tegra;
#endif
extern struct backend backend_udl;
extern const struct backend backend_udl;
#ifdef DRV_VC4
extern struct backend backend_vc4;
extern const struct backend backend_vc4;
#endif
extern struct backend backend_vgem;
extern struct backend backend_virtio_gpu;
extern const struct backend backend_vgem;
extern const struct backend backend_virtio_gpu;
static struct backend *drv_get_backend(int fd)
static const struct backend *drv_get_backend(int fd)
{
drmVersionPtr drm_version;
unsigned int i;
@ -64,7 +64,7 @@ static struct backend *drv_get_backend(int fd)
if (!drm_version)
return NULL;
struct backend *backend_list[] = {
const struct backend *backend_list[] = {
#ifdef DRV_AMDGPU
&backend_amdgpu,
#endif

View file

@ -57,7 +57,7 @@ struct combinations {
struct driver {
int fd;
struct backend *backend;
const struct backend *backend;
void *priv;
void *buffer_table;
void *map_table;

2
evdi.c
View file

@ -21,7 +21,7 @@ static int evdi_init(struct driver *drv)
return drv_modify_linear_combinations(drv);
}
struct backend backend_evdi = {
const struct backend backend_evdi = {
.name = "evdi",
.init = evdi_init,
.bo_create = drv_dumb_bo_create,

View file

@ -105,7 +105,7 @@ cleanup_planes:
* Use dumb mapping with exynos even though a GEM buffer is created.
* libdrm does the same thing in exynos_drm.c
*/
struct backend backend_exynos = {
const struct backend backend_exynos = {
.name = "exynos",
.init = exynos_init,
.bo_create = exynos_bo_create,

View file

@ -21,7 +21,7 @@ static int gma500_init(struct driver *drv)
return drv_modify_linear_combinations(drv);
}
struct backend backend_gma500 = {
const struct backend backend_gma500 = {
.name = "gma500",
.init = gma500_init,
.bo_create = drv_dumb_bo_create,

2
i915.c
View file

@ -547,7 +547,7 @@ static uint32_t i915_resolve_format(uint32_t format, uint64_t use_flags)
}
}
struct backend backend_i915 = {
const struct backend backend_i915 = {
.name = "i915",
.init = i915_init,
.close = i915_close,

View file

@ -24,7 +24,7 @@ static int marvell_init(struct driver *drv)
ARRAY_SIZE(render_target_formats));
}
struct backend backend_marvell = {
const struct backend backend_marvell = {
.name = "marvell",
.init = marvell_init,
.bo_create = drv_dumb_bo_create,

View file

@ -145,7 +145,7 @@ static uint32_t mediatek_resolve_format(uint32_t format, uint64_t use_flags)
}
}
struct backend backend_mediatek = {
const struct backend backend_mediatek = {
.name = "mediatek",
.init = mediatek_init,
.bo_create = mediatek_bo_create,

View file

@ -21,7 +21,7 @@ static int nouveau_init(struct driver *drv)
return drv_modify_linear_combinations(drv);
}
struct backend backend_nouveau = {
const struct backend backend_nouveau = {
.name = "nouveau",
.init = nouveau_init,
.bo_create = drv_dumb_bo_create,

View file

@ -21,7 +21,7 @@ static int radeon_init(struct driver *drv)
return drv_modify_linear_combinations(drv);
}
struct backend backend_radeon = {
const struct backend backend_radeon = {
.name = "radeon",
.init = radeon_init,
.bo_create = drv_dumb_bo_create,

View file

@ -314,7 +314,7 @@ static uint32_t rockchip_resolve_format(uint32_t format, uint64_t use_flags)
}
}
struct backend backend_rockchip = {
const struct backend backend_rockchip = {
.name = "rockchip",
.init = rockchip_init,
.bo_create = rockchip_bo_create,

View file

@ -353,7 +353,7 @@ static int tegra_bo_flush(struct bo *bo, struct map_info *data)
return 0;
}
struct backend backend_tegra = {
const struct backend backend_tegra = {
.name = "tegra",
.init = tegra_init,
.bo_create = tegra_bo_create,

2
udl.c
View file

@ -21,7 +21,7 @@ static int udl_init(struct driver *drv)
return drv_modify_linear_combinations(drv);
}
struct backend backend_udl = {
const struct backend backend_udl = {
.name = "udl",
.init = udl_init,
.bo_create = drv_dumb_bo_create,

2
vc4.c
View file

@ -81,7 +81,7 @@ static void *vc4_bo_map(struct bo *bo, struct map_info *data, size_t plane, uint
bo_map.offset);
}
struct backend backend_vc4 = {
const struct backend backend_vc4 = {
.name = "vc4",
.init = vc4_init,
.bo_create = vc4_bo_create,

2
vgem.c
View file

@ -60,7 +60,7 @@ static uint32_t vgem_resolve_format(uint32_t format, uint64_t flags)
}
}
struct backend backend_vgem = {
const struct backend backend_vgem = {
.name = "vgem",
.init = vgem_init,
.bo_create = vgem_bo_create,

View file

@ -60,7 +60,7 @@ static uint32_t virtio_gpu_resolve_format(uint32_t format, uint64_t use_flags)
}
}
struct backend backend_virtio_gpu = {
const struct backend backend_virtio_gpu = {
.name = "virtio_gpu",
.init = virtio_gpu_init,
.bo_create = virtio_gpu_bo_create,