<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Sat, Oct 27, 2018 at 4:35 AM Gustaw Smolarczyk <<a href="mailto:wielkiegie@gmail.com">wielkiegie@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">sob., 27 paź 2018 o 04:28 Marek Olšák <<a href="mailto:maraeo@gmail.com" target="_blank">maraeo@gmail.com</a>> napisał(a):<br>
><br>
> From: Marek Olšák <<a href="mailto:marek.olsak@amd.com" target="_blank">marek.olsak@amd.com</a>><br>
><br>
> ---<br>
> src/amd/addrlib/amdgpu_asic_addr.h | 2 ++<br>
> src/amd/addrlib/gfx9/gfx9addrlib.cpp | 2 +-<br>
> src/amd/common/ac_gpu_info.c | 6 ++++++<br>
> src/amd/common/ac_llvm_util.c | 1 +<br>
> src/amd/common/ac_surface.c | 4 ++++<br>
> src/amd/common/amd_family.h | 1 +<br>
> src/amd/common/gfx9d.h | 3 +++<br>
> src/gallium/drivers/radeonsi/si_pipe.c | 6 ++++--<br>
> src/gallium/drivers/radeonsi/si_state.c | 4 +++-<br>
> src/gallium/drivers/radeonsi/si_state_binning.c | 1 +<br>
> 10 files changed, 26 insertions(+), 4 deletions(-)<br>
><br>
> diff --git a/src/amd/addrlib/amdgpu_asic_addr.h b/src/amd/addrlib/amdgpu_asic_addr.h<br>
> index e5838d42a3c..7436c5493e1 100644<br>
> --- a/src/amd/addrlib/amdgpu_asic_addr.h<br>
> +++ b/src/amd/addrlib/amdgpu_asic_addr.h<br>
> @@ -83,20 +83,21 @@<br>
><br>
> #define AMDGPU_CARRIZO_RANGE 0x01, 0x21<br>
> #define AMDGPU_BRISTOL_RANGE 0x10, 0x21<br>
> #define AMDGPU_STONEY_RANGE 0x61, 0xFF<br>
><br>
> #define AMDGPU_VEGA10_RANGE 0x01, 0x14<br>
> #define AMDGPU_VEGA12_RANGE 0x14, 0x28<br>
> #define AMDGPU_VEGA20_RANGE 0x28, 0xFF<br>
><br>
> #define AMDGPU_RAVEN_RANGE 0x01, 0x81<br>
> +#define AMDGPU_RAVEN2_RANGE 0x81, 0xFF<br>
><br>
> #define AMDGPU_EXPAND_FIX(x) x<br>
> #define AMDGPU_RANGE_HELPER(val, min, max) ((val >= min) && (val < max))<br>
> #define AMDGPU_IN_RANGE(val, ...) AMDGPU_EXPAND_FIX(AMDGPU_RANGE_HELPER(val, __VA_ARGS__))<br>
><br>
><br>
> // ASICREV_IS(eRevisionId, revisionName)<br>
> #define ASICREV_IS(r, rn) AMDGPU_IN_RANGE(r, AMDGPU_##rn##_RANGE)<br>
> #define ASICREV_IS_TAHITI_P(r) ASICREV_IS(r, TAHITI)<br>
> #define ASICREV_IS_PITCAIRN_PM(r) ASICREV_IS(r, PITCAIRN)<br>
> @@ -125,12 +126,13 @@<br>
> #define ASICREV_IS_CARRIZO_BRISTOL(r) ASICREV_IS(r, BRISTOL)<br>
> #define ASICREV_IS_STONEY(r) ASICREV_IS(r, STONEY)<br>
><br>
> #define ASICREV_IS_VEGA10_M(r) ASICREV_IS(r, VEGA10)<br>
> #define ASICREV_IS_VEGA10_P(r) ASICREV_IS(r, VEGA10)<br>
> #define ASICREV_IS_VEGA12_P(r) ASICREV_IS(r, VEGA12)<br>
> #define ASICREV_IS_VEGA12_p(r) ASICREV_IS(r, VEGA12)<br>
> #define ASICREV_IS_VEGA20_P(r) ASICREV_IS(r, VEGA20)<br>
><br>
> #define ASICREV_IS_RAVEN(r) ASICREV_IS(r, RAVEN)<br>
> +#define ASICREV_IS_RAVEN2(r) ASICREV_IS(r, RAVEN2)<br>
><br>
> #endif // _AMDGPU_ASIC_ADDR_H<br>
> diff --git a/src/amd/addrlib/gfx9/gfx9addrlib.cpp b/src/amd/addrlib/gfx9/gfx9addrlib.cpp<br>
> index d27aabbb60c..f115242c89c 100644<br>
> --- a/src/amd/addrlib/gfx9/gfx9addrlib.cpp<br>
> +++ b/src/amd/addrlib/gfx9/gfx9addrlib.cpp<br>
> @@ -1284,21 +1284,21 @@ ChipFamily Gfx9Lib::HwlConvertChipFamily(<br>
> m_settings.htileAlignFix = 1;<br>
> m_settings.applyAliasFix = 1;<br>
> }<br>
><br>
> m_settings.metaBaseAlignFix = 1;<br>
><br>
> m_settings.depthPipeXorDisable = 1;<br>
> break;<br>
> case FAMILY_RV:<br>
> m_settings.isArcticIsland = 1;<br>
> - m_settings.isRaven = ASICREV_IS_RAVEN(uChipRevision);<br>
> + m_settings.isRaven = ASICREV_IS_RAVEN(uChipRevision) || ASICREV_IS_RAVEN2(uChipRevision);<br>
><br>
> if (m_settings.isRaven)<br>
> {<br>
> m_settings.isDcn1 = 1;<br>
> }<br>
><br>
> m_settings.metaBaseAlignFix = 1;<br>
><br>
> if (ASICREV_IS_RAVEN(uChipRevision))<br>
> {<br>
> diff --git a/src/amd/common/ac_gpu_info.c b/src/amd/common/ac_gpu_info.c<br>
> index 2c70fb2c721..689f544c18b 100644<br>
> --- a/src/amd/common/ac_gpu_info.c<br>
> +++ b/src/amd/common/ac_gpu_info.c<br>
> @@ -307,20 +307,26 @@ bool ac_query_gpu_info(int fd, amdgpu_device_handle dev,<br>
> info->name = #cfamily; \<br>
> break;<br>
> #include "pci_ids/radeonsi_pci_ids.h"<br>
> #undef CHIPSET<br>
><br>
> default:<br>
> fprintf(stderr, "amdgpu: Invalid PCI ID.\n");<br>
> return false;<br>
> }<br>
><br>
> + /* Raven2 uses the same PCI IDs as Raven1, but different revision IDs. */<br>
> + if (info->family == CHIP_RAVEN && amdinfo->chip_rev >= 0x8) {<br>
> + info->family = CHIP_RAVEN2;<br>
> + info->name = "RAVEN2";<br>
> + }<br>
> +<br>
> if (info->family >= CHIP_VEGA10)<br>
> info->chip_class = GFX9;<br>
> else if (info->family >= CHIP_TONGA)<br>
> info->chip_class = VI;<br>
> else if (info->family >= CHIP_BONAIRE)<br>
> info->chip_class = CIK;<br>
> else if (info->family >= CHIP_TAHITI)<br>
> info->chip_class = SI;<br>
> else {<br>
> fprintf(stderr, "amdgpu: Unknown family.\n");<br>
> diff --git a/src/amd/common/ac_llvm_util.c b/src/amd/common/ac_llvm_util.c<br>
> index cd3525187a0..76ee4d127a0 100644<br>
> --- a/src/amd/common/ac_llvm_util.c<br>
> +++ b/src/amd/common/ac_llvm_util.c<br>
> @@ -123,20 +123,21 @@ const char *ac_get_llvm_processor_name(enum radeon_family family)<br>
> return "stoney";<br>
> case CHIP_POLARIS10:<br>
> return "polaris10";<br>
> case CHIP_POLARIS11:<br>
> case CHIP_POLARIS12:<br>
> case CHIP_VEGAM:<br>
> return "polaris11";<br>
> case CHIP_VEGA10:<br>
> return "gfx900";<br>
> case CHIP_RAVEN:<br>
> + case CHIP_RAVEN2:<br>
> return "gfx902";<br>
> case CHIP_VEGA12:<br>
> return HAVE_LLVM >= 0x0700 ? "gfx904" : "gfx902";<br>
> case CHIP_VEGA20:<br>
> return HAVE_LLVM >= 0x0700 ? "gfx906" : "gfx902";<br>
> default:<br>
> return "";<br>
> }<br>
> }<br>
><br>
> diff --git a/src/amd/common/ac_surface.c b/src/amd/common/ac_surface.c<br>
> index 94723dc9c09..1f7e2344625 100644<br>
> --- a/src/amd/common/ac_surface.c<br>
> +++ b/src/amd/common/ac_surface.c<br>
> @@ -144,20 +144,24 @@ static void addrlib_family_rev_id(enum radeon_family family,<br>
> *addrlib_revid = get_first(AMDGPU_VEGA12_RANGE);<br>
> break;<br>
> case CHIP_VEGA20:<br>
> *addrlib_family = FAMILY_AI;<br>
> *addrlib_revid = get_first(AMDGPU_VEGA20_RANGE);<br>
> break;<br>
> case CHIP_RAVEN:<br>
> *addrlib_family = FAMILY_RV;<br>
> *addrlib_revid = get_first(AMDGPU_RAVEN_RANGE);<br>
> break;<br>
> + case CHIP_RAVEN2:<br>
> + *addrlib_family = FAMILY_RV;<br>
> + *addrlib_revid = get_first(AMDGPU_RAVEN2_RANGE);<br>
> + break;<br>
> default:<br>
> fprintf(stderr, "amdgpu: Unknown family.\n");<br>
> }<br>
> }<br>
><br>
> static void *ADDR_API allocSysMem(const ADDR_ALLOCSYSMEM_INPUT * pInput)<br>
> {<br>
> return malloc(pInput->sizeInBytes);<br>
> }<br>
><br>
> diff --git a/src/amd/common/amd_family.h b/src/amd/common/amd_family.h<br>
> index a282898be06..185ba029763 100644<br>
> --- a/src/amd/common/amd_family.h<br>
> +++ b/src/amd/common/amd_family.h<br>
> @@ -90,20 +90,21 @@ enum radeon_family {<br>
> CHIP_FIJI,<br>
> CHIP_STONEY,<br>
> CHIP_POLARIS10,<br>
> CHIP_POLARIS11,<br>
> CHIP_POLARIS12,<br>
> CHIP_VEGAM,<br>
> CHIP_VEGA10,<br>
> CHIP_VEGA12,<br>
> CHIP_VEGA20,<br>
> CHIP_RAVEN,<br>
> + CHIP_RAVEN2,<br>
> CHIP_LAST,<br>
> };<br>
><br>
> enum chip_class {<br>
> CLASS_UNKNOWN = 0,<br>
> R300,<br>
> R400,<br>
> R500,<br>
> R600,<br>
> R700,<br>
> diff --git a/src/amd/common/gfx9d.h b/src/amd/common/gfx9d.h<br>
> index d18e6655d33..2e790c54699 100644<br>
> --- a/src/amd/common/gfx9d.h<br>
> +++ b/src/amd/common/gfx9d.h<br>
> @@ -4450,20 +4450,23 @@<br>
> #define R_028424_CB_DCC_CONTROL 0x028424<br>
> #define S_028424_OVERWRITE_COMBINER_DISABLE(x) (((unsigned)(x) & 0x1) << 0)<br>
> #define G_028424_OVERWRITE_COMBINER_DISABLE(x) (((x) >> 0) & 0x1)<br>
> #define C_028424_OVERWRITE_COMBINER_DISABLE 0xFFFFFFFE<br>
> #define S_028424_OVERWRITE_COMBINER_MRT_SHARING_DISABLE(x) (((unsigned)(x) & 0x1) << 1)<br>
> #define G_028424_OVERWRITE_COMBINER_MRT_SHARING_DISABLE(x) (((x) >> 1) & 0x1)<br>
> #define C_028424_OVERWRITE_COMBINER_MRT_SHARING_DISABLE 0xFFFFFFFD<br>
> #define S_028424_OVERWRITE_COMBINER_WATERMARK(x) (((unsigned)(x) & 0x1F) << 2)<br>
> #define G_028424_OVERWRITE_COMBINER_WATERMARK(x) (((x) >> 2) & 0x1F)<br>
> #define C_028424_OVERWRITE_COMBINER_WATERMARK 0xFFFFFF83<br>
> +#define S_028424_DISABLE_CONSTANT_ENCODE_REG(x) (((unsigned)(x) & 0x1) << 10) /* Raven2+ */<br>
> +#define G_028424_DISABLE_CONSTANT_ENCODE_REG(x) (((x) >> 10) & 0x1)<br>
> +#define C_028424_DISABLE_CONSTANT_ENCODE_REG 0xFFFFFBFF<br>
> #define R_02842C_DB_STENCIL_CONTROL 0x02842C<br>
> #define S_02842C_STENCILFAIL(x) (((unsigned)(x) & 0x0F) << 0)<br>
> #define G_02842C_STENCILFAIL(x) (((x) >> 0) & 0x0F)<br>
> #define C_02842C_STENCILFAIL 0xFFFFFFF0<br>
> #define S_02842C_STENCILZPASS(x) (((unsigned)(x) & 0x0F) << 4)<br>
> #define G_02842C_STENCILZPASS(x) (((x) >> 4) & 0x0F)<br>
> #define C_02842C_STENCILZPASS 0xFFFFFF0F<br>
> #define S_02842C_STENCILZFAIL(x) (((unsigned)(x) & 0x0F) << 8)<br>
> #define G_02842C_STENCILZFAIL(x) (((x) >> 8) & 0x0F)<br>
> #define C_02842C_STENCILZFAIL 0xFFFFF0FF<br>
> diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c<br>
> index 6118b8076f1..6e268ed4a7c 100644<br>
> --- a/src/gallium/drivers/radeonsi/si_pipe.c<br>
> +++ b/src/gallium/drivers/radeonsi/si_pipe.c<br>
> @@ -1026,23 +1026,24 @@ struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws,<br>
> sscreen->has_msaa_sample_loc_bug = (sscreen->info.family >= CHIP_POLARIS10 &&<br>
> sscreen->info.family <= CHIP_POLARIS12) ||<br>
> sscreen->info.family == CHIP_VEGA10 ||<br>
> sscreen->info.family == CHIP_RAVEN;<br>
> sscreen->has_ls_vgpr_init_bug = sscreen->info.family == CHIP_VEGA10 ||<br>
> sscreen->info.family == CHIP_RAVEN;<br>
><br>
> if (sscreen->debug_flags & DBG(DPBB)) {<br>
> sscreen->dpbb_allowed = true;<br>
> } else {<br>
> - /* Only enable primitive binning on Raven by default. */<br>
> + /* Only enable primitive binning on APUs by default. */<br>
> /* TODO: Investigate if binning is profitable on Vega12. */<br>
> sscreen->dpbb_allowed = sscreen->info.family == CHIP_RAVEN &&<br>
> + sscreen->info.family == CHIP_RAVEN2 &&<br>
<br>
I think you meant to do || here, as family cannot be CHIP_RAVEN and<br>
CHIP_RAVEN2 at the same time.<br></blockquote><div><br></div><div>Thanks. I sent out v2.</div><div><br></div><div>Marek</div><br></div></div>