dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Jocelyn Falempe <jfalempe@redhat.com>
To: Thomas Zimmermann <tzimmermann@suse.de>, airlied@redhat.com
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 02/10] drm/ast: Move Gen7+ POST code to separate source file
Date: Thu, 3 Jul 2025 12:28:29 +0200	[thread overview]
Message-ID: <e1784cd6-2bfa-4939-ab8f-fd81b46dc21b@redhat.com> (raw)
In-Reply-To: <20250702132431.249329-3-tzimmermann@suse.de>

On 02/07/2025 15:12, Thomas Zimmermann wrote:
> 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.

Thanks, it looks good to me.

Only a cosmetic comment below.

Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
>   drivers/gpu/drm/ast/Makefile   |  1 +
>   drivers/gpu/drm/ast/ast_2600.c | 46 ++++++++++++++++++++++++++++++++++
>   drivers/gpu/drm/ast/ast_drv.h  |  3 +++
>   drivers/gpu/drm/ast/ast_post.c |  8 +++---
>   4 files changed, 53 insertions(+), 5 deletions(-)
>   create mode 100644 drivers/gpu/drm/ast/ast_2600.c
> 
> diff --git a/drivers/gpu/drm/ast/Makefile b/drivers/gpu/drm/ast/Makefile
> index 8d09ba5d5889..0f09e0fa741b 100644
> --- a/drivers/gpu/drm/ast/Makefile
> +++ b/drivers/gpu/drm/ast/Makefile
> @@ -4,6 +4,7 @@
>   # Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.
>   
>   ast-y := \
> +	ast_2600.o \
>   	ast_cursor.o \
>   	ast_ddc.o \
>   	ast_dp501.o \
> diff --git a/drivers/gpu/drm/ast/ast_2600.c b/drivers/gpu/drm/ast/ast_2600.c
> new file mode 100644
> index 000000000000..556571efa0b2
> --- /dev/null
> +++ b/drivers/gpu/drm/ast/ast_2600.c
> @@ -0,0 +1,46 @@
> +// SPDX-License-Identifier: MIT
> +/*
> + * Copyright 2012 Red Hat Inc.
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the
> + * "Software"), to deal in the Software without restriction, including
> + * without limitation the rights to use, copy, modify, merge, publish,
> + * distribute, sub license, and/or sell copies of the Software, and to
> + * permit persons to whom the Software is furnished to do so, subject to
> + * the following conditions:
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
> + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
> + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
> + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
> + * USE OR OTHER DEALINGS IN THE SOFTWARE.
> + *
> + * The above copyright notice and this permission notice (including the
> + * next paragraph) shall be included in all copies or substantial portions
> + * of the Software.
> + */
> +/*
> + * Authors: Dave Airlie <airlied@redhat.com>
> + */
> +
> +#include "ast_drv.h"
> +
> +/*
> + * POST
> + */
> +
> +int ast_2600_post(struct ast_device *ast)
> +{
> +	int ret;
> +
> +	if (ast->tx_chip == AST_TX_ASTDP) {
> +		ret = ast_dp_launch(ast);
> +		if (ret)
> +			return ret;

That can be simplified, as the ret variable isn't useful.

if (ast->tx_chip == AST_TX_ASTDP)
	return ast_dp_launch(ast0);

> +	}
> +
> +	return 0;
> +}
> diff --git a/drivers/gpu/drm/ast/ast_drv.h b/drivers/gpu/drm/ast/ast_drv.h
> index 2ee402096cd9..570c2fe98b58 100644
> --- a/drivers/gpu/drm/ast/ast_drv.h
> +++ b/drivers/gpu/drm/ast/ast_drv.h
> @@ -417,6 +417,9 @@ struct ast_crtc_state {
>   
>   int ast_mm_init(struct ast_device *ast);
>   
> +/* ast_2600.c */
> +int ast_2600_post(struct ast_device *ast);
> +
>   /* ast post */
>   int ast_post_gpu(struct ast_device *ast);
>   u32 ast_mindwm(struct ast_device *ast, u32 r);
> diff --git a/drivers/gpu/drm/ast/ast_post.c b/drivers/gpu/drm/ast/ast_post.c
> index 36542d266f9c..03a7367bdc71 100644
> --- a/drivers/gpu/drm/ast/ast_post.c
> +++ b/drivers/gpu/drm/ast/ast_post.c
> @@ -348,11 +348,9 @@ int ast_post_gpu(struct ast_device *ast)
>   	ast_set_def_ext_reg(ast);
>   
>   	if (AST_GEN(ast) >= 7) {
> -		if (ast->tx_chip == AST_TX_ASTDP) {
> -			ret = ast_dp_launch(ast);
> -			if (ret)
> -				return ret;
> -		}
> +		ret = ast_2600_post(ast);
> +		if (ret)
> +			return ret;
>   	} else if (AST_GEN(ast) >= 6) {
>   		if (ast->config_mode == ast_use_p2a) {
>   			ast_post_chip_2500(ast);


  reply	other threads:[~2025-07-03 10:28 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-02 13:12 [PATCH 00/10] drm/ast: Split POST code per hardware gen Thomas Zimmermann
2025-07-02 13:12 ` [PATCH 01/10] drm/ast: Declare helpers for POST in header Thomas Zimmermann
2025-07-03 10:24   ` Jocelyn Falempe
2025-07-02 13:12 ` [PATCH 02/10] drm/ast: Move Gen7+ POST code to separate source file Thomas Zimmermann
2025-07-03 10:28   ` Jocelyn Falempe [this message]
2025-07-02 13:12 ` [PATCH 03/10] drm/ast: Move Gen6+ " Thomas Zimmermann
2025-07-03 13:09   ` Jocelyn Falempe
2025-07-02 13:12 ` [PATCH 04/10] drm/ast: Move Gen4+ " Thomas Zimmermann
2025-07-03 13:10   ` Jocelyn Falempe
2025-07-02 13:12 ` [PATCH 05/10] drm/ast: Move Gen2+ and Gen1 POST code to separate source files Thomas Zimmermann
2025-07-03 13:10   ` Jocelyn Falempe
2025-07-02 13:12 ` [PATCH 06/10] drm/ast: Move struct ast_dramstruct to ast_post.h Thomas Zimmermann
2025-07-03 13:10   ` Jocelyn Falempe
2025-07-02 13:12 ` [PATCH 07/10] drm/ast: Handle known struct ast_dramstruct with helpers Thomas Zimmermann
2025-07-03 13:11   ` Jocelyn Falempe
2025-07-02 13:12 ` [PATCH 08/10] drm/ast: Split ast_set_def_ext_reg() by chip generation Thomas Zimmermann
2025-07-03 13:11   ` Jocelyn Falempe
2025-07-02 13:12 ` [PATCH 09/10] drm/ast: Gen7: Disable VGASR0[1] as on Gen4+ Thomas Zimmermann
2025-07-03 13:12   ` Jocelyn Falempe
2025-07-02 13:12 ` [PATCH 10/10] drm/ast: Gen7: Switch default registers to gen4+ state Thomas Zimmermann
2025-07-03 13:12   ` Jocelyn Falempe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e1784cd6-2bfa-4939-ab8f-fd81b46dc21b@redhat.com \
    --to=jfalempe@redhat.com \
    --cc=airlied@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).