diff options
| author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-08-29 04:27:57 -0400 |
|---|---|---|
| committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-08-29 09:37:49 -0400 |
| commit | c8458c7efd01f5748e9ca74720e366d3fcc5fa97 (patch) | |
| tree | 4821ebd95236e7267b06a13ddefb6f0de795b215 /Documentation/gpu | |
| parent | 77953bd136d2a70bca2dc93b3ccda07a2b37076f (diff) | |
drm/doc: Polish docs for drm_property&drm_property_blob
- remove kerneldoc for drm-internal functions
- drm_property_replace_global_blob isn't actually atomic, and doesn't
need to be. Update docs&comments to match
- document all the types and try to link things a bit better
- nits all over
v2: Appease checkpatch in the moved code (Archit)
Reviewed-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20160829082757.17913-9-daniel.vetter@ffwll.ch
Diffstat (limited to 'Documentation/gpu')
| -rw-r--r-- | Documentation/gpu/drm-kms.rst | 88 |
1 files changed, 3 insertions, 85 deletions
diff --git a/Documentation/gpu/drm-kms.rst b/Documentation/gpu/drm-kms.rst index e07a2667ab61..f9a991bb87d4 100644 --- a/Documentation/gpu/drm-kms.rst +++ b/Documentation/gpu/drm-kms.rst | |||
| @@ -304,94 +304,12 @@ KMS Locking | |||
| 304 | KMS Properties | 304 | KMS Properties |
| 305 | ============== | 305 | ============== |
| 306 | 306 | ||
| 307 | Drivers may need to expose additional parameters to applications than | ||
| 308 | those described in the previous sections. KMS supports attaching | ||
| 309 | properties to CRTCs, connectors and planes and offers a userspace API to | ||
| 310 | list, get and set the property values. | ||
| 311 | |||
| 312 | Properties are identified by a name that uniquely defines the property | ||
| 313 | purpose, and store an associated value. For all property types except | ||
| 314 | blob properties the value is a 64-bit unsigned integer. | ||
| 315 | |||
| 316 | KMS differentiates between properties and property instances. Drivers | ||
| 317 | first create properties and then create and associate individual | ||
| 318 | instances of those properties to objects. A property can be instantiated | ||
| 319 | multiple times and associated with different objects. Values are stored | ||
| 320 | in property instances, and all other property information are stored in | ||
| 321 | the property and shared between all instances of the property. | ||
| 322 | |||
| 323 | Every property is created with a type that influences how the KMS core | ||
| 324 | handles the property. Supported property types are | ||
| 325 | |||
| 326 | DRM_MODE_PROP_RANGE | ||
| 327 | Range properties report their minimum and maximum admissible values. | ||
| 328 | The KMS core verifies that values set by application fit in that | ||
| 329 | range. | ||
| 330 | |||
| 331 | DRM_MODE_PROP_ENUM | ||
| 332 | Enumerated properties take a numerical value that ranges from 0 to | ||
| 333 | the number of enumerated values defined by the property minus one, | ||
| 334 | and associate a free-formed string name to each value. Applications | ||
| 335 | can retrieve the list of defined value-name pairs and use the | ||
| 336 | numerical value to get and set property instance values. | ||
| 337 | |||
| 338 | DRM_MODE_PROP_BITMASK | ||
| 339 | Bitmask properties are enumeration properties that additionally | ||
| 340 | restrict all enumerated values to the 0..63 range. Bitmask property | ||
| 341 | instance values combine one or more of the enumerated bits defined | ||
| 342 | by the property. | ||
| 343 | |||
| 344 | DRM_MODE_PROP_BLOB | ||
| 345 | Blob properties store a binary blob without any format restriction. | ||
| 346 | The binary blobs are created as KMS standalone objects, and blob | ||
| 347 | property instance values store the ID of their associated blob | ||
| 348 | object. | ||
| 349 | |||
| 350 | Blob properties are only used for the connector EDID property and | ||
| 351 | cannot be created by drivers. | ||
| 352 | |||
| 353 | To create a property drivers call one of the following functions | ||
| 354 | depending on the property type. All property creation functions take | ||
| 355 | property flags and name, as well as type-specific arguments. | ||
| 356 | |||
| 357 | - struct drm_property \*drm_property_create_range(struct | ||
| 358 | drm_device \*dev, int flags, const char \*name, uint64_t min, | ||
| 359 | uint64_t max); | ||
| 360 | Create a range property with the given minimum and maximum values. | ||
| 361 | |||
| 362 | - struct drm_property \*drm_property_create_enum(struct drm_device | ||
| 363 | \*dev, int flags, const char \*name, const struct | ||
| 364 | drm_prop_enum_list \*props, int num_values); | ||
| 365 | Create an enumerated property. The ``props`` argument points to an | ||
| 366 | array of ``num_values`` value-name pairs. | ||
| 367 | |||
| 368 | - struct drm_property \*drm_property_create_bitmask(struct | ||
| 369 | drm_device \*dev, int flags, const char \*name, const struct | ||
| 370 | drm_prop_enum_list \*props, int num_values); | ||
| 371 | Create a bitmask property. The ``props`` argument points to an array | ||
| 372 | of ``num_values`` value-name pairs. | ||
| 373 | |||
| 374 | Properties can additionally be created as immutable, in which case they | ||
| 375 | will be read-only for applications but can be modified by the driver. To | ||
| 376 | create an immutable property drivers must set the | ||
| 377 | DRM_MODE_PROP_IMMUTABLE flag at property creation time. | ||
| 378 | |||
| 379 | When no array of value-name pairs is readily available at property | ||
| 380 | creation time for enumerated or range properties, drivers can create the | ||
| 381 | property using the :c:func:`drm_property_create()` function and | ||
| 382 | manually add enumeration value-name pairs by calling the | ||
| 383 | :c:func:`drm_property_add_enum()` function. Care must be taken to | ||
| 384 | properly specify the property type through the ``flags`` argument. | ||
| 385 | |||
| 386 | After creating properties drivers can attach property instances to CRTC, | ||
| 387 | connector and plane objects by calling the | ||
| 388 | :c:func:`drm_object_attach_property()`. The function takes a | ||
| 389 | pointer to the target object, a pointer to the previously created | ||
| 390 | property and an initial instance value. | ||
| 391 | |||
| 392 | Property Types and Blob Property Support | 307 | Property Types and Blob Property Support |
| 393 | ---------------------------------------- | 308 | ---------------------------------------- |
| 394 | 309 | ||
| 310 | .. kernel-doc:: drivers/gpu/drm/drm_property.c | ||
| 311 | :doc: overview | ||
| 312 | |||
| 395 | .. kernel-doc:: include/drm/drm_property.h | 313 | .. kernel-doc:: include/drm/drm_property.h |
| 396 | :internal: | 314 | :internal: |
| 397 | 315 | ||
