All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/5] drm/amdgpu: make sriov bios detection generic (v2)
@ 2016-09-19 18:44 Alex Deucher
       [not found] ` <1474310655-3094-1-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Alex Deucher @ 2016-09-19 18:44 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Alex Deucher

It's not asic specific.

v2: drop asic macro

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h        | 2 --
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 9 +++++++--
 drivers/gpu/drm/amd/amdgpu/vi.c            | 7 -------
 3 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index ff6e683..fb8d603 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -1828,7 +1828,6 @@ struct amdgpu_asic_funcs {
 	bool (*read_bios_from_rom)(struct amdgpu_device *adev,
 				   u8 *bios, u32 length_bytes);
 	void (*detect_hw_virtualization) (struct amdgpu_device *adev);
-	void (*detect_sriov_bios)(struct amdgpu_device *adev);
 	int (*read_register)(struct amdgpu_device *adev, u32 se_num,
 			     u32 sh_num, u32 reg_offset, u32 *value);
 	void (*set_vga_state)(struct amdgpu_device *adev, bool state);
@@ -2287,7 +2286,6 @@ amdgpu_get_sdma_instance(struct amdgpu_ring *ring)
 #define amdgpu_asic_read_disabled_bios(adev) (adev)->asic_funcs->read_disabled_bios((adev))
 #define amdgpu_asic_read_bios_from_rom(adev, b, l) (adev)->asic_funcs->read_bios_from_rom((adev), (b), (l))
 #define amdgpu_asic_detect_hw_virtualization(adev) (adev)->asic_funcs->detect_hw_virtualization((adev))
-#define amdgpu_asic_detect_sriov_bios(adev) (adev)->asic_funcs->detect_sriov_bios((adev))
 #define amdgpu_asic_read_register(adev, se, sh, offset, v)((adev)->asic_funcs->read_register((adev), (se), (sh), (offset), (v)))
 #define amdgpu_gart_flush_gpu_tlb(adev, vmid) (adev)->gart.gart_funcs->flush_gpu_tlb((adev), (vmid))
 #define amdgpu_gart_set_pte_pde(adev, pt, idx, addr, flags) (adev)->gart.gart_funcs->set_pte_pde((adev), (pt), (idx), (addr), (flags))
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index ca161e9..76f8298 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1535,6 +1535,12 @@ static bool amdgpu_device_is_virtual(void)
 #endif
 }
 
+static void amdgpu_device_detect_sriov_bios(struct amdgpu_device *adev)
+{
+	if (amdgpu_atombios_has_gpu_virtualization_table(adev))
+		adev->virtualization.virtual_caps |= AMDGPU_SRIOV_CAPS_SRIOV_VBIOS;
+}
+
 /**
  * amdgpu_device_init - initialize the driver
  *
@@ -1690,8 +1696,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
 	}
 
 	/* detect if we are with an SRIOV vbios */
-	if (adev->asic_funcs->detect_sriov_bios)
-		amdgpu_asic_detect_sriov_bios(adev);
+	amdgpu_device_detect_sriov_bios(adev);
 
 	/* Post card if necessary */
 	if (amdgpu_vpost_needed(adev)) {
diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c
index 81780f1..a8154d0 100644
--- a/drivers/gpu/drm/amd/amdgpu/vi.c
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c
@@ -462,12 +462,6 @@ static void vi_detect_hw_virtualization(struct amdgpu_device *adev)
 	}
 }
 
-static void vi_detect_sriov_bios(struct amdgpu_device *adev)
-{
-	if (amdgpu_atombios_has_gpu_virtualization_table(adev))
-		adev->virtualization.virtual_caps |= AMDGPU_SRIOV_CAPS_SRIOV_VBIOS;
-}
-
 static const struct amdgpu_allowed_register_entry tonga_allowed_read_registers[] = {
 	{mmGB_MACROTILE_MODE7, true},
 };
@@ -1531,7 +1525,6 @@ static const struct amdgpu_asic_funcs vi_asic_funcs =
 	.read_disabled_bios = &vi_read_disabled_bios,
 	.read_bios_from_rom = &vi_read_bios_from_rom,
 	.detect_hw_virtualization = vi_detect_hw_virtualization,
-	.detect_sriov_bios = vi_detect_sriov_bios,
 	.read_register = &vi_read_register,
 	.reset = &vi_asic_reset,
 	.set_vga_state = &vi_vga_set_state,
-- 
2.5.5

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/5] drm/amdgpu: make sriov bios detection generic (v2)
       [not found] ` <1474310655-3094-1-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
@ 2016-09-19 23:32   ` Edward O'Callaghan
  0 siblings, 0 replies; 2+ messages in thread
From: Edward O'Callaghan @ 2016-09-19 23:32 UTC (permalink / raw)
  To: Alex Deucher, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Alex Deucher


[-- Attachment #1.1.1: Type: text/plain, Size: 4134 bytes --]

Reviewed-by: Edward O'Callaghan <funfunctor-dczkZgxz+BNUPWh3PAxdjQ@public.gmane.org>

as with the rest of the respective series.

On 09/20/2016 04:44 AM, Alex Deucher wrote:
> It's not asic specific.
> 
> v2: drop asic macro
> 
> Signed-off-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu.h        | 2 --
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 9 +++++++--
>  drivers/gpu/drm/amd/amdgpu/vi.c            | 7 -------
>  3 files changed, 7 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> index ff6e683..fb8d603 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> @@ -1828,7 +1828,6 @@ struct amdgpu_asic_funcs {
>  	bool (*read_bios_from_rom)(struct amdgpu_device *adev,
>  				   u8 *bios, u32 length_bytes);
>  	void (*detect_hw_virtualization) (struct amdgpu_device *adev);
> -	void (*detect_sriov_bios)(struct amdgpu_device *adev);
>  	int (*read_register)(struct amdgpu_device *adev, u32 se_num,
>  			     u32 sh_num, u32 reg_offset, u32 *value);
>  	void (*set_vga_state)(struct amdgpu_device *adev, bool state);
> @@ -2287,7 +2286,6 @@ amdgpu_get_sdma_instance(struct amdgpu_ring *ring)
>  #define amdgpu_asic_read_disabled_bios(adev) (adev)->asic_funcs->read_disabled_bios((adev))
>  #define amdgpu_asic_read_bios_from_rom(adev, b, l) (adev)->asic_funcs->read_bios_from_rom((adev), (b), (l))
>  #define amdgpu_asic_detect_hw_virtualization(adev) (adev)->asic_funcs->detect_hw_virtualization((adev))
> -#define amdgpu_asic_detect_sriov_bios(adev) (adev)->asic_funcs->detect_sriov_bios((adev))
>  #define amdgpu_asic_read_register(adev, se, sh, offset, v)((adev)->asic_funcs->read_register((adev), (se), (sh), (offset), (v)))
>  #define amdgpu_gart_flush_gpu_tlb(adev, vmid) (adev)->gart.gart_funcs->flush_gpu_tlb((adev), (vmid))
>  #define amdgpu_gart_set_pte_pde(adev, pt, idx, addr, flags) (adev)->gart.gart_funcs->set_pte_pde((adev), (pt), (idx), (addr), (flags))
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index ca161e9..76f8298 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -1535,6 +1535,12 @@ static bool amdgpu_device_is_virtual(void)
>  #endif
>  }
>  
> +static void amdgpu_device_detect_sriov_bios(struct amdgpu_device *adev)
> +{
> +	if (amdgpu_atombios_has_gpu_virtualization_table(adev))
> +		adev->virtualization.virtual_caps |= AMDGPU_SRIOV_CAPS_SRIOV_VBIOS;
> +}
> +
>  /**
>   * amdgpu_device_init - initialize the driver
>   *
> @@ -1690,8 +1696,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
>  	}
>  
>  	/* detect if we are with an SRIOV vbios */
> -	if (adev->asic_funcs->detect_sriov_bios)
> -		amdgpu_asic_detect_sriov_bios(adev);
> +	amdgpu_device_detect_sriov_bios(adev);
>  
>  	/* Post card if necessary */
>  	if (amdgpu_vpost_needed(adev)) {
> diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c
> index 81780f1..a8154d0 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vi.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vi.c
> @@ -462,12 +462,6 @@ static void vi_detect_hw_virtualization(struct amdgpu_device *adev)
>  	}
>  }
>  
> -static void vi_detect_sriov_bios(struct amdgpu_device *adev)
> -{
> -	if (amdgpu_atombios_has_gpu_virtualization_table(adev))
> -		adev->virtualization.virtual_caps |= AMDGPU_SRIOV_CAPS_SRIOV_VBIOS;
> -}
> -
>  static const struct amdgpu_allowed_register_entry tonga_allowed_read_registers[] = {
>  	{mmGB_MACROTILE_MODE7, true},
>  };
> @@ -1531,7 +1525,6 @@ static const struct amdgpu_asic_funcs vi_asic_funcs =
>  	.read_disabled_bios = &vi_read_disabled_bios,
>  	.read_bios_from_rom = &vi_read_bios_from_rom,
>  	.detect_hw_virtualization = vi_detect_hw_virtualization,
> -	.detect_sriov_bios = vi_detect_sriov_bios,
>  	.read_register = &vi_read_register,
>  	.reset = &vi_asic_reset,
>  	.set_vga_state = &vi_vga_set_state,
> 


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-19 23:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-19 18:44 [PATCH 2/5] drm/amdgpu: make sriov bios detection generic (v2) Alex Deucher
     [not found] ` <1474310655-3094-1-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2016-09-19 23:32   ` Edward O'Callaghan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.