[PATCH 2/2] drm/doc: Document the KMS property API

2013-06-22 Thread Laurent Pinchart
Hi Hans,

Thanks for the review.

On Saturday 22 June 2013 15:32:43 Hans Verkuil wrote:
> Hi Laurent,
> 
> Is this a hint to me that V4L2 should have a property API as well? :-)

Honestly, not at all, but I'm of course willing to discuss the subject ;-)

> Anyway, I found some typos below:

Thank you. I'll fix them in v2.

-- 
Regards,

Laurent Pinchart



[PATCH 2/2] drm/doc: Document the KMS property API

2013-06-22 Thread Hans Verkuil
Hi Laurent,

Is this a hint to me that V4L2 should have a property API as well? :-)

Anyway, I found some typos below:

On Sat June 22 2013 15:00:27 Laurent Pinchart wrote:
> Signed-off-by: Laurent Pinchart 
> ---
>  Documentation/DocBook/drm.tmpl | 143 
> +
>  1 file changed, 143 insertions(+)
> 
> diff --git a/Documentation/DocBook/drm.tmpl b/Documentation/DocBook/drm.tmpl
> index cea420d..9d4bb06 100644
> --- a/Documentation/DocBook/drm.tmpl
> +++ b/Documentation/DocBook/drm.tmpl
> @@ -1236,6 +1236,15 @@ int max_width, max_height;
>Miscellaneous
>
>  
> +  void (*set_property)(struct drm_crtc *crtc,
> + struct drm_property *property, uint64_t 
> value);
> +  
> +Set the value of the given CRTC property to
> +value. See  linkend="drm-kms-properties"/>
> +for more information about properties.
> +  
> +
> +
>void (*gamma_set)(struct drm_crtc *crtc, u16 *r, u16 
> *g, u16 *b,
>  uint32_t start, uint32_t size);
>
> @@ -1385,6 +1394,15 @@ int max_width, max_height;
>.
>  
>
> +  
> +void (*set_property)(struct drm_plane *plane,
> + struct drm_property *property, uint64_t 
> value);
> +
> +  Set the value of the given plane property to
> +  value. See  linkend="drm-kms-properties"/>
> +  for more information about properties.
> +
> +  
>  
>
>  
> @@ -1594,6 +1612,15 @@ int max_width, max_height;
>Miscellaneous
>
>  
> +  void (*set_property)(struct drm_connector *connector,
> + struct drm_property *property, uint64_t 
> value);
> +  
> +Set the value of the given connector property to
> +value. See  linkend="drm-kms-properties"/>
> +for more information about properties.
> +  
> +
> +
>void (*destroy)(struct drm_connector 
> *connector);
>
>  Destroy the connector when not needed anymore. See
> @@ -2187,6 +2214,122 @@ void intel_crt_init(struct drm_device *dev)
>  
>
>  
> +  
> +
> +  
> +KMS Properties
> +
> +  Drivers may need to expose additional parameters to applications than
> +  those described in the previous sections. KMS supports attaching
> +  properties to CRTCs, connectors and planes and offers a userspace API 
> to
> +  list, get and set the property values.
> +
> +
> +  Properties are identified by a name that uniquely defines the property
> +  purpose, and store an associated value. For all property types except 
> blob
> +  properties the value is a 64-bit unsigned integer.
> +
> +
> +  KMS differentiates between properties and property instances. Drivers
> +  first create properties and then create and associate individual 
> instances
> +  of those properties to objects. A property can be instantiated multiple
> +  times and associated with different objects. Values are stored in 
> property
> +  instances, and all other property information are stored in the propery
> +  and shared between all instances of the property.
> +
> +
> +  Every property is created with a type that influences how the KMS core
> +  handles the property. Supported property types are
> +  
> +
> +  DRM_MODE_PROP_RANGE
> +  Ranges properties report their minimum and maximum

s/Ranges/Range/

> +admissible values. The KMS core verifies that values set by
> +application fit in that range.
> +
> +
> +  DRM_MODE_PROP_ENUM
> +  Enumerated properties take a numerical value that
> +ranges from 0 to the number of enumered values defined by the

s/enumered/enumerated/

> +property minus one, and associate a free-formed string name to 
> each
> +value. Application can retrieve the list of define value-name 
> pairs

s/Application/Applications/
s/define/defined/

