Skip to content

Commit f67fb98

Browse files
author
Thomas Zimmermann
committed
drm/ast: Move Gen7+ POST code to separate source file
Move POST code for Gen7+ to separate source file and hide it in ast_2600_post(). There's not much going on here except for enabling the DP transmitter chip. v2: - simplify logic (Jocelyn) Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Jocelyn Falempe <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 26ef96e commit f67fb98

File tree

4 files changed

+48
-5
lines changed

4 files changed

+48
-5
lines changed

drivers/gpu/drm/ast/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.
55

66
ast-y := \
7+
ast_2600.o \
78
ast_cursor.o \
89
ast_ddc.o \
910
ast_dp501.o \

drivers/gpu/drm/ast/ast_2600.c

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// SPDX-License-Identifier: MIT
2+
/*
3+
* Copyright 2012 Red Hat Inc.
4+
*
5+
* Permission is hereby granted, free of charge, to any person obtaining a
6+
* copy of this software and associated documentation files (the
7+
* "Software"), to deal in the Software without restriction, including
8+
* without limitation the rights to use, copy, modify, merge, publish,
9+
* distribute, sub license, and/or sell copies of the Software, and to
10+
* permit persons to whom the Software is furnished to do so, subject to
11+
* the following conditions:
12+
*
13+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
16+
* THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
17+
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
18+
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
19+
* USE OR OTHER DEALINGS IN THE SOFTWARE.
20+
*
21+
* The above copyright notice and this permission notice (including the
22+
* next paragraph) shall be included in all copies or substantial portions
23+
* of the Software.
24+
*/
25+
/*
26+
* Authors: Dave Airlie <[email protected]>
27+
*/
28+
29+
#include "ast_drv.h"
30+
31+
/*
32+
* POST
33+
*/
34+
35+
int ast_2600_post(struct ast_device *ast)
36+
{
37+
if (ast->tx_chip == AST_TX_ASTDP)
38+
return ast_dp_launch(ast);
39+
40+
return 0;
41+
}

drivers/gpu/drm/ast/ast_drv.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,9 @@ struct ast_crtc_state {
417417

418418
int ast_mm_init(struct ast_device *ast);
419419

420+
/* ast_2600.c */
421+
int ast_2600_post(struct ast_device *ast);
422+
420423
/* ast post */
421424
int ast_post_gpu(struct ast_device *ast);
422425
u32 ast_mindwm(struct ast_device *ast, u32 r);

drivers/gpu/drm/ast/ast_post.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -348,11 +348,9 @@ int ast_post_gpu(struct ast_device *ast)
348348
ast_set_def_ext_reg(ast);
349349

350350
if (AST_GEN(ast) >= 7) {
351-
if (ast->tx_chip == AST_TX_ASTDP) {
352-
ret = ast_dp_launch(ast);
353-
if (ret)
354-
return ret;
355-
}
351+
ret = ast_2600_post(ast);
352+
if (ret)
353+
return ret;
356354
} else if (AST_GEN(ast) >= 6) {
357355
if (ast->config_mode == ast_use_p2a) {
358356
ast_post_chip_2500(ast);

0 commit comments

Comments
 (0)