From: Javier Martinez Canillas <javierm@redhat.com>
To: Thomas Zimmermann <tzimmermann@suse.de>,
airlied@redhat.com, sean@poorly.run, daniel@ffwll.ch
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 02/16] drm/udl: Test pixel limit in mode-config's mode-valid function
Date: Thu, 29 Sep 2022 15:20:54 +0200 [thread overview]
Message-ID: <562ca68d-a241-90e9-975b-c1274db329f6@redhat.com> (raw)
In-Reply-To: <20220919130408.21486-3-tzimmermann@suse.de>
On 9/19/22 15:03, Thomas Zimmermann wrote:
> The sku_pixel_limit is a per-device property, similar to the amount
> of available video memory. Move the respective mode-valid test from
> the connector to the mode-config structure.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
[...]
> +static enum drm_mode_status udl_mode_config_mode_valid(struct drm_device *dev,
> + const struct drm_display_mode *mode)
> +{
> + struct udl_device *udl = to_udl(dev);
> +
> + if (udl->sku_pixel_limit) {
> + if (mode->vdisplay * mode->hdisplay > udl->sku_pixel_limit)
> + return MODE_MEM;
> + }
> +
> + return MODE_OK;
> +}
> +
> static const struct drm_mode_config_funcs udl_mode_funcs = {
> .fb_create = drm_gem_fb_create_with_dirty,
> + .mode_valid = udl_mode_config_mode_valid,
> .atomic_check = drm_atomic_helper_check,
> .atomic_commit = drm_atomic_helper_commit,
> };
It's always confusing to me whether something has to be in the .mode_valid
for drm_mode_config helper function or for the drm_crtc_helper_funcs. This
driver is still using the simple-KMS at this point so that will be in the
udl_simple_display_pipe_mode_valid() if should be the latter.
In this case since it seems to be about a pixel limit, it might make sense
to have this constraint for the DRM mode config. But since it depends on the
{h,v}display, I thought that needed to ask if instead should be for the CRTC.
Any in case,
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
--
Best regards,
Javier Martinez Canillas
Core Platforms
Red Hat
next prev parent reply other threads:[~2022-09-29 13:21 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-19 13:03 [PATCH 00/16] drm/udl: Better modesetting, hot-unplug, protocol Thomas Zimmermann
2022-09-19 13:03 ` [PATCH 01/16] drm/udl: Rename struct udl_drm_connector to struct udl_connector Thomas Zimmermann
2022-09-29 12:51 ` Javier Martinez Canillas
2022-09-19 13:03 ` [PATCH 02/16] drm/udl: Test pixel limit in mode-config's mode-valid function Thomas Zimmermann
2022-09-29 13:20 ` Javier Martinez Canillas [this message]
2022-09-29 13:53 ` Thomas Zimmermann
2022-09-19 13:03 ` [PATCH 03/16] drm/udl: Use USB timeout constant when reading EDID Thomas Zimmermann
2022-09-29 13:23 ` Javier Martinez Canillas
2022-09-19 13:03 ` [PATCH 04/16] drm/udl: Various improvements to the connector Thomas Zimmermann
2022-09-29 13:44 ` Javier Martinez Canillas
2022-09-19 13:03 ` [PATCH 05/16] drm/udl: Move connector to modesetting code Thomas Zimmermann
2022-09-29 13:47 ` Javier Martinez Canillas
2022-09-19 13:03 ` [PATCH 06/16] drm/udl: Remove udl_simple_display_pipe_mode_valid() Thomas Zimmermann
2022-09-29 13:49 ` Javier Martinez Canillas
2022-09-19 13:03 ` [PATCH 07/16] drm/udl: Convert to atomic-modesetting helpers Thomas Zimmermann
2022-09-29 14:21 ` Javier Martinez Canillas
2022-09-19 13:04 ` [PATCH 08/16] drm/udl: Simplify modesetting in CRTC's enable function Thomas Zimmermann
2022-09-29 14:28 ` Javier Martinez Canillas
2022-09-19 13:04 ` [PATCH 09/16] drm/udl: Support DRM hot-unplugging Thomas Zimmermann
2022-10-04 22:17 ` Javier Martinez Canillas
2022-09-19 13:04 ` [PATCH 10/16] drm/udl: Use damage iterator Thomas Zimmermann
2022-10-04 22:28 ` Javier Martinez Canillas
2022-10-05 15:26 ` Thomas Zimmermann
2022-09-19 13:04 ` [PATCH 11/16] drm/udl: Move register constants to udl_proto.h Thomas Zimmermann
2022-10-04 22:39 ` Javier Martinez Canillas
2022-09-19 13:04 ` [PATCH 12/16] drm/udl: Add constants for display-mode registers Thomas Zimmermann
2022-10-04 22:50 ` Javier Martinez Canillas
2022-09-19 13:04 ` [PATCH 13/16] drm/udl: Add register constants for color depth Thomas Zimmermann
2022-10-04 22:51 ` Javier Martinez Canillas
2022-09-19 13:04 ` [PATCH 14/16] drm/udl: Add register constants for video locks Thomas Zimmermann
2022-10-04 22:52 ` Javier Martinez Canillas
2022-09-19 13:04 ` [PATCH 15/16] drm/udl: Add register constants for framebuffer scanout addresses Thomas Zimmermann
2022-10-04 22:59 ` Javier Martinez Canillas
2022-10-05 14:56 ` Thomas Zimmermann
2022-09-19 13:04 ` [PATCH 16/16] drm/udl: Add constants for commands Thomas Zimmermann
2022-10-04 23:00 ` Javier Martinez Canillas
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=562ca68d-a241-90e9-975b-c1274db329f6@redhat.com \
--to=javierm@redhat.com \
--cc=airlied@redhat.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=sean@poorly.run \
--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).