drm/amdgpu: add an cgs interface to notify amdgpu the dpm state.
authorRex Zhu <Rex.Zhu@amd.com>
Tue, 29 Mar 2016 06:20:37 +0000 (14:20 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 1 Apr 2016 14:08:27 +0000 (10:08 -0400)
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
drivers/gpu/drm/amd/include/cgs_common.h

index 75cb5b9b88f82321b160bf8b2a0bd730bcb7d96a..6043dc7c3a94d75350a6e8760376b772f0fc4baf 100644 (file)
@@ -850,6 +850,16 @@ static int amdgpu_cgs_get_active_displays_info(void *cgs_device,
        return 0;
 }
 
+
+static int amdgpu_cgs_notify_dpm_enabled(void *cgs_device, bool enabled)
+{
+       CGS_FUNC_ADEV;
+
+       adev->pm.dpm_enabled = enabled;
+
+       return 0;
+}
+
 /** \brief evaluate acpi namespace object, handle or pathname must be valid
  *  \param cgs_device
  *  \param info input/output arguments for the control method
@@ -1100,6 +1110,7 @@ static const struct cgs_ops amdgpu_cgs_ops = {
        amdgpu_cgs_set_powergating_state,
        amdgpu_cgs_set_clockgating_state,
        amdgpu_cgs_get_active_displays_info,
+       amdgpu_cgs_notify_dpm_enabled,
        amdgpu_cgs_call_acpi_method,
        amdgpu_cgs_query_system_info,
 };
index aec38fc3834f9d867b4477c2f1d1d1166285f1fe..ab84d494724774d77100756c85c6d2a689b25516 100644 (file)
@@ -589,6 +589,8 @@ typedef int(*cgs_get_active_displays_info)(
                                        void *cgs_device,
                                        struct cgs_display_info *info);
 
+typedef int (*cgs_notify_dpm_enabled)(void *cgs_device, bool enabled);
+
 typedef int (*cgs_call_acpi_method)(void *cgs_device,
                                        uint32_t acpi_method,
                                        uint32_t acpi_function,
@@ -644,6 +646,8 @@ struct cgs_ops {
        cgs_set_clockgating_state set_clockgating_state;
        /* display manager */
        cgs_get_active_displays_info get_active_displays_info;
+       /* notify dpm enabled */
+       cgs_notify_dpm_enabled notify_dpm_enabled;
        /* ACPI */
        cgs_call_acpi_method call_acpi_method;
        /* get system info */
@@ -734,8 +738,12 @@ struct cgs_device
        CGS_CALL(set_powergating_state, dev, block_type, state)
 #define cgs_set_clockgating_state(dev, block_type, state)      \
        CGS_CALL(set_clockgating_state, dev, block_type, state)
+#define cgs_notify_dpm_enabled(dev, enabled)   \
+       CGS_CALL(notify_dpm_enabled, dev, enabled)
+
 #define cgs_get_active_displays_info(dev, info)        \
        CGS_CALL(get_active_displays_info, dev, info)
+
 #define cgs_call_acpi_method(dev, acpi_method, acpi_function, pintput, poutput, output_count, input_size, output_size) \
        CGS_CALL(call_acpi_method, dev, acpi_method, acpi_function, pintput, poutput, output_count, input_size, output_size)
 #define cgs_query_system_info(dev, sys_info)   \