Commit 954a704d authored by Eric Anholt's avatar Eric Anholt

broadcom/vc5: Port the RCL setup to V3D4.1.

The TLB load/store path is rebuilt in this version.  There is no longer a
single-byte resolved store or the 3-byte extended store.  Instead, you get
to always use general loads/stores (which, honestly, was tempting even in
previous versions).
parent 80c84241
......@@ -31,10 +31,24 @@ AM_CFLAGS = \
$(VALGRIND_CFLAGS) \
$()
noinst_LTLIBRARIES = libvc5.la
noinst_LTLIBRARIES = \
libvc5.la \
libvc5_v33.la \
libvc5_v41.la \
$()
libvc5_v33_la_SOURCES = $(VC5_PER_VERSION_SOURCES)
libvc5_v33_la_CFLAGS = -DV3D_VERSION=33
libvc5_v41_la_SOURCES = $(VC5_PER_VERSION_SOURCES)
libvc5_v41_la_CFLAGS = -DV3D_VERSION=41
libvc5_la_SOURCES = $(C_SOURCES)
libvc5_la_LDFLAGS = \
$(VC5_SIMULATOR_LIBS) \
$(NULL)
libvc5_la_LIBADD = \
libvc5_v33.la \
libvc5_v41.la \
$()
......@@ -14,7 +14,6 @@ C_SOURCES := \
vc5_job.c \
vc5_program.c \
vc5_query.c \
vc5_rcl.c \
vc5_resource.c \
vc5_resource.h \
vc5_screen.c \
......@@ -25,3 +24,7 @@ C_SOURCES := \
vc5_tiling.h \
vc5_uniforms.c \
$()
VC5_PER_VERSION_SOURCES = \
vc5_rcl.c \
$()
......@@ -33,7 +33,6 @@ files_libvc5 = files(
'vc5_job.c',
'vc5_program.c',
'vc5_query.c',
'vc5_rcl.c',
'vc5_resource.c',
'vc5_resource.h',
'vc5_screen.c',
......@@ -46,12 +45,34 @@ files_libvc5 = files(
'vc5_uniforms.c',
)
files_per_version = files(
'vc5_rcl.c',
)
v3dv3_c_args = []
dep_v3dv3 = dependency('v3dv3')
if dep_v3dv3.found()
v3dv3_c_args = '-DUSE_VC5_SIMULATOR'
endif
vc5_versions = ['33', '41']
per_version_libs = []
foreach ver : vc5_versions
per_version_libs += static_library(
'vc5-v' + ver,
[files_per_version, v3d_xml_pack, nir_opcodes_h, nir_builder_opcodes_h],
include_directories : [
inc_src, inc_include, inc_gallium, inc_gallium_aux, inc_broadcom,
inc_gallium_drivers, inc_drm_uapi,
],
c_args : [c_vis_args, v3dv3_c_args, '-DV3D_VERSION=' + ver],
cpp_args : [cpp_vis_args],
dependencies : [dep_v3dv3, dep_libdrm, dep_valgrind],
)
endforeach
libvc5 = static_library(
'vc5',
[files_libvc5, v3d_xml_pack],
......@@ -62,6 +83,7 @@ libvc5 = static_library(
c_args : [c_vis_args, v3dv3_c_args],
cpp_args : [cpp_vis_args, v3dv3_c_args],
dependencies : [dep_v3dv3, dep_libdrm, dep_valgrind, idep_nir_headers],
link_with: per_version_libs,
)
driver_vc5 = declare_dependency(
......
/*
* Copyright © 2014-2017 Broadcom
* Copyright (C) 2012 Rob Clark <robclark@freedesktop.org>
*
* 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.
*/
/* This file generates the per-v3d-version function prototypes. It must only
* be included from vc5_context.h.
*/
void v3dX(emit_rcl)(struct vc5_job *job);
......@@ -25,6 +25,10 @@
#ifndef VC5_CONTEXT_H
#define VC5_CONTEXT_H
#ifdef V3D_VERSION
#include "broadcom/common/v3d_macros.h"
#endif
#include <stdio.h>
#include "pipe/p_context.h"
......@@ -504,7 +508,17 @@ void vc5_get_internal_type_bpp_for_output_format(uint32_t format,
void vc5_init_query_functions(struct vc5_context *vc5);
void vc5_blit(struct pipe_context *pctx, const struct pipe_blit_info *blit_info);
void vc5_blitter_save(struct vc5_context *vc5);
void vc5_emit_rcl(struct vc5_job *job);
#ifdef v3dX
# include "v3dx_context.h"
#else
# define v3dX(x) v3d33_##x
# include "v3dx_context.h"
# undef v3dX
# define v3dX(x) v3d41_##x
# include "v3dx_context.h"
# undef v3dX
#endif
#endif /* VC5_CONTEXT_H */
......@@ -382,7 +382,10 @@ vc5_job_submit(struct vc5_context *vc5, struct vc5_job *job)
goto done;
}
vc5_emit_rcl(job);
if (vc5->screen->devinfo.ver >= 41)
v3d41_emit_rcl(job);
else
v3d33_emit_rcl(job);
if (cl_offset(&job->bcl) > 0) {
vc5_cl_ensure_space_with_branch(&job->bcl,
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment