From: Daniel Vetter Subject: Re: [PATCH 3/5] drm: add CRTC properties Date: Tue, 20 Mar 2012 16:48:00 +0100 Message-ID: <20120320154800.GB27231@phenom.ffwll.local> References: <1332254912-4352-1-git-send-email-przanoni@gmail.com> <1332254912-4352-3-git-send-email-przanoni@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com [74.125.82.43]) by gabe.freedesktop.org (Postfix) with ESMTP id 5613D9E7DB for ; Tue, 20 Mar 2012 08:47:20 -0700 (PDT) Received: by wgbdr12 with SMTP id dr12so84329wgb.12 for ; Tue, 20 Mar 2012 08:47:19 -0700 (PDT) Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Alex Deucher Cc: Paulo Zanoni , dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Tue, Mar 20, 2012 at 11:09:42AM -0400, Alex Deucher wrote: > On Tue, Mar 20, 2012 at 10:48 AM, Paulo Zanoni wrote: > > From: Paulo Zanoni > > > > Code based on the connector properties code. > > > > Two new ioctls: > > - DRM_IOCTL_MODE_CRTC_GETPROPERTIES > > - DRM_IOCTL_MODE_CRTC_SETPROPERTY > > > > The i915 driver needs this for the rotation and overscan compensation > > properties. Other drivers might need this too. > > > > v2: replace BUG_ON() for WARN(), fix bugs, add functions to get/set > > the value > > > = > Is there any reason why these can't just be exposed as connector > properties? While the hw features you are exposing are technically > part of the crtc block, so are most of the existing connector > properties (scalers, etc.). Plus, while the scalers/transforms are > part of the crtc hw, they only really make sense on certain > connectors. E.g., underscan isn't particularly useful on non-TMDS > capable connectors. The reasons for this pretty much boil down to that we have quite a few properties that belong to the crtc. Currently we abuse connector properties for that because no one uses cloning, but imo that's not a Great Idea. Other examples than rotation are blending/Z-order when using planes, special options for color conversion (probably only on planes), ... -Daniel > = > Alex > = > = > > Signed-off-by: Paulo Zanoni > > --- > > =A0drivers/gpu/drm/drm_crtc.c | =A0150 ++++++++++++++++++++++++++++++++= ++++++++++++ > > =A0drivers/gpu/drm/drm_drv.c =A0| =A0 =A04 +- > > =A0include/drm/drm.h =A0 =A0 =A0 =A0 =A0| =A0 =A02 + > > =A0include/drm/drm_crtc.h =A0 =A0 | =A0 28 ++++++++- > > =A0include/drm/drm_mode.h =A0 =A0 | =A0 13 ++++ > > =A05 files changed, 195 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c > > index 6260fc3..df00c29 100644 > > --- a/drivers/gpu/drm/drm_crtc.c > > +++ b/drivers/gpu/drm/drm_crtc.c > > @@ -2712,6 +2712,55 @@ int drm_connector_property_get_value(struct drm_= connector *connector, > > =A0} > > =A0EXPORT_SYMBOL(drm_connector_property_get_value); > > > > +void drm_crtc_attach_property(struct drm_crtc *crtc, > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct drm_pr= operty *property, uint64_t init_val) > > +{ > > + =A0 =A0 =A0 int i; > > + > > + =A0 =A0 =A0 for (i =3D 0; i < DRM_CRTC_MAX_PROPERTY; i++) { > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (crtc->property_ids[i] =3D=3D 0) { > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 crtc->property_ids[i] =3D= property->base.id; > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 crtc->property_values[i] = =3D init_val; > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return; > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > > + =A0 =A0 =A0 } > > + > > + =A0 =A0 =A0 WARN(1, "Failed to attach crtc property\n"); > > +} > > +EXPORT_SYMBOL(drm_crtc_attach_property); > > + > > +int drm_crtc_property_set_value(struct drm_crtc *crtc, > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct dr= m_property *property, uint64_t value) > > +{ > > + =A0 =A0 =A0 int i; > > + > > + =A0 =A0 =A0 for (i =3D 0; i < DRM_CRTC_MAX_PROPERTY; i++) { > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (crtc->property_ids[i] =3D=3D property= ->base.id) { > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 crtc->property_values[i] = =3D value; > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return 0; > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > > + =A0 =A0 =A0 } > > + > > + =A0 =A0 =A0 return -EINVAL; > > +} > > +EXPORT_SYMBOL(drm_crtc_property_set_value); > > + > > +int drm_crtc_property_get_value(struct drm_crtc *crtc, > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct dr= m_property *property, uint64_t *val) > > +{ > > + =A0 =A0 =A0 int i; > > + > > + =A0 =A0 =A0 for (i =3D 0; i < DRM_CRTC_MAX_PROPERTY; i++) { > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (crtc->property_ids[i] =3D=3D property= ->base.id) { > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 *val =3D crtc->property_v= alues[i]; > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return 0; > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > > + =A0 =A0 =A0 } > > + > > + =A0 =A0 =A0 return -EINVAL; > > +} > > +EXPORT_SYMBOL(drm_crtc_property_get_value); > > + > > =A0int drm_mode_getproperty_ioctl(struct drm_device *dev, > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 void *data,= struct drm_file *file_priv) > > =A0{ > > @@ -2983,6 +3032,107 @@ out: > > =A0 =A0 =A0 =A0return ret; > > =A0} > > > > +int drm_mode_crtc_get_properties_ioctl(struct drm_device *dev, void *d= ata, > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0struct drm_file *file_priv) > > +{ > > + =A0 =A0 =A0 struct drm_mode_crtc_get_properties *arg =3D data; > > + =A0 =A0 =A0 struct drm_mode_object *obj; > > + =A0 =A0 =A0 struct drm_crtc *crtc; > > + =A0 =A0 =A0 int ret =3D 0; > > + =A0 =A0 =A0 int i; > > + =A0 =A0 =A0 int copied =3D 0; > > + =A0 =A0 =A0 int props_count =3D 0; > > + =A0 =A0 =A0 uint32_t __user *props_ptr; > > + =A0 =A0 =A0 uint64_t __user *prop_values_ptr; > > + > > + =A0 =A0 =A0 if (!drm_core_check_feature(dev, DRIVER_MODESET)) > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -EINVAL; > > + > > + =A0 =A0 =A0 mutex_lock(&dev->mode_config.mutex); > > + > > + =A0 =A0 =A0 obj =3D drm_mode_object_find(dev, arg->crtc_id, DRM_MODE_= OBJECT_CRTC); > > + =A0 =A0 =A0 if (!obj) { > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ret =3D -EINVAL; > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto out; > > + =A0 =A0 =A0 } > > + =A0 =A0 =A0 crtc =3D obj_to_crtc(obj); > > + > > + =A0 =A0 =A0 for (props_count =3D 0; props_count < DRM_CRTC_MAX_PROPER= TY && > > + =A0 =A0 =A0 =A0 =A0 =A0crtc->property_ids[props_count] !=3D 0; props_= count++) > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ; > > + > > + =A0 =A0 =A0 /* This ioctl is called twice, once to determine how much= space is > > + =A0 =A0 =A0 =A0* needed, and the 2nd time to fill it. */ > > + =A0 =A0 =A0 if ((arg->count_props >=3D props_count) && props_count) { > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 copied =3D 0; > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 props_ptr =3D (uint32_t __user *)(unsigne= d long)(arg->props_ptr); > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 prop_values_ptr =3D (uint64_t __user *)(u= nsigned long) > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (arg->prop_va= lues_ptr); > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 for (i =3D 0; i < props_count; i++) { > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (put_user(crtc->proper= ty_ids[i], > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0props_ptr + copied)) { > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ret =3D -= EFAULT; > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto out; > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (put_user(crtc->proper= ty_values[i], > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0prop_values_ptr + copied)) { > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ret =3D -= EFAULT; > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto out; > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 copied++; > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > > + =A0 =A0 =A0 } > > + =A0 =A0 =A0 arg->count_props =3D props_count; > > +out: > > + =A0 =A0 =A0 mutex_unlock(&dev->mode_config.mutex); > > + =A0 =A0 =A0 return ret; > > +} > > + > > +int drm_mode_crtc_set_property_ioctl(struct drm_device *dev, void *dat= a, > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0struct drm_file *file_priv) > > +{ > > + =A0 =A0 =A0 struct drm_mode_crtc_set_property *arg =3D data; > > + =A0 =A0 =A0 struct drm_mode_object *obj; > > + =A0 =A0 =A0 struct drm_property *property; > > + =A0 =A0 =A0 struct drm_crtc *crtc; > > + =A0 =A0 =A0 int ret =3D -EINVAL; > > + =A0 =A0 =A0 int i; > > + > > + =A0 =A0 =A0 if (!drm_core_check_feature(dev, DRIVER_MODESET)) > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -EINVAL; > > + > > + =A0 =A0 =A0 mutex_lock(&dev->mode_config.mutex); > > + > > + =A0 =A0 =A0 obj =3D drm_mode_object_find(dev, arg->crtc_id, DRM_MODE_= OBJECT_CRTC); > > + =A0 =A0 =A0 if (!obj) > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto out; > > + =A0 =A0 =A0 crtc =3D obj_to_crtc(obj); > > + > > + =A0 =A0 =A0 for (i =3D 0; i < DRM_CRTC_MAX_PROPERTY; i++) > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (crtc->property_ids[i] =3D=3D arg->pro= p_id) > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > > + > > + =A0 =A0 =A0 if (i =3D=3D DRM_CRTC_MAX_PROPERTY) > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto out; > > + > > + =A0 =A0 =A0 obj =3D drm_mode_object_find(dev, arg->prop_id, DRM_MODE_= OBJECT_PROPERTY); > > + =A0 =A0 =A0 if (!obj) > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto out; > > + =A0 =A0 =A0 property =3D obj_to_property(obj); > > + > > + =A0 =A0 =A0 if (!drm_property_change_is_valid(property, arg->value)) > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto out; > > + > > + =A0 =A0 =A0 if (crtc->funcs->set_property) > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ret =3D crtc->funcs->set_property(crtc, p= roperty, arg->value); > > + =A0 =A0 =A0 if (!ret) { > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 crtc->property_values[i] =3D arg->value; > > + =A0 =A0 =A0 } > > +out: > > + =A0 =A0 =A0 mutex_unlock(&dev->mode_config.mutex); > > + =A0 =A0 =A0 return ret; > > +} > > + > > =A0int drm_mode_connector_attach_encoder(struct drm_connector *connecto= r, > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0struct drm_encoder *encoder) > > =A0{ > > diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c > > index d166bd0..815e3a9 100644 > > --- a/drivers/gpu/drm/drm_drv.c > > +++ b/drivers/gpu/drm/drm_drv.c > > @@ -159,7 +159,9 @@ static struct drm_ioctl_desc drm_ioctls[] =3D { > > =A0 =A0 =A0 =A0DRM_IOCTL_DEF(DRM_IOCTL_MODE_DIRTYFB, drm_mode_dirtyfb_i= octl, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED), > > =A0 =A0 =A0 =A0DRM_IOCTL_DEF(DRM_IOCTL_MODE_CREATE_DUMB, drm_mode_creat= e_dumb_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED), > > =A0 =A0 =A0 =A0DRM_IOCTL_DEF(DRM_IOCTL_MODE_MAP_DUMB, drm_mode_mmap_dum= b_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED), > > - =A0 =A0 =A0 DRM_IOCTL_DEF(DRM_IOCTL_MODE_DESTROY_DUMB, drm_mode_destr= oy_dumb_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED) > > + =A0 =A0 =A0 DRM_IOCTL_DEF(DRM_IOCTL_MODE_DESTROY_DUMB, drm_mode_destr= oy_dumb_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED), > > + =A0 =A0 =A0 DRM_IOCTL_DEF(DRM_IOCTL_MODE_CRTC_GETPROPERTIES, drm_mode= _crtc_get_properties_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED), > > + =A0 =A0 =A0 DRM_IOCTL_DEF(DRM_IOCTL_MODE_CRTC_SETPROPERTY, drm_mode_c= rtc_set_property_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED) > > =A0}; > > > > =A0#define DRM_CORE_IOCTL_COUNT =A0 ARRAY_SIZE( drm_ioctls ) > > diff --git a/include/drm/drm.h b/include/drm/drm.h > > index 34a7b89..a397a93 100644 > > --- a/include/drm/drm.h > > +++ b/include/drm/drm.h > > @@ -718,6 +718,8 @@ struct drm_get_cap { > > =A0#define DRM_IOCTL_MODE_GETPLANE =A0 =A0 =A0 =A0DRM_IOWR(0xB6, struct= drm_mode_get_plane) > > =A0#define DRM_IOCTL_MODE_SETPLANE =A0 =A0 =A0 =A0DRM_IOWR(0xB7, struct= drm_mode_set_plane) > > =A0#define DRM_IOCTL_MODE_ADDFB2 =A0 =A0 =A0 =A0 =A0DRM_IOWR(0xB8, stru= ct drm_mode_fb_cmd2) > > +#define DRM_IOCTL_MODE_CRTC_GETPROPERTIES =A0 =A0 =A0DRM_IOWR(0xB9, st= ruct drm_mode_crtc_get_properties) > > +#define DRM_IOCTL_MODE_CRTC_SETPROPERTY =A0 =A0 =A0 =A0DRM_IOWR(0xBA, = struct drm_mode_crtc_set_property) > > > > =A0/** > > =A0* Device specific ioctls should only be in their respective headers > > diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h > > index 21681fe..a2d660d 100644 > > --- a/include/drm/drm_crtc.h > > +++ b/include/drm/drm_crtc.h > > @@ -283,6 +283,8 @@ struct drm_encoder; > > =A0struct drm_pending_vblank_event; > > =A0struct drm_plane; > > > > +#define DRM_CRTC_MAX_PROPERTY 16 > > + > > =A0/** > > =A0* drm_crtc_funcs - control CRTCs for a given device > > =A0* @reset: reset CRTC after state has been invalidate (e.g. resume) > > @@ -297,7 +299,8 @@ struct drm_plane; > > =A0* @mode_fixup: fixup proposed mode > > =A0* @mode_set: set the desired mode on the CRTC > > =A0* @gamma_set: specify color ramp for CRTC > > - * @destroy: deinit and free object. > > + * @destroy: deinit and free object > > + * @set_property: called when a property is changed > > =A0* > > =A0* The drm_crtc_funcs structure is the central CRTC management struct= ure > > =A0* in the DRM. =A0Each CRTC controls one or more connectors (note tha= t the name > > @@ -341,6 +344,9 @@ struct drm_crtc_funcs { > > =A0 =A0 =A0 =A0int (*page_flip)(struct drm_crtc *crtc, > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct drm_framebuffer = *fb, > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct drm_pending_vbla= nk_event *event); > > + > > + =A0 =A0 =A0 int (*set_property)(struct drm_crtc *crtc, > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct drm_proper= ty *property, uint64_t val); > > =A0}; > > > > =A0/** > > @@ -360,6 +366,8 @@ struct drm_crtc_funcs { > > =A0* @framedur_ns: precise line timing > > =A0* @pixeldur_ns: precise pixel timing > > =A0* @helper_private: mid-layer private data > > + * @property_ids: property tracking for this CRTC > > + * @property_values: property values > > =A0* > > =A0* Each CRTC may have one or more connectors associated with it. =A0T= his structure > > =A0* allows the CRTC to be controlled. > > @@ -395,6 +403,9 @@ struct drm_crtc { > > > > =A0 =A0 =A0 =A0/* if you are using the helper */ > > =A0 =A0 =A0 =A0void *helper_private; > > + > > + =A0 =A0 =A0 u32 property_ids[DRM_CRTC_MAX_PROPERTY]; > > + =A0 =A0 =A0 uint64_t property_values[DRM_CRTC_MAX_PROPERTY]; > > =A0}; > > > > > > @@ -895,6 +906,12 @@ extern int drm_connector_property_set_value(struct= drm_connector *connector, > > =A0extern int drm_connector_property_get_value(struct drm_connector *co= nnector, > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 struct drm_property *property, > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 uint64_t *value); > > +extern int drm_crtc_property_set_value(struct drm_crtc *crtc, > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0struct drm_property *property, > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0uint64_t value); > > +extern int drm_crtc_property_get_value(struct drm_crtc *crtc, > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0struct drm_property *property, > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0uint64_t *value); > > =A0extern struct drm_display_mode *drm_crtc_mode_create(struct drm_devi= ce *dev); > > =A0extern void drm_framebuffer_set_object(struct drm_device *dev, > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 unsigned long handle); > > @@ -909,6 +926,9 @@ extern bool drm_crtc_in_use(struct drm_crtc *crtc); > > > > =A0extern void drm_connector_attach_property(struct drm_connector *conn= ector, > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0struct drm_property *property, uint64_t init_val); > > +extern void drm_crtc_attach_property(struct drm_crtc *crtc, > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0struct drm_property *property, > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0uint64_t init_val); > > =A0extern struct drm_property *drm_property_create(struct drm_device *d= ev, int flags, > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0const char *name, int num_values); > > =A0extern struct drm_property *drm_property_create_enum(struct drm_devi= ce *dev, int flags, > > @@ -1019,6 +1039,12 @@ extern int drm_mode_mmap_dumb_ioctl(struct drm_d= evice *dev, > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= void *data, struct drm_file *file_priv); > > =A0extern int drm_mode_destroy_dumb_ioctl(struct drm_device *dev, > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0void *data, struct drm_file *file_priv); > > +extern int drm_mode_crtc_get_properties_ioctl(struct drm_device *dev, > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 void *data, > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 struct drm_file *file_priv); > > +extern int drm_mode_crtc_set_property_ioctl(struct drm_device *dev, > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 void *data, > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 struct drm_file *file_priv); > > > > =A0extern void drm_fb_get_bpp_depth(uint32_t format, unsigned int *dept= h, > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 int *bp= p); > > diff --git a/include/drm/drm_mode.h b/include/drm/drm_mode.h > > index 2a2acda..890b930 100644 > > --- a/include/drm/drm_mode.h > > +++ b/include/drm/drm_mode.h > > @@ -252,6 +252,19 @@ struct drm_mode_connector_set_property { > > =A0 =A0 =A0 =A0__u32 connector_id; > > =A0}; > > > > +struct drm_mode_crtc_get_properties { > > + =A0 =A0 =A0 __u64 props_ptr; > > + =A0 =A0 =A0 __u64 prop_values_ptr; > > + =A0 =A0 =A0 __u32 count_props; > > + =A0 =A0 =A0 __u32 crtc_id; > > +}; > > + > > +struct drm_mode_crtc_set_property { > > + =A0 =A0 =A0 __u64 value; > > + =A0 =A0 =A0 __u32 prop_id; > > + =A0 =A0 =A0 __u32 crtc_id; > > +}; > > + > > =A0struct drm_mode_get_blob { > > =A0 =A0 =A0 =A0__u32 blob_id; > > =A0 =A0 =A0 =A0__u32 length; > > -- > > 1.7.9.1 > > > > _______________________________________________ > > dri-devel mailing list > > dri-devel@lists.freedesktop.org > > http://lists.freedesktop.org/mailman/listinfo/dri-devel > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel -- = Daniel Vetter Mail: daniel@ffwll.ch Mobile: +41 (0)79 365 57 48