From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Davis Subject: Re: [PATCH 1/2] drm: Add writeback_w,h properties Date: Wed, 10 Apr 2019 16:46:32 +0000 Message-ID: <20190410164631.GB5105@arm.com> References: <4509c625676508caf2b3f5035d901d8fe862fa76.1554891327.git.ben.davis@arm.com> <209a6f72-32b6-e546-4fd3-4c27d087d13c@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <209a6f72-32b6-e546-4fd3-4c27d087d13c@linux.intel.com> Content-Language: en-US Content-ID: <260EFEFFDD4E8642948B51C0B4BA3DD4@eurprd08.prod.outlook.com> Sender: linux-kernel-owner@vger.kernel.org To: Maarten Lankhorst Cc: "dri-devel@lists.freedesktop.org" , nd , Liviu Dudau , Brian Starkey , "airlied@linux.ie" , "daniel@ffwll.ch" , "maxime.ripard@bootlin.com" , "sean@poorly.run" , "linux-kernel@vger.kernel.org" List-Id: dri-devel@lists.freedesktop.org On Wed, Apr 10, 2019 at 01:48:51PM +0200, Maarten Lankhorst wrote: > Op 10-04-2019 om 13:11 schreef Ben Davis: > > Add new properties to specify width and height for writeback. > > > > Signed-off-by: Ben Davis > > --- > > drivers/gpu/drm/drm_atomic_uapi.c | 8 ++++++++ > > drivers/gpu/drm/drm_writeback.c | 28 ++++++++++++++++++++++++++++ > > include/drm/drm_connector.h | 4 ++++ > > include/drm/drm_mode_config.h | 10 ++++++++++ > > 4 files changed, 50 insertions(+) > > > > diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_at= omic_uapi.c > > index d520a04..1f68dce 100644 > > --- a/drivers/gpu/drm/drm_atomic_uapi.c > > +++ b/drivers/gpu/drm/drm_atomic_uapi.c > > @@ -765,6 +765,10 @@ static int drm_atomic_connector_set_property(struc= t drm_connector *connector, > > return -EINVAL; > > } > > state->content_protection =3D val; > > + } else if (property =3D=3D config->prop_writeback_w) { > > + state->writeback_w =3D val; > > + } else if (property =3D=3D config->prop_writeback_h) { > > + state->writeback_h =3D val; > > } else if (property =3D=3D config->writeback_fb_id_property) { > > struct drm_framebuffer *fb =3D drm_framebuffer_lookup(dev, NULL, val= ); > > int ret =3D drm_atomic_set_writeback_fb_for_connector(state, fb); > > @@ -837,6 +841,10 @@ drm_atomic_connector_get_property(struct drm_conne= ctor *connector, > > *val =3D state->scaling_mode; > > } else if (property =3D=3D connector->content_protection_property) { > > *val =3D state->content_protection; > > + } else if (property =3D=3D config->prop_writeback_w) { > > + *val =3D state->writeback_w; > > + } else if (property =3D=3D config->prop_writeback_h) { > > + *val =3D state->writeback_h; > > } else if (property =3D=3D config->writeback_fb_id_property) { > > /* Writeback framebuffer is one-shot, write and forget */ > > *val =3D 0; > > diff --git a/drivers/gpu/drm/drm_writeback.c b/drivers/gpu/drm/drm_writ= eback.c > > index c20e6fe..be42073 100644 > > --- a/drivers/gpu/drm/drm_writeback.c > > +++ b/drivers/gpu/drm/drm_writeback.c > > @@ -74,6 +74,12 @@ > > * applications making use of writeback connectors *always* retrieve a= n > > * out-fence for the commit and use it appropriately. > > * From userspace, this property will always read as zero. > > + * > > + * "WRITEBACK_W": > > + * The width of the writeback buffer to write back. > > + * > > + * "WRITEBACK_H": > > + * The height of the writeback buffer to write back. >=20 > What happens when they are not set, and left to default 0? >=20 > ~Maarten Hi Maarten, If they're not set they should be ignored and if writeback is enabled it should not be scaled. However you probably shouldn't be able to set them as 0, I can add a restriction on that. Thanks, Ben