All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcus Lorentzon <marcus.xm.lorentzon@stericsson.com>
To: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: "intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 1/4] drm: add plane support
Date: Wed, 8 Jun 2011 11:41:17 +0200	[thread overview]
Message-ID: <4DEF43BD.8040606@stericsson.com> (raw)
In-Reply-To: <20110607140121.279bf9b4@jbarnes-desktop>

On 06/07/2011 11:01 PM, Jesse Barnes wrote:
> On Tue,  7 Jun 2011 13:07:39 -0700
> Jesse Barnes<jbarnes@virtuousgeek.org>  wrote:
>
>    
>> +/* Planes blend with or override other bits on the CRTC */
>> +struct drm_mode_set_plane {
>> +	__u32 plane_id;
>> +	__u32 crtc_id;
>> +	__u32 fb_id; /* contains surface format type */
>> +
>> +	__u32 crtc_x, crtc_y;
>> +	__u32 x, y;
>> +
>> +	/* FIXME: color key/mask, scaling, z-order, other? */
>> +};
>>      
> Forgot to add the scaling factors to this.  Would:
>    __u32 scaling_x; /* fixed 16.16 format */
>    __u32 scaling_y;
> work for people?
>    

If you want to pan around in zoomed in video/viewfinder/snapshots it 
might be better to have a fixed 16.16 source rectangle and a integer 
destination rectangle. That way you can move around the zoomed in source 
rectangle in small increments and upscale it to destination rectangle 
(and skip fractions if HW don't support it). For example, if you zoom 4x 
and have only fixed 16.16 scaling factor, you still get the the integer 
fb (x, y) position in the top left corner (crtc_x, crtc_y) of the 
overlay. And when you pan in the overlay, you will have to move source 
rectangle in 4 destination pixel increments. So what about this instead:

__u32 x, y, src_w, src_h; /* fixed 16.16 */
__u32 crtc_x, crtc_y, crtc_w, crtc_h;

Maybe rename x, y to src_x, src_y? crtc_w/h is needed to define zoom 
factor (scaling_[wh] = crtc_[wh] / src_[wh]).

So the "zoom transform" would be defined by (src_x, src_y, src_w, src_h) 
=> (crtc_x, crtc_y, crtc_w, crtc_h)

It also gets rid of how to handle corner cases where scaling factor 
defines a source area outside source fb. Now you can just say both rect 
has to be inside crtc/fb. And you can also animate/move/clip a zoomed 
overlay off screen without picture jumping (fb and display coords don't 
align when zoomed).

Summary, rectangles allow more precise representation of zoom factor, 
and 16.16 source coords for stable image when moving overlay off screen 
(clipping) or panning overlay content.

BTW. Why not just add "__s32 z;" too? drm_mode_set_plane seems to be 
plane position setup.

/BR
/Marcus

  reply	other threads:[~2011-06-08  9:41 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-07 20:07 [RFC] Updated DRM plane handling patches Jesse Barnes
2011-06-07 20:07 ` [PATCH 1/4] drm: add plane support Jesse Barnes
2011-06-07 21:01   ` Jesse Barnes
2011-06-08  9:41     ` Marcus Lorentzon [this message]
2011-06-08 18:54       ` Jesse Barnes
2011-06-09  9:16         ` Marcus Lorentzon
2011-06-07 21:05   ` Jesse Barnes
2011-06-07 20:07 ` [PATCH 2/4] drm: add an fb creation ioctl that takes a pixel format Jesse Barnes
2011-06-09  4:05   ` Dave Airlie
2011-06-09  8:21     ` Alan Cox
2011-06-09 10:40       ` Dave Airlie
2011-06-09 11:55         ` Alan Cox
2011-06-21  9:48           ` Laurent Pinchart
2011-06-07 20:07 ` [PATCH 3/4] drm/i915: rename existing overlay support to "legacy" Jesse Barnes
2011-06-07 20:59   ` [Intel-gfx] " Chris Wilson
2011-06-07 20:07 ` [PATCH 4/4] drm/i915: add SNB video sprite support Jesse Barnes
2011-06-07 21:01   ` Chris Wilson
2011-06-15 17:29 ` [RFC] Updated DRM plane handling patches Jesse Barnes
2011-07-21 10:15   ` Joonyoung Shim
2011-07-21 17:15     ` Jesse Barnes
2011-06-20 20:11 [RFC] Updated plane support v3 Jesse Barnes
2011-06-20 20:11 ` [PATCH 1/4] drm: add plane support Jesse Barnes
2011-06-20 20:11   ` Jesse Barnes
2011-07-21 10:30   ` Joonyoung Shim
2011-07-21 17:14     ` Jesse Barnes
2011-07-25  8:18       ` Joonyoung Shim
2011-07-25 14:57         ` Rob Clark
2011-07-26  4:21           ` Joonyoung Shim
2011-07-22 13:52   ` Rob Clark
2011-07-22 15:30     ` Jesse Barnes
2011-07-22 15:57       ` Rob Clark
2011-07-22 22:18     ` Alan Cox

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=4DEF43BD.8040606@stericsson.com \
    --to=marcus.xm.lorentzon@stericsson.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jbarnes@virtuousgeek.org \
    /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.