> +and use the numerical value to get and set property instance 
> values.
> +
> +
> +
> +  DRM_MODE_PROP_BITMASK
> +  Bitmask properties are enumeration properties that
> +additionally restrict all enumerated values to the 0..63 range.
> +Bitmask property instance values combine one or more of the
> +enumerated bits defined by the property.
> +
> +
> +  DRM_MODE_PROP_BLOB
> +  Blob properties store a binary blob without any 
> format
> +

[PATCH 2/2] drm/doc: Document the KMS property API

2013-06-22 Thread Laurent Pinchart
Signed-off-by: Laurent Pinchart 
---
 Documentation/DocBook/drm.tmpl | 143 +
 1 file changed, 143 insertions(+)

diff --git a/Documentation/DocBook/drm.tmpl b/Documentation/DocBook/drm.tmpl
index cea420d..9d4bb06 100644
--- a/Documentation/DocBook/drm.tmpl
+++ b/Documentation/DocBook/drm.tmpl
@@ -1236,6 +1236,15 @@ int max_width, max_height;
   Miscellaneous
   
 
+  void (*set_property)(struct drm_crtc *crtc,
+ struct drm_property *property, uint64_t value);
+  
+Set the value of the given CRTC property to
+value. See 
+for more information about properties.
+  
+
+
   void (*gamma_set)(struct drm_crtc *crtc, u16 *r, u16 
*g, u16 *b,
 uint32_t start, uint32_t size);
   
@@ -1385,6 +1394,15 @@ int max_width, max_height;
   .
 
   
+  
+void (*set_property)(struct drm_plane *plane,
+ struct drm_property *property, uint64_t value);
+
+  Set the value of the given plane property to
+  value. See 
+  for more information about properties.
+
+  
 
   
 
@@ -1594,6 +1612,15 @@ int max_width, max_height;
   Miscellaneous
   
 
+  void (*set_property)(struct drm_connector *connector,
+ struct drm_property *property, uint64_t value);
+  
+Set the value of the given connector property to
+value. See 
+for more information about properties.
+  
+
+
   void (*destroy)(struct drm_connector 
*connector);
   
 Destroy the connector when not needed anymore. See
@@ -2187,6 +2214,122 @@ void intel_crt_init(struct drm_device *dev)
 
   

+  
+
+  
+KMS Properties
+
+  Drivers may need to expose additional parameters to applications than
+  those described in the previous sections. KMS supports attaching
+  properties to CRTCs, connectors and planes and offers a userspace API to
+  list, get and set the property values.
+
+
+  Properties are identified by a name that uniquely defines the property
+  purpose, and store an associated value. For all property types except 
blob
+  properties the value is a 64-bit unsigned integer.
+
+
+  KMS differentiates between properties and property instances. Drivers
+  first create properties and then create and associate individual 
instances
+  of those properties to objects. A property can be instantiated multiple
+  times and associated with different objects. Values are stored in 
property
+  instances, and all other property information are stored in the propery
+  and shared between all instances of the property.
+
+
+  Every property is created with a type that influences how the KMS core
+  handles the property. Supported property types are
+  
+
+  DRM_MODE_PROP_RANGE
+  Ranges properties report their minimum and maximum
+admissible values. The KMS core verifies that values set by
+application fit in that range.
+
+
+  DRM_MODE_PROP_ENUM
+  Enumerated properties take a numerical value that
+ranges from 0 to the number of enumered values defined by the
+property minus one, and associate a free-formed string name to each
+value. Application can retrieve the list of define value-name pairs
+and use the numerical value to get and set property instance 
values.
+
+
+
+  DRM_MODE_PROP_BITMASK
+  Bitmask properties are enumeration properties that
+additionally restrict all enumerated values to the 0..63 range.
+Bitmask property instance values combine one or more of the
+enumerated bits defined by the property.
+
+
+  DRM_MODE_PROP_BLOB
+  Blob properties store a binary blob without any 
format
+restriction. The binary blobs are created as KMS standalone 
objects,
+and blob property instance values store the ID of their associated
+blob object.
+   Blocb properties are only used for the connector EDID property
+   and cannot be created by drivers.
+
+  
+
+
+  To create a property drivers call one of the following functions 
depending
+  on the property type. All property creation functions take property flags
+  and name, as well as type-specific arguments.
+  
+
+  struct drm_property *drm_property_create_range(struct 

[PATCH 2/2] drm/doc: Document the KMS property API

2013-06-22 Thread Laurent Pinchart
Signed-off-by: Laurent Pinchart laurent.pinchart+rene...@ideasonboard.com
---
 Documentation/DocBook/drm.tmpl | 143 +
 1 file changed, 143 insertions(+)

diff --git a/Documentation/DocBook/drm.tmpl b/Documentation/DocBook/drm.tmpl
index cea420d..9d4bb06 100644
--- a/Documentation/DocBook/drm.tmpl
+++ b/Documentation/DocBook/drm.tmpl
@@ -1236,6 +1236,15 @@ int max_width, max_height;/synopsis
   titleMiscellaneous/title
   itemizedlist
 listitem
+  synopsisvoid (*set_property)(struct drm_crtc *crtc,
+ struct drm_property *property, uint64_t value);/synopsis
+  para
+Set the value of the given CRTC property to
+parametervalue/parameter. See xref 
linkend=drm-kms-properties/
+for more information about properties.
+  /para
+/listitem
+listitem
   synopsisvoid (*gamma_set)(struct drm_crtc *crtc, u16 *r, u16 
*g, u16 *b,
 uint32_t start, uint32_t size);/synopsis
   para
@@ -1385,6 +1394,15 @@ int max_width, max_height;/synopsis
   xref linkend=drm-kms-init/.
 /para
   /listitem
+  listitem
+synopsisvoid (*set_property)(struct drm_plane *plane,
+ struct drm_property *property, uint64_t value);/synopsis
+para
+  Set the value of the given plane property to
+  parametervalue/parameter. See xref 
linkend=drm-kms-properties/
+  for more information about properties.
+/para
+  /listitem
 /itemizedlist
   /sect3
 /sect2
@@ -1594,6 +1612,15 @@ int max_width, max_height;/synopsis
   titleMiscellaneous/title
   itemizedlist
 listitem
+  synopsisvoid (*set_property)(struct drm_connector *connector,
+ struct drm_property *property, uint64_t value);/synopsis
+  para
+Set the value of the given connector property to
+parametervalue/parameter. See xref 
linkend=drm-kms-properties/
+for more information about properties.
+  /para
+/listitem
+listitem
   synopsisvoid (*destroy)(struct drm_connector 
*connector);/synopsis
   para
 Destroy the connector when not needed anymore. See
@@ -2187,6 +2214,122 @@ void intel_crt_init(struct drm_device *dev)
 /sect2
   /sect1
 
+  !-- Internals: kms properties --
+
+  sect1 id=drm-kms-properties
+titleKMS Properties/title
+para
+  Drivers may need to expose additional parameters to applications than
+  those described in the previous sections. KMS supports attaching
+  properties to CRTCs, connectors and planes and offers a userspace API to
+  list, get and set the property values.
+/para
+para
+  Properties are identified by a name that uniquely defines the property
+  purpose, and store an associated value. For all property types except 
blob
+  properties the value is a 64-bit unsigned integer.
+/para
+para
+  KMS differentiates between properties and property instances. Drivers
+  first create properties and then create and associate individual 
instances
+  of those properties to objects. A property can be instantiated multiple
+  times and associated with different objects. Values are stored in 
property
+  instances, and all other property information are stored in the propery
+  and shared between all instances of the property.
+/para
+para
+  Every property is created with a type that influences how the KMS core
+  handles the property. Supported property types are
+  variablelist
+varlistentry
+  termDRM_MODE_PROP_RANGE/term
+  listitemparaRanges properties report their minimum and maximum
+admissible values. The KMS core verifies that values set by
+application fit in that range./para/listitem
+/varlistentry
+varlistentry
+  termDRM_MODE_PROP_ENUM/term
+  listitemparaEnumerated properties take a numerical value that
+ranges from 0 to the number of enumered values defined by the
+property minus one, and associate a free-formed string name to each
+value. Application can retrieve the list of define value-name pairs
+and use the numerical value to get and set property instance 
values.
+/para/listitem
+/varlistentry
+varlistentry
+  termDRM_MODE_PROP_BITMASK/term
+  listitemparaBitmask properties are enumeration properties that
+additionally restrict all enumerated values to the 0..63 range.
+Bitmask property instance values combine one or more of the
+enumerated bits defined by the 

Re: [PATCH 2/2] drm/doc: Document the KMS property API

2013-06-22 Thread Hans Verkuil
Hi Laurent,

Is this a hint to me that V4L2 should have a property API as well? :-)

Anyway, I found some typos below:

On Sat June 22 2013 15:00:27 Laurent Pinchart wrote:
 Signed-off-by: Laurent Pinchart laurent.pinchart+rene...@ideasonboard.com
 ---
  Documentation/DocBook/drm.tmpl | 143 
 +
  1 file changed, 143 insertions(+)
 
 diff --git a/Documentation/DocBook/drm.tmpl b/Documentation/DocBook/drm.tmpl
 index cea420d..9d4bb06 100644
 --- a/Documentation/DocBook/drm.tmpl
 +++ b/Documentation/DocBook/drm.tmpl
 @@ -1236,6 +1236,15 @@ int max_width, max_height;/synopsis
