All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] drm/amdgpu/vi: whitespace fixes
@ 2016-09-19 18:35 Alex Deucher
       [not found] ` <1474310162-21802-1-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Alex Deucher @ 2016-09-19 18:35 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Alex Deucher

function declaration parens should be a new line.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/vi.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c
index 5141393..81780f1 100644
--- a/drivers/gpu/drm/amd/amdgpu/vi.c
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c
@@ -445,7 +445,8 @@ static bool vi_read_bios_from_rom(struct amdgpu_device *adev,
 	return true;
 }
 
-static void vi_detect_hw_virtualization(struct amdgpu_device *adev) {
+static void vi_detect_hw_virtualization(struct amdgpu_device *adev)
+{
 	uint32_t reg = RREG32(mmBIF_IOV_FUNC_IDENTIFIER);
 	/* bit0: 0 means pf and 1 means vf */
 	/* bit31: 0 means disable IOV and 1 means enable */
@@ -461,7 +462,8 @@ static void vi_detect_hw_virtualization(struct amdgpu_device *adev) {
 	}
 }
 
-static void vi_detect_sriov_bios(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;
 }
-- 
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] 7+ messages in thread

* [PATCH 2/5] drm/amdgpu: make sriov bios detection generic
       [not found] ` <1474310162-21802-1-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
@ 2016-09-19 18:35   ` Alex Deucher
  2016-09-19 18:36   ` [PATCH 3/5] drm/amdgpu: drop unused function Alex Deucher
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Alex Deucher @ 2016-09-19 18:35 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Alex Deucher

It's not asic specific.

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

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index ff6e683..f3d4bf6 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);
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] 7+ messages in thread

* [PATCH 3/5] drm/amdgpu: drop unused function
       [not found] ` <1474310162-21802-1-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
  2016-09-19 18:35   ` [PATCH 2/5] drm/amdgpu: make sriov bios detection generic Alex Deucher
@ 2016-09-19 18:36   ` Alex Deucher
  2016-09-19 18:36   ` [PATCH 4/5] drm/amdgpu/cik: add detect_hw_virtualization asic callback Alex Deucher
                     ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Alex Deucher @ 2016-09-19 18:36 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Alex Deucher

Not used after Monk's rework.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 76f8298..75f490f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1526,15 +1526,6 @@ static int amdgpu_resume(struct amdgpu_device *adev)
 	return 0;
 }
 
-static bool amdgpu_device_is_virtual(void)
-{
-#ifdef CONFIG_X86
-	return boot_cpu_has(X86_FEATURE_HYPERVISOR);
-#else
-	return false;
-#endif
-}
-
 static void amdgpu_device_detect_sriov_bios(struct amdgpu_device *adev)
 {
 	if (amdgpu_atombios_has_gpu_virtualization_table(adev))
-- 
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] 7+ messages in thread

* [PATCH 4/5] drm/amdgpu/cik: add detect_hw_virtualization asic callback
       [not found] ` <1474310162-21802-1-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
  2016-09-19 18:35   ` [PATCH 2/5] drm/amdgpu: make sriov bios detection generic Alex Deucher
  2016-09-19 18:36   ` [PATCH 3/5] drm/amdgpu: drop unused function Alex Deucher
@ 2016-09-19 18:36   ` Alex Deucher
  2016-09-19 18:36   ` [PATCH 5/5] drm/amdgpu/si: " Alex Deucher
  2016-09-19 23:31   ` [PATCH 1/5] drm/amdgpu/vi: whitespace fixes Edward O'Callaghan
  4 siblings, 0 replies; 7+ messages in thread
From: Alex Deucher @ 2016-09-19 18:36 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Alex Deucher

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/cik.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c b/drivers/gpu/drm/amd/amdgpu/cik.c
index e61fdee..a845b6a 100644
--- a/drivers/gpu/drm/amd/amdgpu/cik.c
+++ b/drivers/gpu/drm/amd/amdgpu/cik.c
@@ -1635,6 +1635,12 @@ static uint32_t cik_get_rev_id(struct amdgpu_device *adev)
 		>> CC_DRM_ID_STRAPS__ATI_REV_ID__SHIFT;
 }
 
+static void cik_detect_hw_virtualization(struct amdgpu_device *adev)
+{
+	if (is_virtual_machine()) /* passthrough mode */
+		adev->virtualization.virtual_caps |= AMDGPU_PASSTHROUGH_MODE;
+}
+
 static const struct amdgpu_ip_block_version bonaire_ip_blocks[] =
 {
 	/* ORDER MATTERS! */
@@ -2378,6 +2384,7 @@ static const struct amdgpu_asic_funcs cik_asic_funcs =
 {
 	.read_disabled_bios = &cik_read_disabled_bios,
 	.read_bios_from_rom = &cik_read_bios_from_rom,
+	.detect_hw_virtualization = cik_detect_hw_virtualization,
 	.read_register = &cik_read_register,
 	.reset = &cik_asic_reset,
 	.set_vga_state = &cik_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] 7+ messages in thread

* [PATCH 5/5] drm/amdgpu/si: add detect_hw_virtualization asic callback
       [not found] ` <1474310162-21802-1-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
                     ` (2 preceding siblings ...)
  2016-09-19 18:36   ` [PATCH 4/5] drm/amdgpu/cik: add detect_hw_virtualization asic callback Alex Deucher
@ 2016-09-19 18:36   ` Alex Deucher
       [not found]     ` <1474310162-21802-5-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
  2016-09-19 23:31   ` [PATCH 1/5] drm/amdgpu/vi: whitespace fixes Edward O'Callaghan
  4 siblings, 1 reply; 7+ messages in thread
From: Alex Deucher @ 2016-09-19 18:36 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Alex Deucher

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/si.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/si.c b/drivers/gpu/drm/amd/amdgpu/si.c
index a0b6b7e..dc9511c 100644
--- a/drivers/gpu/drm/amd/amdgpu/si.c
+++ b/drivers/gpu/drm/amd/amdgpu/si.c
@@ -1118,9 +1118,16 @@ static int si_set_uvd_clocks(struct amdgpu_device *adev, u32 vclk, u32 dclk)
 	return 0;
 }
 
