diff options
Diffstat (limited to 'drivers/gpu/drm/ast/ast_mode.c')
| -rw-r--r-- | drivers/gpu/drm/ast/ast_mode.c | 28 | 
1 files changed, 21 insertions, 7 deletions
diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c index 214b10178454..1bc0220e6783 100644 --- a/drivers/gpu/drm/ast/ast_mode.c +++ b/drivers/gpu/drm/ast/ast_mode.c @@ -42,7 +42,6 @@  #include <drm/drm_gem_framebuffer_helper.h>  #include <drm/drm_gem_vram_helper.h>  #include <drm/drm_managed.h> -#include <drm/drm_plane_helper.h>  #include <drm/drm_probe_helper.h>  #include <drm/drm_simple_kms_helper.h> @@ -114,6 +113,9 @@ static bool ast_get_vbios_mode_info(const struct drm_format_info *format,  	case 1024:  		vbios_mode->enh_table = &res_1024x768[refresh_rate_index];  		break; +	case 1152: +		vbios_mode->enh_table = &res_1152x864[refresh_rate_index]; +		break;  	case 1280:  		if (mode->crtc_vdisplay == 800)  			vbios_mode->enh_table = &res_1280x800[refresh_rate_index]; @@ -311,7 +313,7 @@ static void ast_set_crtc_reg(struct ast_private *ast,  	u8 jreg05 = 0, jreg07 = 0, jreg09 = 0, jregAC = 0, jregAD = 0, jregAE = 0;  	u16 temp, precache = 0; -	if ((ast->chip == AST2500) && +	if ((ast->chip == AST2500 || ast->chip == AST2600) &&  	    (vbios_mode->enh_table->flags & AST2500PreCatchCRT))  		precache = 40; @@ -352,6 +354,12 @@ static void ast_set_crtc_reg(struct ast_private *ast,  	ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xAC, 0x00, jregAC);  	ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xAD, 0x00, jregAD); +	// Workaround for HSync Time non octave pixels (1920x1080@60Hz HSync 44 pixels); +	if ((ast->chip == AST2600) && (mode->crtc_vdisplay == 1080)) +		ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xFC, 0xFD, 0x02); +	else +		ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xFC, 0xFD, 0x00); +  	/* vert timings */  	temp = (mode->crtc_vtotal) - 2;  	if (temp & 0x100) @@ -429,7 +437,7 @@ static void ast_set_dclk_reg(struct ast_private *ast,  {  	const struct ast_vbios_dclk_info *clk_info; -	if (ast->chip == AST2500) +	if ((ast->chip == AST2500) || (ast->chip == AST2600))  		clk_info = &dclk_table_ast2500[vbios_mode->enh_table->dclk_index];  	else  		clk_info = &dclk_table[vbios_mode->enh_table->dclk_index]; @@ -555,8 +563,8 @@ static int ast_primary_plane_helper_atomic_check(struct drm_plane *plane,  						   new_plane_state->crtc);  	ret = drm_atomic_helper_check_plane_state(new_plane_state, crtc_state, -						  DRM_PLANE_HELPER_NO_SCALING, -						  DRM_PLANE_HELPER_NO_SCALING, +						  DRM_PLANE_NO_SCALING, +						  DRM_PLANE_NO_SCALING,  						  false, true);  	if (ret)  		return ret; @@ -779,8 +787,8 @@ static int ast_cursor_plane_helper_atomic_check(struct drm_plane *plane,  						   new_plane_state->crtc);  	ret = drm_atomic_helper_check_plane_state(new_plane_state, crtc_state, -						  DRM_PLANE_HELPER_NO_SCALING, -						  DRM_PLANE_HELPER_NO_SCALING, +						  DRM_PLANE_NO_SCALING, +						  DRM_PLANE_NO_SCALING,  						  true, true);  	if (ret)  		return ret; @@ -1058,6 +1066,8 @@ ast_crtc_helper_mode_valid(struct drm_crtc *crtc, const struct drm_display_mode  			return MODE_OK;  		if ((mode->hdisplay == 1600) && (mode->vdisplay == 900))  			return MODE_OK; +		if ((mode->hdisplay == 1152) && (mode->vdisplay == 864)) +			return MODE_OK;  		if ((ast->chip == AST2100) || (ast->chip == AST2200) ||  		    (ast->chip == AST2300) || (ast->chip == AST2400) || @@ -1090,6 +1100,10 @@ ast_crtc_helper_mode_valid(struct drm_crtc *crtc, const struct drm_display_mode  		if (mode->vdisplay == 768)  			status = MODE_OK;  		break; +	case 1152: +		if (mode->vdisplay == 864) +			status = MODE_OK; +		break;  	case 1280:  		if (mode->vdisplay == 1024)  			status = MODE_OK;  |