titleMiscellaneous/title
itemizedlist
  listitem
 +  synopsisvoid (*set_property)(struct drm_crtc *crtc,
 + struct drm_property *property, uint64_t 
 value);/synopsis
 +  para
 +Set the value of the given CRTC property to
 +parametervalue/parameter. See xref 
 linkend=drm-kms-properties/
 +for more information about properties.
 +  /para
 +/listitem
 +listitem
synopsisvoid (*gamma_set)(struct drm_crtc *crtc, u16 *r, u16 
 *g, u16 *b,
  uint32_t start, uint32_t size);/synopsis
para
 @@ -1385,6 +1394,15 @@ int max_width, max_height;/synopsis
xref linkend=drm-kms-init/.
  /para
/listitem
 +  listitem
 +synopsisvoid (*set_property)(struct drm_plane *plane,
 + struct drm_property *property, uint64_t 
 value);/synopsis
 +para
 +  Set the value of the given plane property to
 +  parametervalue/parameter. See xref 
 linkend=drm-kms-properties/
 +  for more information about properties.
 +/para
 +  /listitem
  /itemizedlist
/sect3
  /sect2
 @@ -1594,6 +1612,15 @@ int max_width, max_height;/synopsis
titleMiscellaneous/title
itemizedlist
  listitem
 +  synopsisvoid (*set_property)(struct drm_connector *connector,
 + struct drm_property *property, uint64_t 
 value);/synopsis
 +  para
 +Set the value of the given connector property to
 +parametervalue/parameter. See xref 
 linkend=drm-kms-properties/
 +for more information about properties.
 +  /para
 +/listitem
 +listitem
synopsisvoid (*destroy)(struct drm_connector 
 *connector);/synopsis
para
  Destroy the connector when not needed anymore. See
 @@ -2187,6 +2214,122 @@ void intel_crt_init(struct drm_device *dev)
  /sect2
/sect1
  
 +  !-- Internals: kms properties --
 +
 +  sect1 id=drm-kms-properties
 +titleKMS Properties/title
 +para
 +  Drivers may need to expose additional parameters to applications than
 +  those described in the previous sections. KMS supports attaching
 +  properties to CRTCs, connectors and planes and offers a userspace API 
 to
 +  list, get and set the property values.
 +/para
 +para
 +  Properties are identified by a name that uniquely defines the property
 +  purpose, and store an associated value. For all property types except 
 blob
 +  properties the value is a 64-bit unsigned integer.
 +/para
 +para
 +  KMS differentiates between properties and property instances. Drivers
 +  first create properties and then create and associate individual 
 instances
 +  of those properties to objects. A property can be instantiated multiple
 +  times and associated with different objects. Values are stored in 
 property
 +  instances, and all other property information are stored in the propery
 +  and shared between all instances of the property.
 +/para
 +para
 +  Every property is created with a type that influences how the KMS core
 +  handles the property. Supported property types are
 +  variablelist
 +varlistentry
 +  termDRM_MODE_PROP_RANGE/term
 +  listitemparaRanges properties report their minimum and maximum

s/Ranges/Range/

 +admissible values. The KMS core verifies that values set by
 +application fit in that range./para/listitem
 +/varlistentry
 +varlistentry
 +  termDRM_MODE_PROP_ENUM/term
 +  listitemparaEnumerated properties take a numerical value that
 +ranges from 0 to the number of enumered values defined by the

s/enumered/enumerated/

 +property minus one, and associate a free-formed string name to 
 each
 +value. Application can retrieve the list of define value-name 
 pairs

s/Application/Applications/
s/define/defined/

 +and use the numerical value to get and set property instance 
 values.
 +  

Re: [PATCH 2/2] drm/doc: Document the KMS property API

2013-06-22 Thread Laurent Pinchart
Hi Hans,

Thanks for the review.

On Saturday 22 June 2013 15:32:43 Hans Verkuil wrote:
 Hi Laurent,
 
 Is this a hint to me that V4L2 should have a property API as well? :-)

Honestly, not at all, but I'm of course willing to discuss the subject ;-)

 Anyway, I found some typos below:

Thank you. I'll fix them in v2.

-- 
Regards,

Laurent Pinchart

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel