dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Rob Clark <robdclark@gmail.com>
Cc: dri-devel@lists.freedesktop.org,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Andy Yan <andy.yan@rock-chips.com>
Subject: Re: [PATCH v2 7/7] drm/fb: handle tiled connectors better
Date: Wed, 11 Mar 2015 22:13:27 +0100	[thread overview]
Message-ID: <20150311211327.GR3800@phenom.ffwll.local> (raw)
In-Reply-To: <1426083794-11972-8-git-send-email-robdclark@gmail.com>

On Wed, Mar 11, 2015 at 10:23:14AM -0400, Rob Clark wrote:
> We don't want tile 0,0 to artificially constrain the size of the legacy
> fbdev device.  Instead when reducing fb_size to be the minimum of all
> displays, only consider the rightmost and bottommost tiles.
> 
> Signed-off-by: Rob Clark <robdclark@gmail.com>
> Tested-by: Hai Li <hali@codeaurora.org>

Yeah checkpatch isn't really happy about this and the previous one now,
but I didn't really see a easy way to fix it and it's late ;-) So pulled
them all into drm-misc.

Thanks, Daniel

> ---
>  drivers/gpu/drm/drm_fb_helper.c | 26 +++++++++++++++++++++++---
>  1 file changed, 23 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index dca98a4..1a20db7 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -1034,9 +1034,16 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper,
>  	crtc_count = 0;
>  	for (i = 0; i < fb_helper->crtc_count; i++) {
>  		struct drm_display_mode *desired_mode;
> -		int x, y;
> +		struct drm_mode_set *mode_set;
> +		int x, y, j;
> +		/* in case of tile group, are we the last tile vert or horiz?
> +		 * If no tile group you are always the last one both vertically
> +		 * and horizontally
> +		 */
> +		bool lastv = true, lasth = true;
>  
>  		desired_mode = fb_helper->crtc_info[i].desired_mode;
> +		mode_set = &fb_helper->crtc_info[i].mode_set;
>  
>  		if (!desired_mode)
>  			continue;
> @@ -1051,8 +1058,21 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper,
>  
>  		sizes.surface_width  = max_t(u32, desired_mode->hdisplay + x, sizes.surface_width);
>  		sizes.surface_height = max_t(u32, desired_mode->vdisplay + y, sizes.surface_height);
> -		sizes.fb_width  = min_t(u32, desired_mode->hdisplay + x, sizes.fb_width);
> -		sizes.fb_height = min_t(u32, desired_mode->vdisplay + y, sizes.fb_height);
> +
> +		for (j = 0; j < mode_set->num_connectors; j++) {
> +			struct drm_connector *connector = mode_set->connectors[j];
> +			if (connector->has_tile) {
> +				lasth = (connector->tile_h_loc == (connector->num_h_tile - 1));
> +				lastv = (connector->tile_v_loc == (connector->num_v_tile - 1));
> +				/* cloning to multiple tiles is just crazy-talk, so: */
> +				break;
> +			}
> +		}
> +
> +		if (lasth)
> +			sizes.fb_width  = min_t(u32, desired_mode->hdisplay + x, sizes.fb_width);
> +		if (lastv)
> +			sizes.fb_height = min_t(u32, desired_mode->vdisplay + y, sizes.fb_height);
>  	}
>  
>  	if (crtc_count == 0 || sizes.fb_width == -1 || sizes.fb_height == -1) {
> -- 
> 2.1.0
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2015-03-11 21:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-11 14:23 [PATCH v2 0/7] drm/fb: width/height cleanups/fixes Rob Clark
2015-03-11 14:23 ` [PATCH v2 1/7] drm/fb: document drm_fb_helper_surface_size Rob Clark
2015-03-11 14:23 ` [PATCH v2 2/7] drm/atomic: minor kerneldoc typo fix Rob Clark
2015-03-11 14:23 ` [PATCH v2 3/7] drm/cma: use correct fb width/height Rob Clark
2015-03-11 14:23 ` [PATCH v2 4/7] drm/exynos: " Rob Clark
2015-03-11 14:23 ` [PATCH v2 5/7] drm/rockchip: " Rob Clark
2015-03-11 14:23 ` [PATCH v2 6/7] drm/fb: small cleanup Rob Clark
2015-03-11 17:51   ` Laurent Pinchart
2015-03-11 14:23 ` [PATCH v2 7/7] drm/fb: handle tiled connectors better Rob Clark
2015-03-11 21:13   ` Daniel Vetter [this message]
2015-03-11 21:21     ` Rob Clark
2015-03-11 16:40 ` [PATCH v2 0/7] drm/fb: width/height cleanups/fixes Alex Deucher
2015-03-11 17:52 ` Laurent Pinchart

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=20150311211327.GR3800@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=andy.yan@rock-chips.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=robdclark@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox