From: Thomas Zimmermann <tzimmermann@suse.de>
To: Jocelyn Falempe <jfalempe@redhat.com>,
airlied@redhat.com, kuohsiang_chou@aspeedtech.com,
jammy_huang@aspeedtech.com, jani.nikula@linux.intel.com,
dianders@chromium.org
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v4 1/2] drm/ast: Add BMC virtual connector
Date: Wed, 12 Jul 2023 15:59:46 +0200 [thread overview]
Message-ID: <d498ca60-828f-e035-ceff-df495bec765d@suse.de> (raw)
In-Reply-To: <20230712132826.287126-1-jfalempe@redhat.com>
[-- Attachment #1.1: Type: text/plain, Size: 4411 bytes --]
Hi
Am 12.07.23 um 15:27 schrieb Jocelyn Falempe:
> Most aspeed devices have a BMC, which allows to remotely see the screen.
> Also in the common use case, those servers don't have a display connected.
> So add a Virtual connector, to reflect that even if no display is
> connected, the framebuffer can still be seen remotely.
> This prepares the work to implement a detect_ctx() for the Display port
> connector.
>
> v4: call drm_add_modes_noedid() with 4096x4096 (Thomas Zimmermann)
> remove useless struct field init to 0 (Thomas Zimmermann)
> don't use drm_simple_encoder_init() (Thomas Zimmermann)
> inline ast_bmc_connector_init() (Thomas Zimmermann)
>
> Fixes: fae7d186403e ("drm/probe-helper: Default to 640x480 if no EDID on DP")
> Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
> ---
> drivers/gpu/drm/ast/ast_drv.h | 4 +++
> drivers/gpu/drm/ast/ast_mode.c | 58 ++++++++++++++++++++++++++++++++++
> 2 files changed, 62 insertions(+)
>
> diff --git a/drivers/gpu/drm/ast/ast_drv.h b/drivers/gpu/drm/ast/ast_drv.h
> index 3f6e0c984523..c9659e72002f 100644
> --- a/drivers/gpu/drm/ast/ast_drv.h
> +++ b/drivers/gpu/drm/ast/ast_drv.h
> @@ -214,6 +214,10 @@ struct ast_device {
> struct drm_encoder encoder;
> struct drm_connector connector;
> } astdp;
> + struct {
> + struct drm_encoder encoder;
> + struct drm_connector connector;
> + } bmc;
> } output;
>
> bool support_wide_screen;
> diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
> index f711d592da52..1a8293162fec 100644
> --- a/drivers/gpu/drm/ast/ast_mode.c
> +++ b/drivers/gpu/drm/ast/ast_mode.c
> @@ -1735,6 +1735,61 @@ static int ast_astdp_output_init(struct ast_device *ast)
> return 0;
> }
>
> +/*
> + * BMC virtual Connector
> + */
> +
> +static int ast_bmc_connector_helper_get_modes(struct drm_connector *connector)
> +{
> + return drm_add_modes_noedid(connector, 4096, 4096);
> +}
> +
> +static const struct drm_connector_helper_funcs ast_bmc_connector_helper_funcs = {
> + .get_modes = ast_bmc_connector_helper_get_modes,
> +};
> +
> +static const struct drm_connector_funcs ast_bmc_connector_funcs = {
> + .reset = drm_atomic_helper_connector_reset,
> + .fill_modes = drm_helper_probe_single_connector_modes,
> + .destroy = drm_connector_cleanup,
> + .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
> + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
> +};
> +
> +static const struct drm_encoder_funcs ast_bmc_encoder_funcs = {
> + .destroy = drm_encoder_cleanup,
> +};
Pedantic comment: The encoder goes right before the connector code. The
order through the file is planes->crtc->encoder->connector, as that's
the order in the pipeline and the order in which the pipeline is being
set up. With this little fix:
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Best regards
Thomas
> +
> +static int ast_bmc_output_init(struct ast_device *ast)
> +{
> + struct drm_device *dev = &ast->base;
> + struct drm_crtc *crtc = &ast->crtc;
> + struct drm_encoder *encoder = &ast->output.bmc.encoder;
> + struct drm_connector *connector = &ast->output.bmc.connector;
> + int ret;
> +
> +
> + ret = drm_encoder_init(dev, encoder,
> + &ast_bmc_encoder_funcs,
> + DRM_MODE_ENCODER_VIRTUAL, "ast_bmc");
> + if (ret)
> + return ret;
> + encoder->possible_crtcs = drm_crtc_mask(crtc);
> +
> + ret = drm_connector_init(dev, connector, &ast_bmc_connector_funcs,
> + DRM_MODE_CONNECTOR_VIRTUAL);
> + if (ret)
> + return ret;
> +
> + drm_connector_helper_add(connector, &ast_bmc_connector_helper_funcs);
> +
> + ret = drm_connector_attach_encoder(connector, encoder);
> + if (ret)
> + return ret;
> +
> + return 0;
> +}
> +
> /*
> * Mode config
> */
> @@ -1842,6 +1897,9 @@ int ast_mode_config_init(struct ast_device *ast)
> if (ret)
> return ret;
> }
> + ret = ast_bmc_output_init(ast);
> + if (ret)
> + return ret;
>
> drm_mode_config_reset(dev);
>
>
> base-commit: b32d5a51f3c21843011d68a58e6ac0b897bce9f2
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
prev parent reply other threads:[~2023-07-12 13:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-12 13:27 [PATCH v4 1/2] drm/ast: Add BMC virtual connector Jocelyn Falempe
2023-07-12 13:27 ` [PATCH v4 2/2] drm/ast: report connection status on Display Port Jocelyn Falempe
2023-07-12 13:55 ` Thomas Zimmermann
2023-07-12 14:39 ` Jocelyn Falempe
2023-07-12 14:51 ` Thomas Zimmermann
2023-07-12 13:59 ` Thomas Zimmermann [this message]
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=d498ca60-828f-e035-ceff-df495bec765d@suse.de \
--to=tzimmermann@suse.de \
--cc=airlied@redhat.com \
--cc=dianders@chromium.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=jammy_huang@aspeedtech.com \
--cc=jani.nikula@linux.intel.com \
--cc=jfalempe@redhat.com \
--cc=kuohsiang_chou@aspeedtech.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.