Commit 9e39e49e authored by Anuj Phogat's avatar Anuj Phogat Committed by Marge Bot
Browse files

intel: Rename gen enum to gfx_ver



export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965
grep -E "gen_from_devinfo" -rIl $SEARCH_PATH | xargs sed -ie "s/gen_from_devinfo/gfx_ver_from_devinfo/g"

Few manual changes.
Signed-off-by: Anuj Phogat's avatarAnuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
Part-of: <mesa/mesa!10241>
parent 47a32160
......@@ -707,15 +707,15 @@ static const struct opcode_desc opcode_descs[] = {
* provide efficient constant-time look-up.
*/
static const opcode_desc *
lookup_opcode_desc(gen *index_gen,
lookup_opcode_desc(gfx_ver *index_gen,
const opcode_desc **index_descs,
unsigned index_size,
unsigned opcode_desc::*key,
const intel_device_info *devinfo,
unsigned k)
{
if (*index_gen != gen_from_devinfo(devinfo)) {
*index_gen = gen_from_devinfo(devinfo);
if (*index_gen != gfx_ver_from_devinfo(devinfo)) {
*index_gen = gfx_ver_from_devinfo(devinfo);
for (unsigned l = 0; l < index_size; l++)
index_descs[l] = NULL;
......@@ -742,7 +742,7 @@ lookup_opcode_desc(gen *index_gen,
const struct opcode_desc *
brw_opcode_desc(const struct intel_device_info *devinfo, enum opcode opcode)
{
static __thread gen index_gen = {};
static __thread gfx_ver index_gen = {};
static __thread const opcode_desc *index_descs[NUM_BRW_OPCODES];
return lookup_opcode_desc(&index_gen, index_descs, ARRAY_SIZE(index_descs),
&opcode_desc::ir, devinfo, opcode);
......@@ -755,7 +755,7 @@ brw_opcode_desc(const struct intel_device_info *devinfo, enum opcode opcode)
const struct opcode_desc *
brw_opcode_desc_from_hw(const struct intel_device_info *devinfo, unsigned hw)
{
static __thread gen index_gen = {};
static __thread gfx_ver index_gen = {};
static __thread const opcode_desc *index_descs[128];
return lookup_opcode_desc(&index_gen, index_descs, ARRAY_SIZE(index_descs),
&opcode_desc::hw, devinfo, hw);
......
......@@ -24,7 +24,7 @@
#include "util/macros.h"
#include "dev/intel_device_info.h"
enum gen {
enum gfx_ver {
GFX4 = (1 << 0),
GFX45 = (1 << 1),
GFX5 = (1 << 2),
......@@ -40,12 +40,12 @@ enum gen {
GFX_ALL = ~0
};
#define GFX_LT(gen) ((gen) - 1)
#define GFX_GE(gen) (~GFX_LT(gen))
#define GFX_LE(gen) (GFX_LT(gen) | (gen))
#define GFX_LT(ver) ((ver) - 1)
#define GFX_GE(ver) (~GFX_LT(ver))
#define GFX_LE(ver) (GFX_LT(ver) | (ver))
static enum gen
gen_from_devinfo(const struct intel_device_info *devinfo)
static enum gfx_ver
gfx_ver_from_devinfo(const struct intel_device_info *devinfo)
{
switch (devinfo->verx10) {
case 40: return GFX4;
......
......@@ -290,7 +290,7 @@ run_tests(const struct intel_device_info *devinfo)
bool fail = false;
for (unsigned i = 0; i < ARRAY_SIZE(tests); i++) {
if ((tests[i].gens & gen_from_devinfo(devinfo)) == 0)
if ((tests[i].gens & gfx_ver_from_devinfo(devinfo)) == 0)
continue;
for (int align_16 = 0; align_16 <= 1; align_16++) {
......
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