+static void si_detect_hw_virtualization(struct amdgpu_device *adev)
+{
+	if (is_virtual_machine()) /* passthrough mode */
+		adev->virtualization.virtual_caps |= AMDGPU_PASSTHROUGH_MODE;
+}
+
 static const struct amdgpu_asic_funcs si_asic_funcs =
 {
 	.read_disabled_bios = &si_read_disabled_bios,
+	.detect_hw_virtualization = si_detect_hw_virtualization,
 	.read_register = &si_read_register,
 	.reset = &si_asic_reset,
 	.set_vga_state = &si_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] 7+ messages in thread

* Re: [PATCH 1/5] drm/amdgpu/vi: whitespace fixes
       [not found] ` <1474310162-21802-1-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
                     ` (3 preceding siblings ...)
  2016-09-19 18:36   ` [PATCH 5/5] drm/amdgpu/si: " Alex Deucher
@ 2016-09-19 23:31   ` Edward O'Callaghan
  4 siblings, 0 replies; 7+ messages in thread
From: Edward O'Callaghan @ 2016-09-19 23:31 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


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

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

On 09/20/2016 04:35 AM, Alex Deucher wrote:
> function declaration parens should be a new line.
> 
> Signed-off-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>
> ---
>  drivers/gpu/drm/amd/amdgpu/vi.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c
> index 5141393..81780f1 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vi.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vi.c
> @@ -445,7 +445,8 @@ static bool vi_read_bios_from_rom(struct amdgpu_device *adev,
>  	return true;
>  }
>  
> -static void vi_detect_hw_virtualization(struct amdgpu_device *adev) {
> +static void vi_detect_hw_virtualization(struct amdgpu_device *adev)
> +{
>  	uint32_t reg = RREG32(mmBIF_IOV_FUNC_IDENTIFIER);
>  	/* bit0: 0 means pf and 1 means vf */
>  	/* bit31: 0 means disable IOV and 1 means enable */
> @@ -461,7 +462,8 @@ static void vi_detect_hw_virtualization(struct amdgpu_device *adev) {
>  	}
>  }
>  
> -static void vi_detect_sriov_bios(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;
>  }
> 


[-- 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] 7+ messages in thread

* RE: [PATCH 5/5] drm/amdgpu/si: add detect_hw_virtualization asic callback
       [not found]     ` <1474310162-21802-5-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
@ 2016-09-20  3:20       ` Liu, Monk
  0 siblings, 0 replies; 7+ messages in thread
From: Liu, Monk @ 2016-09-20  3:20 UTC (permalink / raw)
  To: Alex Deucher, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Deucher, Alexander

All those 5 patches are :
Reviewed-by: Monk Liu <monk.liu@amd.com>

-----Original Message-----
From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf Of Alex Deucher
Sent: Tuesday, September 20, 2016 2:36 AM
To: amd-gfx@lists.freedesktop.org
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>
Subject: [PATCH 5/5] drm/amdgpu/si: add detect_hw_virtualization asic callback

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/si.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/si.c b/drivers/gpu/drm/amd/amdgpu/si.c index a0b6b7e..dc9511c 100644
--- a/drivers/gpu/drm/amd/amdgpu/si.c
+++ b/drivers/gpu/drm/amd/amdgpu/si.c
@@ -1118,9 +1118,16 @@ static int si_set_uvd_clocks(struct amdgpu_device *adev, u32 vclk, u32 dclk)
 	return 0;
 }
 
+static void si_detect_hw_virtualization(struct amdgpu_device *adev) {
+	if (is_virtual_machine()) /* passthrough mode */
+		adev->virtualization.virtual_caps |= AMDGPU_PASSTHROUGH_MODE; }
+
 static const struct amdgpu_asic_funcs si_asic_funcs =  {
 	.read_disabled_bios = &si_read_disabled_bios,
+	.detect_hw_virtualization = si_detect_hw_virtualization,
 	.read_register = &si_read_register,
 	.reset = &si_asic_reset,
 	.set_vga_state = &si_vga_set_state,
--
2.5.5

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

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

end of thread, other threads:[~2016-09-20  3:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-19 18:35 [PATCH 1/5] drm/amdgpu/vi: whitespace fixes Alex Deucher
     [not found] ` <1474310162-21802-1-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2016-09-19 18:35   ` [PATCH 2/5] drm/amdgpu: make sriov bios detection generic Alex Deucher
2016-09-19 18:36   ` [PATCH 3/5] drm/amdgpu: drop unused function Alex Deucher
2016-09-19 18:36   ` [PATCH 4/5] drm/amdgpu/cik: add detect_hw_virtualization asic callback Alex Deucher
2016-09-19 18:36   ` [PATCH 5/5] drm/amdgpu/si: " Alex Deucher
     [not found]     ` <1474310162-21802-5-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2016-09-20  3:20       ` Liu, Monk
2016-09-19 23:31   ` [PATCH 1/5] drm/amdgpu/vi: whitespace fixes 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.