View | Details | Raw Unified | Return to bug 199047
Collapse All | Expand All

(-)a/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h (+1 lines)
Lines 350-355 struct amdgpu_mode_info { Link Here
350
	u16 firmware_flags;
350
	u16 firmware_flags;
351
	/* pointer to backlight encoder */
351
	/* pointer to backlight encoder */
352
	struct amdgpu_encoder *bl_encoder;
352
	struct amdgpu_encoder *bl_encoder;
353
	u8 bl_level; /* saved backlight level */
353
	struct amdgpu_audio	audio; /* audio stuff */
354
	struct amdgpu_audio	audio; /* audio stuff */
354
	int			num_crtc; /* number of crtcs */
355
	int			num_crtc; /* number of crtcs */
355
	int			num_hpd; /* number of hpd pins */
356
	int			num_hpd; /* number of hpd pins */
(-)a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c (-2 / +2 lines)
Lines 34-40 Link Here
34
#include <linux/backlight.h>
34
#include <linux/backlight.h>
35
#include "bif/bif_4_1_d.h"
35
#include "bif/bif_4_1_d.h"
36
36
37
static u8
37
u8
38
amdgpu_atombios_encoder_get_backlight_level_from_reg(struct amdgpu_device *adev)
38
amdgpu_atombios_encoder_get_backlight_level_from_reg(struct amdgpu_device *adev)
39
{
39
{
40
	u8 backlight_level;
40
	u8 backlight_level;
Lines 48-54 amdgpu_atombios_encoder_get_backlight_level_from_reg(struct amdgpu_device *adev) Link Here
48
	return backlight_level;
48
	return backlight_level;
49
}
49
}
50
50
51
static void
51
void
52
amdgpu_atombios_encoder_set_backlight_level_to_reg(struct amdgpu_device *adev,
52
amdgpu_atombios_encoder_set_backlight_level_to_reg(struct amdgpu_device *adev,
53
					    u8 backlight_level)
53
					    u8 backlight_level)
54
{
54
{
(-)a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.h (+5 lines)
Lines 25-30 Link Here
25
#define __ATOMBIOS_ENCODER_H__
25
#define __ATOMBIOS_ENCODER_H__
26
26
27
u8
27
u8
28
amdgpu_atombios_encoder_get_backlight_level_from_reg(struct amdgpu_device *adev);
29
void
30
amdgpu_atombios_encoder_set_backlight_level_to_reg(struct amdgpu_device *adev,
31
						   u8 backlight_level);
32
u8
28
amdgpu_atombios_encoder_get_backlight_level(struct amdgpu_encoder *amdgpu_encoder);
33
amdgpu_atombios_encoder_get_backlight_level(struct amdgpu_encoder *amdgpu_encoder);
29
void
34
void
30
amdgpu_atombios_encoder_set_backlight_level(struct amdgpu_encoder *amdgpu_encoder,
35
amdgpu_atombios_encoder_set_backlight_level(struct amdgpu_encoder *amdgpu_encoder,
(-)a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c (+8 lines)
Lines 2862-2867 static int dce_v10_0_hw_fini(void *handle) Link Here
2862
2862
2863
static int dce_v10_0_suspend(void *handle)
2863
static int dce_v10_0_suspend(void *handle)
2864
{
2864
{
2865
	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
2866
2867
	adev->mode_info.bl_level =
2868
		amdgpu_atombios_encoder_get_backlight_level_from_reg(adev);
2869
2865
	return dce_v10_0_hw_fini(handle);
2870
	return dce_v10_0_hw_fini(handle);
2866
}
2871
}
2867
2872
Lines 2870-2875 static int dce_v10_0_resume(void *handle) Link Here
2870
	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
2875
	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
2871
	int ret;
2876
	int ret;
2872
2877
2878
	amdgpu_atombios_encoder_set_backlight_level_to_reg(adev,
2879
							   adev->mode_info.bl_level);
2880
2873
	ret = dce_v10_0_hw_init(handle);
2881
	ret = dce_v10_0_hw_init(handle);
2874
2882
2875
	/* turn on the BL */
2883
	/* turn on the BL */
(-)a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c (+8 lines)
Lines 2988-2993 static int dce_v11_0_hw_fini(void *handle) Link Here
2988
2988
2989
static int dce_v11_0_suspend(void *handle)
2989
static int dce_v11_0_suspend(void *handle)
2990
{
2990
{
2991
	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
2992
2993
	adev->mode_info.bl_level =
2994
		amdgpu_atombios_encoder_get_backlight_level_from_reg(adev);
2995
2991
	return dce_v11_0_hw_fini(handle);
2996
	return dce_v11_0_hw_fini(handle);
2992
}
2997
}
2993
2998
Lines 2996-3001 static int dce_v11_0_resume(void *handle) Link Here
2996
	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
3001
	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
2997
	int ret;
3002
	int ret;
2998
3003
3004
	amdgpu_atombios_encoder_set_backlight_level_to_reg(adev,
3005
							   adev->mode_info.bl_level);
3006
2999
	ret = dce_v11_0_hw_init(handle);
3007
	ret = dce_v11_0_hw_init(handle);
3000
3008
3001
	/* turn on the BL */
3009
	/* turn on the BL */
(-)a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c (+8 lines)
Lines 2730-2735 static int dce_v6_0_hw_fini(void *handle) Link Here
2730
2730
2731
static int dce_v6_0_suspend(void *handle)
2731
static int dce_v6_0_suspend(void *handle)
2732
{
2732
{
2733
	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
2734
2735
	adev->mode_info.bl_level =
2736
		amdgpu_atombios_encoder_get_backlight_level_from_reg(adev);
2737
2733
	return dce_v6_0_hw_fini(handle);
2738
	return dce_v6_0_hw_fini(handle);
2734
}
2739
}
2735
2740
Lines 2738-2743 static int dce_v6_0_resume(void *handle) Link Here
2738
	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
2743
	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
2739
	int ret;
2744
	int ret;
2740
2745
2746
	amdgpu_atombios_encoder_set_backlight_level_to_reg(adev,
2747
							   adev->mode_info.bl_level);
2748
2741
	ret = dce_v6_0_hw_init(handle);
2749
	ret = dce_v6_0_hw_init(handle);
2742
2750
2743
	/* turn on the BL */
2751
	/* turn on the BL */
(-)a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c (-1 / +8 lines)
Lines 2760-2765 static int dce_v8_0_hw_fini(void *handle) Link Here
2760
2760
2761
static int dce_v8_0_suspend(void *handle)
2761
static int dce_v8_0_suspend(void *handle)
2762
{
2762
{
2763
	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
2764
2765
	adev->mode_info.bl_level =
2766
		amdgpu_atombios_encoder_get_backlight_level_from_reg(adev);
2767
2763
	return dce_v8_0_hw_fini(handle);
2768
	return dce_v8_0_hw_fini(handle);
2764
}
2769
}
2765
2770
Lines 2768-2773 static int dce_v8_0_resume(void *handle) Link Here
2768
	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
2773
	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
2769
	int ret;
2774
	int ret;
2770
2775
2776
	amdgpu_atombios_encoder_set_backlight_level_to_reg(adev,
2777
							   adev->mode_info.bl_level);
2778
2771
	ret = dce_v8_0_hw_init(handle);
2779
	ret = dce_v8_0_hw_init(handle);
2772
2780
2773
	/* turn on the BL */
2781
	/* turn on the BL */
2774
- 

Return to bug 199047