drm/amdgpu/gfx9: use hweight for calculating num_rbs
Subsystems (2)
PATCH 1/3 drm/amdgpu/gfx9: use hweight for calculating num_rbs
Match what we do for other asics.
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2 -5
@@ -1225,7 +1225,7 @@ static u32 gfx_v9_0_get_rb_active_bitmap(struct amdgpu_device *adev)static void gfx_v9_0_setup_rb (struct amdgpu_device *adev) {int i, j; -u32 data, tmp, num_rbs =0 ; +u32 data;u32 active_rbs =0 ;u32 rb_bitmap_width_per_sh = adev->gfx.config.max_backends_per_se / adev->gfx.config.max_sh_per_se;
@@ -1243,10 +1243,7 @@ static void gfx_v9_0_setup_rb(struct amdgpu_device *adev)mutex_unlock (&adev->grbm_idx_mutex); adev->gfx.config.backend_enable_mask = active_rbs; - tmp = active_rbs; -while (tmp >>=1 ) - num_rbs++; - adev->gfx.config.num_rbs = num_rbs; + adev->gfx.config.num_rbs =hweight32 (active_rbs); }#define DEFAULT_SH_MEM_BASES (0x6000)
Signature · 6 lines
2.5.5 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1490382798-4472-1-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org
PATCH 2/3 drm/amdgpu/gfx9: cache RB harvest registers
So we don't have to look this up via MMIO when users request the value via ioctl.
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +5 -0
@@ -1237,6 +1237,11 @@ static void gfx_v9_0_setup_rb(struct amdgpu_device *adev) data =gfx_v9_0_get_rb_active_bitmap (adev); active_rbs |= data << ((i * adev->gfx.config.max_sh_per_se + j) * rb_bitmap_width_per_sh); +/* cache the values for userspace */ + adev->gfx.config.rb_config[i][j].rb_backend_disable = +RREG32 (SOC15_REG_OFFSET (GC ,0 , mmCC_RB_BACKEND_DISABLE)); + adev->gfx.config.rb_config[i][j].user_rb_backend_disable = +RREG32 (SOC15_REG_OFFSET (GC ,0 , mmGC_USER_RB_BACKEND_DISABLE)); } }gfx_v9_0_select_se_sh (adev,0xffffffff ,0xffffffff ,0xffffffff );
Signature · 6 lines
2.5.5 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/3 drm/amdgpu/soc15: return cached values for some registers
In reply to a message not in the archiveRequired for SR-IOV and saves MMIO transactions.
--- drivers/gpu/drm/amd/amdgpu/soc15.c | 40 ++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/soc15.c +32 -8
@@ -322,6 +322,32 @@ static uint32_t soc15_read_indexed_register(struct amdgpu_device *adev, u32 se_nreturn val; } +static uint32_t soc15_get_register_value (struct amdgpu_device *adev, +bool indexed,u32 se_num, +u32 sh_num,u32 reg_offset) +{ +if (indexed) { +unsigned se_idx = (se_num ==0xffffffff ) ?0 : se_num; +unsigned sh_idx = (sh_num ==0xffffffff ) ?0 : sh_num; + +switch (reg_offset) { +case SOC15_REG_OFFSET (GC ,0 , mmCC_RB_BACKEND_DISABLE): +return adev->gfx.config.rb_config[se_idx][sh_idx].rb_backend_disable; +case SOC15_REG_OFFSET (GC ,0 , mmGC_USER_RB_BACKEND_DISABLE): +return adev->gfx.config.rb_config[se_idx][sh_idx].user_rb_backend_disable; + } + +return soc15_read_indexed_register (adev, se_num, sh_num, reg_offset); + }else { +switch (reg_offset) { +case SOC15_REG_OFFSET (GC ,0 , mmGB_ADDR_CONFIG): +return adev->gfx.config.gb_addr_config; +default : +return RREG32 (reg_offset); + } + } +} +static int soc15_read_register (struct amdgpu_device *adev,u32 se_num,u32 sh_num,u32 reg_offset,u32 *value) {
@@ -345,10 +371,9 @@ static int soc15_read_register(struct amdgpu_device *adev, u32 se_num,if (reg_offset != asic_register_entry->reg_offset)continue ;if (!asic_register_entry->untouched) - *value = asic_register_entry->grbm_indexed ? -soc15_read_indexed_register (adev, se_num, - sh_num, reg_offset) : -RREG32 (reg_offset); + *value =soc15_get_register_value (adev, + asic_register_entry->grbm_indexed, + se_num, sh_num, reg_offset);return 0 ; } }
@@ -358,10 +383,9 @@ static int soc15_read_register(struct amdgpu_device *adev, u32 se_num,continue ;if (!soc15_allowed_read_registers[i].untouched) - *value = soc15_allowed_read_registers[i].grbm_indexed ? -soc15_read_indexed_register (adev, se_num, - sh_num, reg_offset) : -RREG32 (reg_offset); + *value =soc15_get_register_value (adev, + soc15_allowed_read_registers[i].grbm_indexed, + se_num, sh_num, reg_offset);return 0 ; }return -EINVAL ;
Signature · 6 lines
2.5.5 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1490382798-4472-3-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org
Re: [PATCH 3/3] drm/amdgpu/soc15: return cached values for some registers
Am 24.03.2017 um 20:13 schrieb Alex Deucher:
Quoted 3 lines
Required for SR-IOV and saves MMIO transactions.
Signed-off-by Alex Deucher <[email protected]>
As far as I can see they are not used any more by userspace and the same info is available in enabled_rb_pipes_mask.
So why do you want to keep them?
Regards,
Christian.
Quoted 59 lines
--- drivers/gpu/drm/amd/amdgpu/soc15.c | 40 ++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-)drivers/gpu/drm/amd/amdgpu/soc15.c +29
-4@@ -322,6 +322,32 @@ static uint32_t soc15_read_indexed_register(struct amdgpu_device *adev, u32 se_nreturn val; } +static uint32_t soc15_get_register_value (struct amdgpu_device *adev, +bool indexed,u32 se_num, +u32 sh_num,u32 reg_offset) +{ +if (indexed) { +unsigned se_idx = (se_num ==0xffffffff ) ?0 : se_num; +unsigned sh_idx = (sh_num ==0xffffffff ) ?0 : sh_num; + +switch (reg_offset) { +case SOC15_REG_OFFSET (GC ,0 , mmCC_RB_BACKEND_DISABLE): +return adev->gfx.config.rb_config[se_idx][sh_idx].rb_backend_disable; +case SOC15_REG_OFFSET (GC ,0 , mmGC_USER_RB_BACKEND_DISABLE): +return adev->gfx.config.rb_config[se_idx][sh_idx].user_rb_backend_disable; + } + +return soc15_read_indexed_register (adev, se_num, sh_num, reg_offset); + }else { +switch (reg_offset) { +case SOC15_REG_OFFSET (GC ,0 , mmGB_ADDR_CONFIG): +return adev->gfx.config.gb_addr_config; +default : +return RREG32 (reg_offset); + } + } +} +static int soc15_read_register (struct amdgpu_device *adev,u32 se_num,u32 sh_num,u32 reg_offset,u32 *value) {@@ -345,10 +371,9 @@ static int soc15_read_register(struct amdgpu_device *adev, u32 se_num,if (reg_offset != asic_register_entry->reg_offset)continue ;if (!asic_register_entry->untouched) - *value = asic_register_entry->grbm_indexed ? -soc15_read_indexed_register (adev, se_num, - sh_num, reg_offset) : -RREG32 (reg_offset); + *value =soc15_get_register_value (adev, + asic_register_entry->grbm_indexed, + se_num, sh_num, reg_offset);return 0 ; } }@@ -358,10 +383,9 @@ static int soc15_read_register(struct amdgpu_device *adev, u32 se_num,continue ;if (!soc15_allowed_read_registers[i].untouched)
drivers/gpu/drm/amd/amdgpu/soc15.c static int soc15_read_register(struct amdgpu_device *adev, u32 se_num, · line 391
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/soc15.c +3
-4- *value = soc15_allowed_read_registers[i].grbm_indexed ? -soc15_read_indexed_register (adev, se_num, - sh_num, reg_offset) : -RREG32 (reg_offset); + *value =soc15_get_register_value (adev, + soc15_allowed_read_registers[i].grbm_indexed, + se_num, sh_num, reg_offset);return 0 ; }return -EINVAL ;
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 612aa266-669d-387c-d693-99224ad3d71a-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org
Re: [PATCH 3/3] drm/amdgpu/soc15: return cached values for some registers
Quoted 11 lines · Christian König
Am 24.03.2017 um 20:13 schrieb Alex Deucher:
Quoted 4 lines
Required for SR-IOV and saves MMIO transactions.
Signed-off-by Alex Deucher <[email protected]>As far as I can see they are not used any more by userspace and the same info is available in
enabled_rb_pipes_mask.So why do you want to keep them?
Does anything use mmGB_ADDR_CONFIG? If not, I agree, we can drop the whole thing. Not sure if any of the closed UMDs use them or not off hand.
Alex
Quoted 82 lines
Regards,
Christian.Quoted 77 lines
--- drivers/gpu/drm/amd/amdgpu/soc15.c | 40 ++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-)drivers/gpu/drm/amd/amdgpu/soc15.c +0
-0@@ -322,6 +322,32 @@ static uint32_t soc15_read_indexed_register(struct
amdgpu_device*adev, u32se_nreturn val;}
+staticuint32_tsoc15_get_register_value(structamdgpu_device*adev,drivers/gpu/drm/amd/amdgpu/soc15.c +10
-0+ bool indexed, u32 se_num, + u32 sh_num, u32 reg_offset) +{ + if (indexed) { + unsigned se_idx = (se_num == 0xffffffff) ? 0 : se_num; +unsigned sh_idx = (sh_num ==0xffffffff ) ?0 : sh_num; + +switch (reg_offset) { +case SOC15_REG_OFFSET (GC ,0 , mmCC_RB_BACKEND_DISABLE): +return adev->gfx.config.rb_config[se_idx][sh_idx].rb_backend_disable;
+ case SOC15_REG_OFFSET(GC, 0,mmGC_USER_RB_BACKEND_DISABLE):
+ return
adev->gfx.config.rb_config[se_idx][sh_idx].user_rb_backend_disable;drivers/gpu/drm/amd/amdgpu/soc15.c +3
-0+ } + + return soc15_read_indexed_register(adev, se_num, sh_num,
reg_offset);drivers/gpu/drm/amd/amdgpu/soc15.c +10
-1+ }else { +switch (reg_offset) { +case SOC15_REG_OFFSET (GC ,0 , mmGB_ADDR_CONFIG): +return adev->gfx.config.gb_addr_config; +default : +return RREG32 (reg_offset); + } + } +} +static int soc15_read_register (struct amdgpu_device *adev,u32 se_num,u32 sh_num,u32 reg_offset,u32 *value) {@@ -345,10 +371,9 @@ static int soc15_read_register(struct amdgpu_device *adev, u32 se_num, if (reg_offset != asic_register_entry->reg_offset) continue;if (!asic_register_entry->untouched) - *value = asic_register_entry->grbm_indexed?
- soc15_read_indexed_register(adev,se_num,
-sh_num,reg_offset) :drivers/gpu/drm/amd/amdgpu/soc15.c +2
-1-RREG32 (reg_offset); + *value = soc15_get_register_value(adev, +
asic_register_entry->grbm_indexed,
+se_num,sh_num, reg_offset); return 0; } }drivers/gpu/drm/amd/amdgpu/soc15.c +0
-1@@ -358,10 +383,9 @@ static int soc15_read_register(struct amdgpu_device *adev, u32 se_num, continue;if (!soc15_allowed_read_registers[i].untouched) - *value =soc15_allowed_read_registers[i].grbm_indexed ?
drivers/gpu/drm/amd/amdgpu/soc15.c +0
-2- soc15_read_indexed_register(adev, se_num, - sh_num,
reg_offset) :
-RREG32(reg_offset);
Quoted 11 lines
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/soc15.c +2
-0+ *value = soc15_get_register_value(adev, +soc15_allowed_read_registers[i].grbm_indexed,
+se_num,sh_num,reg_offset); return 0; } return -EINVAL;
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): CADnq5_PyyytKtZ7r5cNqvms_+Nfye0QzqgESF+QbMtQK3OYCBw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Re: [PATCH 3/3] drm/amdgpu/soc15: return cached values for some registers
We're reporting gb_addr_config to user mode in our KFD tiling info API.
If this is no longer needed by user mode for soc15, we could just put in a dummy value. However, I haven't been told that it can be removed for older ASICs.
Regards,
Felix
Quoted 108 lines · Alex Deucher
Quoted 9 lines · Christian König
Am 24.03.2017 um 20:13 schrieb Alex Deucher:
Quoted 3 lines
Required for SR-IOV and saves MMIO transactions.
Signed-off-by Alex Deucher <[email protected]>As far as I can see they are not used any more by userspace and the same info is available in
enabled_rb_pipes_mask.So why do you want to keep them?
Does anything use
mmGB_ADDR_CONFIG? If not, I agree, we can drop the whole thing. Not sure if any of the closed UMDs use them or not off hand.Alex
Quoted 81 lines
Regards,
Christian.Quoted 77 lines
--- drivers/gpu/drm/amd/amdgpu/soc15.c | 40 ++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-)drivers/gpu/drm/amd/amdgpu/soc15.c +0
-0@@ -322,6 +322,32 @@ static uint32_t soc15_read_indexed_register(struct
amdgpu_device*adev, u32se_nreturn val;}
+staticuint32_tsoc15_get_register_value(structamdgpu_device*adev,drivers/gpu/drm/amd/amdgpu/soc15.c +10
-0+ bool indexed, u32 se_num, + u32 sh_num, u32 reg_offset) +{ + if (indexed) { + unsigned se_idx = (se_num == 0xffffffff) ? 0 : se_num; +unsigned sh_idx = (sh_num ==0xffffffff ) ?0 : sh_num; + +switch (reg_offset) { +case SOC15_REG_OFFSET (GC ,0 , mmCC_RB_BACKEND_DISABLE): +return adev->gfx.config.rb_config[se_idx][sh_idx].rb_backend_disable;
+ case SOC15_REG_OFFSET(GC, 0,mmGC_USER_RB_BACKEND_DISABLE):
+ return
adev->gfx.config.rb_config[se_idx][sh_idx].user_rb_backend_disable;drivers/gpu/drm/amd/amdgpu/soc15.c +3
-0+ } + + return soc15_read_indexed_register(adev, se_num, sh_num,
reg_offset);drivers/gpu/drm/amd/amdgpu/soc15.c +10
-1+ }else { +switch (reg_offset) { +case SOC15_REG_OFFSET (GC ,0 , mmGB_ADDR_CONFIG): +return adev->gfx.config.gb_addr_config; +default : +return RREG32 (reg_offset); + } + } +} +static int soc15_read_register (struct amdgpu_device *adev,u32 se_num,u32 sh_num,u32 reg_offset,u32 *value) {@@ -345,10 +371,9 @@ static int soc15_read_register(struct amdgpu_device *adev, u32 se_num, if (reg_offset != asic_register_entry->reg_offset) continue;if (!asic_register_entry->untouched) - *value = asic_register_entry->grbm_indexed?
- soc15_read_indexed_register(adev,se_num,
-sh_num,reg_offset) :drivers/gpu/drm/amd/amdgpu/soc15.c +2
-1-RREG32 (reg_offset); + *value = soc15_get_register_value(adev, +
asic_register_entry->grbm_indexed,
+se_num,sh_num, reg_offset); return 0; } }drivers/gpu/drm/amd/amdgpu/soc15.c +0
-1@@ -358,10 +383,9 @@ static int soc15_read_register(struct amdgpu_device *adev, u32 se_num, continue;if (!soc15_allowed_read_registers[i].untouched) - *value =soc15_allowed_read_registers[i].grbm_indexed ?
drivers/gpu/drm/amd/amdgpu/soc15.c +0
-2- soc15_read_indexed_register(adev, se_num, - sh_num,
reg_offset) :
-RREG32(reg_offset);Quoted 10 lines
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/soc15.c +2
-0+ *value = soc15_get_register_value(adev, +soc15_allowed_read_registers[i].grbm_indexed,
+se_num,sh_num,reg_offset); return 0; } return -EINVAL;
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): dee1c90b-9194-b6b9-96e0-e6e405e82a37-5C7GfCeVMHo@public.gmane.org
Re: [PATCH 3/3] drm/amdgpu/soc15: return cached values for some registers
Sorry, I wasn't clear about this. GB_ADDR_CONFIG is still needed even in Vega10.
But CC_RB_BACKEND_DISABLE and GC_USER_RB_BACKEND_DISABLE aren't used any more as far as I can see.
The mask resulting from those two registers is computed during GFX9 startup, cached and given to user mode in enabled_rb_pipes_mask.
I think we should disallow reading CC_RB_BACKEND_DISABLE and GC_USER_RB_BACKEND_DISABLE through this interface.
Regards,
Christian.
Am 24.03.2017 um 21:08 schrieb Felix Kuehling:
Quoted 117 lines
We're reporting
gb_addr_configto user mode in our KFD tiling info API.If this is no longer needed by user mode for soc15, we could just put in a dummy value. However, I haven't been told that it can be removed for older ASICs.
Regards,
FelixQuoted 106 lines · Alex Deucher
Quoted 8 lines · Christian König
Am 24.03.2017 um 20:13 schrieb Alex Deucher:
Quoted 3 lines
Required for SR-IOV and saves MMIO transactions.
Signed-off-by Alex Deucher <[email protected]>As far as I can see they are not used any more by userspace and the same info is available in
enabled_rb_pipes_mask.So why do you want to keep them?
Does anything use
mmGB_ADDR_CONFIG? If not, I agree, we can drop the whole thing. Not sure if any of the closed UMDs use them or not off hand.Alex
Quoted 90 lines
Regards,
Christian.Quoted 85 lines
--- drivers/gpu/drm/amd/amdgpu/soc15.c | 40 ++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-)drivers/gpu/drm/amd/amdgpu/soc15.c +0
-0@@ -322,6 +322,32 @@ static uint32_t soc15_read_indexed_register(struct
amdgpu_device*adev, u32se_nreturn val;}
+staticuint32_tsoc15_get_register_value(structamdgpu_device*adev,drivers/gpu/drm/amd/amdgpu/soc15.c +10
-0+ bool indexed, u32 se_num, + u32 sh_num, u32 reg_offset) +{ + if (indexed) { + unsigned se_idx = (se_num == 0xffffffff) ? 0 : se_num; +unsigned sh_idx = (sh_num ==0xffffffff ) ?0 : sh_num; + +switch (reg_offset) { +case SOC15_REG_OFFSET (GC ,0 , mmCC_RB_BACKEND_DISABLE): +return adev->gfx.config.rb_config[se_idx][sh_idx].rb_backend_disable;
+ case SOC15_REG_OFFSET(GC, 0,mmGC_USER_RB_BACKEND_DISABLE):
+ return
adev->gfx.config.rb_config[se_idx][sh_idx].user_rb_backend_disable;drivers/gpu/drm/amd/amdgpu/soc15.c +3
-0+ } + + return soc15_read_indexed_register(adev, se_num, sh_num,
reg_offset);drivers/gpu/drm/amd/amdgpu/soc15.c +10
-1+ }else { +switch (reg_offset) { +case SOC15_REG_OFFSET (GC ,0 , mmGB_ADDR_CONFIG): +return adev->gfx.config.gb_addr_config; +default : +return RREG32 (reg_offset); + } + } +} +static int soc15_read_register (struct amdgpu_device *adev,u32 se_num,u32 sh_num,u32 reg_offset,u32 *value) {@@ -345,10 +371,9 @@ static int soc15_read_register(struct amdgpu_device *adev, u32 se_num, if (reg_offset != asic_register_entry->reg_offset) continue;if (!asic_register_entry->untouched) - *value = asic_register_entry->grbm_indexed?
- soc15_read_indexed_register(adev,se_num,
-sh_num,reg_offset) :drivers/gpu/drm/amd/amdgpu/soc15.c +2
-1-RREG32 (reg_offset); + *value = soc15_get_register_value(adev, +
asic_register_entry->grbm_indexed,
+se_num,sh_num, reg_offset); return 0; } }drivers/gpu/drm/amd/amdgpu/soc15.c +0
-1@@ -358,10 +383,9 @@ static int soc15_read_register(struct amdgpu_device *adev, u32 se_num, continue;if (!soc15_allowed_read_registers[i].untouched) - *value =soc15_allowed_read_registers[i].grbm_indexed ?
drivers/gpu/drm/amd/amdgpu/soc15.c +0
-2- soc15_read_indexed_register(adev, se_num, - sh_num,
reg_offset) :drivers/gpu/drm/amd/amdgpu/soc15.c +2
-1-RREG32 (reg_offset); + *value = soc15_get_register_value(adev, +soc15_allowed_read_registers[i].grbm_indexed,
+se_num,sh_num,reg_offset); return 0; } return -EINVAL;
Quoted 8 lines
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): fb404fa2-064c-68f7-fe48-db281ea2f3f6-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org
Re: [PATCH 3/3] drm/amdgpu/soc15: return cached values for some registers
Quoted 8 lines · Christian König
Sorry, I wasn't clear about this.
GB_ADDR_CONFIGis still needed even in Vega10.But
CC_RB_BACKEND_DISABLEandGC_USER_RB_BACKEND_DISABLEaren't used any more as far as I can see.The mask resulting from those two registers is computed during GFX9 startup, cached and given to user mode in
enabled_rb_pipes_mask.
Sounds good. KFD doesn't expose MMIO register directly to user mode. We return the cached gb_addr_config, enabled CUs in adev->gfx.cu_info, and tiling mode arrays in adev->gfx.config, but we don't use any information about RBs.
Regards,
Felix
Quoted 153 lines
I think we should disallow reading
CC_RB_BACKEND_DISABLEandGC_USER_RB_BACKEND_DISABLEthrough this interface.Regards,
Christian.Am 24.03.2017 um 21:08 schrieb Felix Kuehling:
Quoted 143 lines
We're reporting
gb_addr_configto user mode in our KFD tiling info API.If this is no longer needed by user mode for soc15, we could just put in a dummy value. However, I haven't been told that it can be removed for older ASICs.
Regards,
FelixQuoted 124 lines · Alex Deucher
Quoted 9 lines · Christian König
Am 24.03.2017 um 20:13 schrieb Alex Deucher:
Quoted 3 lines
Required for SR-IOV and saves MMIO transactions.
Signed-off-by Alex Deucher <[email protected]>As far as I can see they are not used any more by userspace and the same
info is available inenabled_rb_pipes_mask.So why do you want to keep them?
Does anything use
mmGB_ADDR_CONFIG? If not, I agree, we can drop the whole thing. Not sure if any of the closed UMDs use them or not off hand.Alex
Quoted 98 lines
Regards,
Christian.Quoted 94 lines
--- drivers/gpu/drm/amd/amdgpu/soc15.c | 40 ++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-)drivers/gpu/drm/amd/amdgpu/soc15.c +0
-0@@ -322,6 +322,32 @@ static uint32_tsoc15_read_indexed_register(struct
amdgpu_device*adev, u32se_nreturn val;}
+staticuint32_tsoc15_get_register_value(structamdgpu_device
*adev,drivers/gpu/drm/amd/amdgpu/soc15.c +5
-0+ bool indexed, u32 se_num, + u32 sh_num, u32 reg_offset) +{ + if (indexed) { + unsigned se_idx = (se_num == 0xffffffff) ? 0 :
se_num;
+ unsignedsh_idx= (sh_num==0xffffffff) ? 0 :sh_num;drivers/gpu/drm/amd/amdgpu/soc15.c +3
-0+ +switch (reg_offset) { + case SOC15_REG_OFFSET(GC, 0,
mmCC_RB_BACKEND_DISABLE):
+ return
adev->gfx.config.rb_config[se_idx][sh_idx].rb_backend_disable;
+ case SOC15_REG_OFFSET(GC, 0,mmGC_USER_RB_BACKEND_DISABLE):
+ return
adev->gfx.config.rb_config[se_idx][sh_idx].user_rb_backend_disable;drivers/gpu/drm/amd/amdgpu/soc15.c +3
-0+ } + + return soc15_read_indexed_register(adev, se_num,
sh_num,reg_offset);drivers/gpu/drm/amd/amdgpu/soc15.c +10
-0+ }else { +switch (reg_offset) { +case SOC15_REG_OFFSET (GC ,0 , mmGB_ADDR_CONFIG): +return adev->gfx.config.gb_addr_config; +default : +return RREG32 (reg_offset); + } + } +} + static int soc15_read_register(struct amdgpu_device *adev, u32
se_num,u32 sh_num, u32 reg_offset, u32 *value){
drivers/gpu/drm/amd/amdgpu/soc15.c +0
-0@@ -345,10 +371,9 @@ static int soc15_read_register(struct
amdgpu_device
*adev, u32se_num,if (reg_offset != asic_register_entry->reg_offset) continue; if (!asic_register_entry->untouched)- *value =
asic_register_entry->grbm_indexed
?
-
soc15_read_indexed_register(adev,se_num,
-sh_num,reg_offset) :drivers/gpu/drm/amd/amdgpu/soc15.c +1
-1-RREG32 (reg_offset); + *value =soc15_get_register_value(adev,
+asic_register_entry->grbm_indexed,
+se_num,sh_num, reg_offset); return 0; } }drivers/gpu/drm/amd/amdgpu/soc15.c +0
-0@@ -358,10 +383,9 @@ static int soc15_read_register(struct
amdgpu_device
*adev, u32se_num,continue; if (!soc15_allowed_read_registers[i].untouched)- *value =
soc15_allowed_read_registers[i].grbm_indexed ?
- soc15_read_indexed_register(adev,se_num,
-sh_num,reg_offset) :drivers/gpu/drm/amd/amdgpu/soc15.c +1
-1-RREG32 (reg_offset); + *value = soc15_get_register_value(adev,Quoted 9 lines
Quoted 8 lines
+
soc15_allowed_read_registers[i].grbm_indexed,
+se_num,sh_num,reg_offset); return 0; } return -EINVAL;Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx