drm/amdgpu/apci: don't call sbios request function if it's not supported
Subsystems (2)
PATCH 1/2 drm/amdgpu/apci: don't call sbios request function if it's not supported
Check the supported functions mask before calling the bios requests method.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 53 +++++++++++++++++--------------- 1 file changed, 28 insertions(+), 25 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +28 -25
@@ -364,7 +364,6 @@ static int amdgpu_atif_handler(struct amdgpu_device *adev, struct acpi_bus_event *event) {struct amdgpu_atif *atif = adev->atif; -struct atif_sbios_requests req;int count; DRM_DEBUG_DRIVER("event, device_class = %s, type = %#x\n",
@@ -379,42 +378,46 @@ static int amdgpu_atif_handler(struct amdgpu_device *adev,/* Not our event */ return NOTIFY_DONE ; -/* Check pending SBIOS requests */ - count =amdgpu_atif_get_sbios_requests (atif, &req); +if (atif->functions.sbios_requests) { +struct atif_sbios_requests req; -if (count <=0 ) -return NOTIFY_DONE ; +/* Check pending SBIOS requests */ + count =amdgpu_atif_get_sbios_requests (atif, &req); + +if (count <=0 ) +return NOTIFY_DONE ; -DRM_DEBUG_DRIVER ("ATIF: %d pending SBIOS requests\n" , count); +DRM_DEBUG_DRIVER ("ATIF: %d pending SBIOS requests\n" , count); -if (req.pending &ATIF_PANEL_BRIGHTNESS_CHANGE_REQUEST ) { -struct amdgpu_encoder *enc = atif->encoder_for_bl; +if (req.pending &ATIF_PANEL_BRIGHTNESS_CHANGE_REQUEST ) { +struct amdgpu_encoder *enc = atif->encoder_for_bl; -if (enc) { -struct amdgpu_encoder_atom_dig *dig = enc->enc_priv; +if (enc) { +struct amdgpu_encoder_atom_dig *dig = enc->enc_priv; -DRM_DEBUG_DRIVER ("Changing brightness to %d\n" , - req.backlight_level); +DRM_DEBUG_DRIVER ("Changing brightness to %d\n" , + req.backlight_level); -amdgpu_display_backlight_set_level (adev, enc, req.backlight_level); +amdgpu_display_backlight_set_level (adev, enc, req.backlight_level);#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE ) || defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE ) -backlight_force_update (dig->bl_dev, -BACKLIGHT_UPDATE_HOTKEY ); +backlight_force_update (dig->bl_dev, +BACKLIGHT_UPDATE_HOTKEY );#endif + } } - } -if (req.pending &ATIF_DGPU_DISPLAY_EVENT ) { -if ((adev->flags &AMD_IS_PX ) && -amdgpu_atpx_dgpu_req_power_for_displays ()) { -pm_runtime_get_sync (adev->ddev->dev); -/* Just fire off a uevent and let userspace tell us what to do */ -drm_helper_hpd_irq_event (adev->ddev); -pm_runtime_mark_last_busy (adev->ddev->dev); -pm_runtime_put_autosuspend (adev->ddev->dev); +if (req.pending &ATIF_DGPU_DISPLAY_EVENT ) { +if ((adev->flags &AMD_IS_PX ) && +amdgpu_atpx_dgpu_req_power_for_displays ()) { +pm_runtime_get_sync (adev->ddev->dev); +/* Just fire off a uevent and let userspace tell us what to do */ +drm_helper_hpd_irq_event (adev->ddev); +pm_runtime_mark_last_busy (adev->ddev->dev); +pm_runtime_put_autosuspend (adev->ddev->dev); + } } +/* TODO: check other events */ } -/* TODO: check other events */ /* We've handled the event, stop the notifier chain. The ACPI interface * overloads ACPI_VIDEO_NOTIFY_PROBE, we don't want to send that to
Signature · 6 lines
2.13.6 _______________________________________________ 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): 20180719143553.19806-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org
PATCH 2/2 drm/amdgpu/acpi: skip backlight events for DC
No change in behavior, just bail sooner.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +3 -1
@@ -389,7 +389,9 @@ static int amdgpu_atif_handler(struct amdgpu_device *adev,DRM_DEBUG_DRIVER ("ATIF: %d pending SBIOS requests\n" , count); -if (req.pending &ATIF_PANEL_BRIGHTNESS_CHANGE_REQUEST ) { +/* todo: add DC handling */ +if ((req.pending &ATIF_PANEL_BRIGHTNESS_CHANGE_REQUEST ) && + !amdgpu_device_has_dc_support (adev)) {struct amdgpu_encoder *enc = atif->encoder_for_bl;if (enc) {
Signature · 6 lines
2.13.6 _______________________________________________ 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): 20180719143553.19806-2-alexander.deucher-5C7GfCeVMHo@public.gmane.org
答复: [PATCH 2/2] drm/amdgpu/acpi: skip backlight events for DC
Those two patches are Reviewed-by: Jim Qu <[email protected]>
Thanks
JimQu
________________________________________
发件人: amd-gfx <[email protected]> 代表 Alex Deucher <[email protected]> 发送时间: 2018年7月19日 22:35:53
收件人: [email protected]
抄送: Deucher, Alexander
主题: [PATCH 2/2] drm/amdgpu/acpi: skip backlight events for DC
No change in behavior, just bail sooner.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +3 -1
@@ -389,7 +389,9 @@ static int amdgpu_atif_handler(struct amdgpu_device *adev,DRM_DEBUG_DRIVER ("ATIF: %d pending SBIOS requests\n" , count); -if (req.pending &ATIF_PANEL_BRIGHTNESS_CHANGE_REQUEST ) { +/* todo: add DC handling */ +if ((req.pending &ATIF_PANEL_BRIGHTNESS_CHANGE_REQUEST ) && + !amdgpu_device_has_dc_support (adev)) {struct amdgpu_encoder *enc = atif->encoder_for_bl;if (enc) {
--
2.13.6
_______________________________________________
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