[Mesa-dev,1/2] radeonsi: add support for Stoney asics (v2)

Submitted by Alex Deucher on Oct. 22, 2015, 4:09 p.m.

Details

Message ID 1445530189-9265-1-git-send-email-alexander.deucher@amd.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Alex Deucher Oct. 22, 2015, 4:09 p.m.
From: Samuel Li <samuel.li@amd.com>

v2 (agd): rebase on mesa master, split pci ids to
separate commit

Signed-off-by: Samuel Li <samuel.li@amd.com>
---
 src/gallium/drivers/radeon/r600_pipe_common.c | 2 ++
 src/gallium/drivers/radeon/radeon_winsys.h    | 1 +
 src/gallium/drivers/radeonsi/si_state.c       | 1 +
 src/gallium/winsys/amdgpu/drm/amdgpu_id.h     | 8 ++++++--
 src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c | 6 +++++-
 5 files changed, 15 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c
index 7ac94ca..6dc27b3 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.c
+++ b/src/gallium/drivers/radeon/r600_pipe_common.c
@@ -416,6 +416,7 @@  static const char* r600_get_chip_name(struct r600_common_screen *rscreen)
 	case CHIP_ICELAND: return "AMD ICELAND";
 	case CHIP_CARRIZO: return "AMD CARRIZO";
 	case CHIP_FIJI: return "AMD FIJI";
+	case CHIP_STONEY: return "AMD STONEY";
 	default: return "AMD unknown";
 	}
 }
@@ -540,6 +541,7 @@  const char *r600_get_llvm_processor_name(enum radeon_family family)
 	case CHIP_ICELAND: return "iceland";
 	case CHIP_CARRIZO: return "carrizo";
 	case CHIP_FIJI: return "fiji";
+	case CHIP_STONEY: return "stoney";
 	default: return "";
 	}
 }
diff --git a/src/gallium/drivers/radeon/radeon_winsys.h b/src/gallium/drivers/radeon/radeon_winsys.h
index b91e1ad..5f13c1e 100644
--- a/src/gallium/drivers/radeon/radeon_winsys.h
+++ b/src/gallium/drivers/radeon/radeon_winsys.h
@@ -137,6 +137,7 @@  enum radeon_family {
     CHIP_ICELAND,
     CHIP_CARRIZO,
     CHIP_FIJI,
+    CHIP_STONEY,
     CHIP_LAST,
 };
 
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index 243bdc6..a71ff49 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -3336,6 +3336,7 @@  static void si_init_config(struct si_context *sctx)
 		break;
 	case CHIP_KABINI:
 	case CHIP_MULLINS:
+	case CHIP_STONEY:
 		raster_config = 0x00000000;
 		raster_config_1 = 0x00000000;
 		break;
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_id.h b/src/gallium/winsys/amdgpu/drm/amdgpu_id.h
index 8882c41..90fe0cd 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_id.h
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_id.h
@@ -151,11 +151,15 @@  enum {
 
 /* CZ specific rev IDs */
 enum {
-	CZ_CARRIZO_A0      = 0x01,
+	CARRIZO_A0   = 0x01,
+    STONEY_A0    = 0x61,
 	CZ_UNKNOWN      = 0xFF
 };
 
 #define ASICREV_IS_CARRIZO(eChipRev) \
-	(eChipRev >= CARRIZO_A0)
+	((eChipRev >= CARRIZO_A0) && (eChipRev < STONEY_A0))
+
+#define ASICREV_IS_STONEY(eChipRev) \
+	((eChipRev >= STONEY_A0) && (eChipRev < CZ_UNKNOWN))
 
 #endif /* AMDGPU_ID_H */
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
index c877249..32cd9d9 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
@@ -226,7 +226,11 @@  static boolean do_winsys_init(struct amdgpu_winsys *ws)
       break;
    case CHIP_CARRIZO:
       ws->family = FAMILY_CZ;
-      ws->rev_id = CZ_CARRIZO_A0;
+      ws->rev_id = CARRIZO_A0;
+      break;
+   case CHIP_STONEY:
+      ws->family = FAMILY_CZ;
+      ws->rev_id = STONEY_A0;
       break;
    case CHIP_FIJI:
       ws->family = FAMILY_VI;

Comments

On 23.10.2015 01:09, Alex Deucher wrote:
> From: Samuel Li <samuel.li@amd.com>
> 
> v2 (agd): rebase on mesa master, split pci ids to
> separate commit
> 
> Signed-off-by: Samuel Li <samuel.li@amd.com>

[...]

> @@ -540,6 +541,7 @@ const char *r600_get_llvm_processor_name(enum radeon_family family)
>  	case CHIP_ICELAND: return "iceland";
>  	case CHIP_CARRIZO: return "carrizo";
>  	case CHIP_FIJI: return "fiji";
> +	case CHIP_STONEY: return "stoney";
>  	default: return "";
>  	}
>  }

Do we need a fallback here for existing versions of LLVM which don't
recognize "stoney" yet?

Other than that, looks good to me.


Patch 2 is

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
On Thu, Oct 22, 2015 at 10:44 PM, Michel Dänzer <michel@daenzer.net> wrote:
> On 23.10.2015 01:09, Alex Deucher wrote:
>> From: Samuel Li <samuel.li@amd.com>
>>
>> v2 (agd): rebase on mesa master, split pci ids to
>> separate commit
>>
>> Signed-off-by: Samuel Li <samuel.li@amd.com>
>
> [...]
>
>> @@ -540,6 +541,7 @@ const char *r600_get_llvm_processor_name(enum radeon_family family)
>>       case CHIP_ICELAND: return "iceland";
>>       case CHIP_CARRIZO: return "carrizo";
>>       case CHIP_FIJI: return "fiji";
>> +     case CHIP_STONEY: return "stoney";
>>       default: return "";
>>       }
>>  }
>
> Do we need a fallback here for existing versions of LLVM which don't
> recognize "stoney" yet?

Is there a way to check if a particular llvm version supports a
specific processor name?  Or should we just do something like return
carrizo for llvm 3.7 and stoney for newer versions?

Alex

>
> Other than that, looks good to me.
>
>
> Patch 2 is
>
> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
>
>
> --
> Earthling Michel Dänzer               |               http://www.amd.com
> Libre software enthusiast             |             Mesa and X developer
On Fri, Oct 23, 2015 at 5:11 PM, Alex Deucher <alexdeucher@gmail.com> wrote:
> On Thu, Oct 22, 2015 at 10:44 PM, Michel Dänzer <michel@daenzer.net> wrote:
>> On 23.10.2015 01:09, Alex Deucher wrote:
>>> From: Samuel Li <samuel.li@amd.com>
>>>
>>> v2 (agd): rebase on mesa master, split pci ids to
>>> separate commit
>>>
>>> Signed-off-by: Samuel Li <samuel.li@amd.com>
>>
>> [...]
>>
>>> @@ -540,6 +541,7 @@ const char *r600_get_llvm_processor_name(enum radeon_family family)
>>>       case CHIP_ICELAND: return "iceland";
>>>       case CHIP_CARRIZO: return "carrizo";
>>>       case CHIP_FIJI: return "fiji";
>>> +     case CHIP_STONEY: return "stoney";
>>>       default: return "";
>>>       }
>>>  }
>>
>> Do we need a fallback here for existing versions of LLVM which don't
>> recognize "stoney" yet?
>
> Is there a way to check if a particular llvm version supports a
> specific processor name?  Or should we just do something like return
> carrizo for llvm 3.7 and stoney for newer versions?

We should just return "carrizo" for LLVM <= 3.7.

Marek