<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Thanks Ville and Daniel for for your response.<br>
</p>
<p>I will try to come back with something later.<br>
</p>
thanks<br>
Lukasz<br>
<div class="moz-cite-prefix">On 21/12/2017 14:10, Daniel Vetter
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:20171221131040.GX26573@phenom.ffwll.local">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
On Thu, Dec 21, 2017 at 02:46:55PM +0200, Ville Syrjälä wrote:<br>
> On Thu, Dec 21, 2017 at 12:10:08PM +0100, Lukasz Spintzyk
wrote:<br>
> > Change-Id: I63dce004f8d3c5dc6a7c71070f1fab0707286ea5<br>
> > Signed-off-by: Lukasz Spintzyk
<a class="moz-txt-link-rfc2396E" href="mailto:lukasz.spintzyk@displaylink.com"><lukasz.spintzyk@displaylink.com></a><br>
> > ---<br>
> > drivers/gpu/drm/drm_atomic.c | 10 ++++++++++<br>
> > drivers/gpu/drm/drm_mode_config.c | 6 ++++++<br>
> > drivers/gpu/drm/drm_plane.c | 1 +<br>
> > include/drm/drm_mode_config.h | 5 +++++<br>
> > include/drm/drm_plane.h | 3 +++<br>
> > 5 files changed, 25 insertions(+)<br>
> > <br>
> > diff --git a/drivers/gpu/drm/drm_atomic.c
b/drivers/gpu/drm/drm_atomic.c<br>
> > index b76d49218cf1..cd3b4ed7b04c 100644<br>
> > --- a/drivers/gpu/drm/drm_atomic.c<br>
> > +++ b/drivers/gpu/drm/drm_atomic.c<br>
> > @@ -759,6 +759,14 @@ static int
drm_atomic_plane_set_property(struct drm_plane *plane,<br>
> > state->rotation = val;<br>
> > } else if (property == plane->zpos_property) {<br>
> > state->zpos = val;<br>
> > + } else if (property ==
config->dirty_rects_property) {<br>
> > + bool replaced = false;<br>
> > + int ret =
drm_atomic_replace_property_blob_from_id(dev,<br>
> > + &state->dirty_blob,<br>
> > + val,<br>
> > + -1,<br>
> > + &replaced);<br>
> > + return ret;<br>
> > } else if (plane->funcs->atomic_set_property) {<br>
> > return plane->funcs->atomic_set_property(plane,
state,<br>
> > property, val);<br>
> > @@ -818,6 +826,8 @@ drm_atomic_plane_get_property(struct
drm_plane *plane,<br>
> > *val = state->rotation;<br>
> > } else if (property == plane->zpos_property) {<br>
> > *val = state->zpos;<br>
> > + } else if (property ==
config->dirty_rects_property) {<br>
> > + *val = (state->dirty_blob) ?
state->dirty_blob->base.id : 0;<br>
> > } else if (plane->funcs->atomic_get_property) {<br>
> > return plane->funcs->atomic_get_property(plane,
state, property, val);<br>
> > } else {<br>
> > diff --git a/drivers/gpu/drm/drm_mode_config.c
b/drivers/gpu/drm/drm_mode_config.c<br>
> > index bc5c46306b3d..d5f1021c6ece 100644<br>
> > --- a/drivers/gpu/drm/drm_mode_config.c<br>
> > +++ b/drivers/gpu/drm/drm_mode_config.c<br>
> > @@ -293,6 +293,12 @@ static int
drm_mode_create_standard_properties(struct drm_device *dev)<br>
> > return -ENOMEM;<br>
> > dev->mode_config.prop_crtc_id = prop;<br>
> > <br>
> > + prop = drm_property_create(dev, DRM_MODE_PROP_BLOB,<br>
> > + "DIRTY_RECTS", 0);<br>
> > + if (!prop)<br>
> > + return -ENOMEM;<br>
> > + dev->mode_config.dirty_rects_property = prop;<br>
> > +<br>
> > prop = drm_property_create_bool(dev,
DRM_MODE_PROP_ATOMIC,<br>
> > "ACTIVE");<br>
> > if (!prop)<br>
> > diff --git a/drivers/gpu/drm/drm_plane.c
b/drivers/gpu/drm/drm_plane.c<br>
> > index 37a93cdffb4a..add110f025e5 100644<br>
> > --- a/drivers/gpu/drm/drm_plane.c<br>
> > +++ b/drivers/gpu/drm/drm_plane.c<br>
> > @@ -258,6 +258,7 @@ int drm_universal_plane_init(struct
drm_device *dev, struct drm_plane *plane,<br>
> > drm_object_attach_property(&plane->base,
config->prop_src_y, 0);<br>
> > drm_object_attach_property(&plane->base,
config->prop_src_w, 0);<br>
> > drm_object_attach_property(&plane->base,
config->prop_src_h, 0);<br>
> > + drm_object_attach_property(&plane->base,
config->dirty_rects_property, 0);<br>
> > }<br>
> > <br>
> > if (config->allow_fb_modifiers)<br>
> > diff --git a/include/drm/drm_mode_config.h
b/include/drm/drm_mode_config.h<br>
> > index e5f3b43014e1..65f64eb04c0c 100644<br>
> > --- a/include/drm/drm_mode_config.h<br>
> > +++ b/include/drm/drm_mode_config.h<br>
> > @@ -599,6 +599,11 @@ struct drm_mode_config {<br>
> > * &drm_crtc.<br>
> > */<br>
> > struct drm_property *prop_crtc_id;<br>
> > + /**<br>
> > + * @dirty_rects_property: Optional plane property to
mark damaged<br>
> > + * regions on the plane framebuffer.<br>
> <br>
> What exactly would the blob contain?<br>
> <br>
> The comment seems to be implying these are in fb coordiantes
as<br>
> opposed to plane crtc coordinates? Not sure which would be
more<br>
> convenient. At least if they're fb coordinates then you
probably<br>
> want some helpers to translate/rotate/scale those rects to
the<br>
> crtc coordinates. Actual use depends on the driver/hw I
suppose.<br>
<br>
Yeah I think we also should add a decoded state to the
drm_plane_state,<br>
which has the full structure and all the details.<br>
</blockquote>
Ok.<br>
Initially for model I was thinking to take struct drm_drawable_info
with simple c style array of struct drm_clip_rect *rects in it.<br>
Do you think that something more complex will be needed?<br>
<br>
<blockquote type="cite"
cite="mid:20171221131040.GX26573@phenom.ffwll.local">
<br>
And when we discussed this iirc we've identified a clear need for
at least<br>
some drivers to deal in crtc dirty rectangles. I think the initial
core<br>
support should include a helper which takes an atomic update for a
given<br>
crtc, and converts all the plane dirty rectangles into crtc
rectangles.<br>
Including any full-plane or full-crtc upgrades needed due to e.g.<br>
reposition, changed gamma, changed blendign/zpos or anything else
really<br>
that would affect the entire plane respectively crtc. That would
also<br>
provide a really good model for what damage actually means.<br>
</blockquote>
Ok.<br>
<blockquote type="cite"
cite="mid:20171221131040.GX26573@phenom.ffwll.local">
Plus ofc we need userspace for this, preferrably as a patch to
something<br>
generic like weston or xfree86-video-modesetting. And an example
kernel<br>
implementation.<br>
</blockquote>
What kernel example would you think is the quickest/simplest for the
proof of concept?<br>
<br>
I wanted to have something working on ChromeOS compositor first.<br>
Do you think it would satisfy need of userspace application?<br>
<br>
<blockquote type="cite"
cite="mid:20171221131040.GX26573@phenom.ffwll.local">
<br>
Cheers, Daniel<br>
<br>
> <br>
> > + */<br>
> > + struct drm_property *dirty_rects_property;<br>
> > /**<br>
> > * @prop_active: Default atomic CRTC property to control
the active<br>
> > * state, which is the simplified implementation for DPMS
in atomic<br>
> > diff --git a/include/drm/drm_plane.h
b/include/drm/drm_plane.h<br>
> > index 8185e3468a23..7d45b164ccce 100644<br>
> > --- a/include/drm/drm_plane.h<br>
> > +++ b/include/drm/drm_plane.h<br>
> > @@ -131,6 +131,9 @@ struct drm_plane_state {<br>
> > */<br>
> > struct drm_crtc_commit *commit;<br>
> > <br>
> > + /* Optional blob property with damaged regions. */<br>
> > + struct drm_property_blob *dirty_blob;<br>
> > +<br>
> > struct drm_atomic_state *state;<br>
> > };<br>
> > <br>
> > -- <br>
> > 2.15.1<br>
> > <br>
> > _______________________________________________<br>
> > dri-devel mailing list<br>
> > <a class="moz-txt-link-abbreviated" href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.org</a><br>
> > <a moz-do-not-send="true" href="https://lists.freedesktop.org/mailman/listinfo/dri-devel">https://lists.freedesktop.org/mailman/listinfo/dri-devel</a><br>
> <br>
> -- <br>
> Ville Syrjälä<br>
> Intel OTC<br>
> _______________________________________________<br>
> dri-devel mailing list<br>
> <a class="moz-txt-link-abbreviated" href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.org</a><br>
> <a moz-do-not-send="true" href="https://lists.freedesktop.org/mailman/listinfo/dri-devel">https://lists.freedesktop.org/mailman/listinfo/dri-devel</a><br>
<br>
-- <br>
Daniel Vetter<br>
Software Engineer, Intel Corporation<br>
<a moz-do-not-send="true" href="http://blog.ffwll.ch">http://blog.ffwll.ch</a><br>
</blockquote>
<br>
</body>
</html>