Skip to content

Commit

Permalink
broadcom: Add V3D 3.3 gallium driver called "vc5", for BCM7268.
Browse files Browse the repository at this point in the history
V3D 3.3 is a continuation of the 3D implementation in VC4 (v2.1 and v2.6).
V3D 3.3 introduces an MMU (no more CMA allocations) and support for
GLES3.1.  This driver is not currently conformant, though that will be a
target as soon as possible.

V3D 3.x parts use a new texture tiling layout common across many Broadcom
graphics parts including and the HVS scanout engine.  It also massively
changes the QPU instructions, introducing a common physical register file
(no more A/B split) and half-float instructions, while removing the 4x8
unorm instructions in favor of half-float for talking to fixed function
interfaces.  Because so much has changed, vc5 is implemented in a separate
gallium driver, using only the XML code-generation support from vc4.

v2: Fix tile layout for 64bpp textures.  Fix texture swizzling for 32-bit
    returns.  Fix up a bit of MRT setup.  Sync the simulator to kernel
    behavior a bit more.  Improve uniform debugging code.  Rebase on
    QIR->VIR rename.  Move texture state mostly to the CSOs.  Improve
    cache flushing on the simulator.  Fix program deletion
    use-after-frees.

Acked-by: Dave Airlie <airlied@gmail.com> (uabi plan)
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> (uabi plan)
  • Loading branch information
anholt committed Oct 10, 2017
1 parent ade416d commit 45bb8f2
Show file tree
Hide file tree
Showing 43 changed files with 9,131 additions and 2 deletions.
2 changes: 2 additions & 0 deletions configure.ac
Expand Up @@ -2878,6 +2878,7 @@ AC_CONFIG_FILES([Makefile
src/gallium/drivers/etnaviv/Makefile
src/gallium/drivers/imx/Makefile
src/gallium/drivers/vc4/Makefile
src/gallium/drivers/vc5/Makefile
src/gallium/drivers/virgl/Makefile
src/gallium/state_trackers/clover/Makefile
src/gallium/state_trackers/dri/Makefile
Expand Down Expand Up @@ -2921,6 +2922,7 @@ AC_CONFIG_FILES([Makefile
src/gallium/winsys/sw/wrapper/Makefile
src/gallium/winsys/sw/xlib/Makefile
src/gallium/winsys/vc4/drm/Makefile
src/gallium/winsys/vc5/drm/Makefile
src/gallium/winsys/virgl/drm/Makefile
src/gallium/winsys/virgl/vtest/Makefile
src/gbm/Makefile
Expand Down
5 changes: 5 additions & 0 deletions src/gallium/Makefile.am
Expand Up @@ -94,6 +94,11 @@ if HAVE_GALLIUM_VC4
SUBDIRS += drivers/vc4 winsys/vc4/drm
endif

## vc5
if HAVE_GALLIUM_VC5
SUBDIRS += drivers/vc5 winsys/vc5/drm
endif

## virgl
if HAVE_GALLIUM_VIRGL
SUBDIRS += drivers/virgl winsys/virgl/drm winsys/virgl/vtest
Expand Down
5 changes: 5 additions & 0 deletions src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
Expand Up @@ -120,6 +120,11 @@ static const struct drm_driver_descriptor driver_descriptors[] = {
.create_screen = pipe_vc4_create_screen,
.configuration = pipe_default_configuration_query,
},
{
.driver_name = "vc5",
.create_screen = pipe_vc5_create_screen,
.configuration = pipe_default_configuration_query,
},
{
.driver_name = "etnaviv",
.create_screen = pipe_etna_create_screen,
Expand Down
23 changes: 23 additions & 0 deletions src/gallium/auxiliary/target-helpers/drm_helper.h
Expand Up @@ -310,6 +310,29 @@ pipe_vc4_create_screen(int fd, const struct pipe_screen_config *config)

#endif

#ifdef GALLIUM_VC5
#include "vc5/drm/vc5_drm_public.h"

struct pipe_screen *
pipe_vc5_create_screen(int fd, const struct pipe_screen_config *config)
{
struct pipe_screen *screen;

screen = vc5_drm_screen_create(fd);
return screen ? debug_screen_wrap(screen) : NULL;
}

#else

struct pipe_screen *
pipe_vc5_create_screen(int fd, const struct pipe_screen_config *config)
{
fprintf(stderr, "vc5: driver missing\n");
return NULL;
}

#endif

#ifdef GALLIUM_ETNAVIV
#include "etnaviv/drm/etnaviv_drm_public.h"

Expand Down
3 changes: 3 additions & 0 deletions src/gallium/auxiliary/target-helpers/drm_helper_public.h
Expand Up @@ -39,6 +39,9 @@ pipe_virgl_create_screen(int fd, const struct pipe_screen_config *config);
struct pipe_screen *
pipe_vc4_create_screen(int fd, const struct pipe_screen_config *config);

struct pipe_screen *
pipe_vc5_create_screen(int fd, const struct pipe_screen_config *config);

struct pipe_screen *
pipe_pl111_create_screen(int fd, const struct pipe_screen_config *config);

Expand Down
3 changes: 2 additions & 1 deletion src/gallium/drivers/vc4/Automake.inc
Expand Up @@ -4,6 +4,7 @@ TARGET_DRIVERS += vc4
TARGET_CPPFLAGS += -DGALLIUM_VC4
TARGET_LIB_DEPS += \
$(top_builddir)/src/gallium/winsys/vc4/drm/libvc4drm.la \
$(top_builddir)/src/gallium/drivers/vc4/libvc4.la
$(top_builddir)/src/gallium/drivers/vc4/libvc4.la \
$(top_builddir)/src/broadcom/cle/libbroadcom_cle.la

endif
1 change: 0 additions & 1 deletion src/gallium/drivers/vc4/Makefile.am
Expand Up @@ -43,7 +43,6 @@ libvc4_la_SOURCES = $(C_SOURCES)

libvc4_la_LIBADD = \
$(SIM_LIB) \
$(top_builddir)/src/broadcom/cle/libbroadcom_cle.la \
$()

if HAVE_ARM_ASM
Expand Down
3 changes: 3 additions & 0 deletions src/gallium/drivers/vc5/.editorconfig
@@ -0,0 +1,3 @@
[*.{c,h}]
indent_style = space
indent_size = 8
14 changes: 14 additions & 0 deletions src/gallium/drivers/vc5/Automake.inc
@@ -0,0 +1,14 @@
if HAVE_GALLIUM_VC5

TARGET_DRIVERS += vc5
TARGET_CPPFLAGS += -DGALLIUM_VC5
TARGET_LIB_DEPS += \
$(top_builddir)/src/gallium/winsys/vc5/drm/libvc5drm.la \
$(top_builddir)/src/gallium/drivers/vc5/libvc5.la \
$(top_builddir)/src/broadcom/libbroadcom.la

if !HAVE_GALLIUM_VC4
TARGET_LIB_DEPS += $(top_builddir)/src/broadcom/cle/libbroadcom_cle.la
endif

endif
40 changes: 40 additions & 0 deletions src/gallium/drivers/vc5/Makefile.am
@@ -0,0 +1,40 @@
# Copyright © 2014 Broadcom
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.

include Makefile.sources
include $(top_srcdir)/src/gallium/Automake.inc

AM_CFLAGS = \
-I$(top_builddir)/src/compiler/nir \
-I$(top_builddir)/src/broadcom \
$(LIBDRM_CFLAGS) \
$(VC5_SIMULATOR_CFLAGS) \
$(GALLIUM_DRIVER_CFLAGS) \
$(VALGRIND_CFLAGS) \
$()

noinst_LTLIBRARIES = libvc5.la

libvc5_la_SOURCES = $(C_SOURCES)

libvc5_la_LDFLAGS = \
$(VC5_SIMULATOR_LIBS) \
$(NULL)
26 changes: 26 additions & 0 deletions src/gallium/drivers/vc5/Makefile.sources
@@ -0,0 +1,26 @@
C_SOURCES := \
vc5_blit.c \
vc5_bufmgr.c \
vc5_bufmgr.h \
vc5_cl.c \
vc5_cl.h \
vc5_context.c \
vc5_context.h \
vc5_draw.c \
vc5_emit.c \
vc5_fence.c \
vc5_formats.c \
vc5_job.c \
vc5_program.c \
vc5_query.c \
vc5_rcl.c \
vc5_resource.c \
vc5_resource.h \
vc5_screen.c \
vc5_screen.h \
vc5_simulator.c \
vc5_state.c \
vc5_tiling.c \
vc5_tiling.h \
vc5_uniforms.c \
$()

0 comments on commit 45bb8f2

Please sign in to comment.