Skip to contentSkip to conversation

drm/amdgpu: init atpx at switcheroo register time

PATCH In review Alex Deucher 2 participants 3 messages Jul 27, 2016 – Jul 28, 2016 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/amdgpu: init atpx at switcheroo register time

If we do it at enable time, it's too late for the feature checks.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c +2 -1
index 0494fe7..bc8dc71 100644
@@ -539,7 +539,7 @@ static int amdgpu_atpx_get_client_id(struct pci_dev *pdev)
 static const struct vga_switcheroo_handler amdgpu_atpx_handler = {
 	.switchto = amdgpu_atpx_switchto,
 	.power_state = amdgpu_atpx_power_state,
-	.init = amdgpu_atpx_init,
+	.init = NULL,
 	.get_client_id = amdgpu_atpx_get_client_id,
 };
 
@@ -574,6 +574,7 @@ static bool amdgpu_atpx_detect(void)
 		printk(KERN_INFO "vga_switcheroo: detected switching method %s handle\n",
 		       acpi_method_name);
 		amdgpu_atpx_priv.atpx_detected = true;
+		amdgpu_atpx_init();
 		return true;
 	}
 	return false;
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): 1469650245-7919-1-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org

#2 lore raw

PATCH 2/2 drm/radeon: init atpx at switcheroo register time

If we do it at enable time, it's too late for the feature checks.

---
 drivers/gpu/drm/radeon/radeon_atpx_handler.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/radeon/radeon_atpx_handler.c +2 -1
index 86dcdf3..b46b4c4 100644
@@ -536,7 +536,7 @@ static int radeon_atpx_get_client_id(struct pci_dev *pdev)
 static const struct vga_switcheroo_handler radeon_atpx_handler = {
 	.switchto = radeon_atpx_switchto,
 	.power_state = radeon_atpx_power_state,
-	.init = radeon_atpx_init,
+	.init = NULL,
 	.get_client_id = radeon_atpx_get_client_id,
 };
 
@@ -572,6 +572,7 @@ static bool radeon_atpx_detect(void)
 		printk(KERN_INFO "vga_switcheroo: detected switching method %s handle\n",
 		       acpi_method_name);
 		radeon_atpx_priv.atpx_detected = true;
+		radeon_atpx_init();
 		return true;
 	}
 	return false;
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): 1469650245-7919-2-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#4 lore raw

Re: [PATCH 2/2] drm/radeon: init atpx at switcheroo register time

Quoted 15 lines · Alex Deucher

If we do it at enable time, it's too late for the feature checks.

---
 drivers/gpu/drm/radeon/radeon_atpx_handler.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/radeon/radeon_atpx_handler.c +0 -0
index 86dcdf3..b46b4c4 100644

drivers/gpu/drm/radeon/radeon_atpx_handler.c static int radeon_atpx_get_client_id(struct pci_dev *pdev) · line 539

Quoted 5 lines
drivers/gpu/drm/radeon/radeon_atpx_handler.c +1 -1
@@ -536,7 +536,7 @@ static int radeon_atpx_get_client_id(struct pci_dev *pdev)
 static const struct vga_switcheroo_handler radeon_atpx_handler = {
 	.switchto = radeon_atpx_switchto,
 	.power_state = radeon_atpx_power_state,
-	.init = radeon_atpx_init,
+	.init = NULL,

Let's just remove this initialization, it allows for trivial removal of the init member later. radeon was the only user of this anyway.

Quoted 14 lines
drivers/gpu/drm/radeon/radeon_atpx_handler.c +1 -0
 	.get_client_id = radeon_atpx_get_client_id,
 };
 
@@ -572,6 +572,7 @@ static bool radeon_atpx_detect(void)
 		printk(KERN_INFO "vga_switcheroo: detected switching method %s handle\n",
 		       acpi_method_name);
 		radeon_atpx_priv.atpx_detected = true;
+		radeon_atpx_init();
 		return true;
 	}
 	return false;
Signature · 1 line
2.5.5

Other than the command above, both patches are

I'll be testing this (via your amd-staging-4.6 branch) tomorrow on an AMD/AMD hybrid (GCN 1.0 unfortunately, so restricted to radeon).

Signature · 7 lines
Kind regards,
Peter Wu
https://lekensteyn.nl
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx