aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/gpu
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2016-08-29 04:27:57 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2016-08-29 09:37:49 -0400
commitc8458c7efd01f5748e9ca74720e366d3fcc5fa97 (patch)
tree4821ebd95236e7267b06a13ddefb6f0de795b215 /Documentation/gpu
parent77953bd136d2a70bca2dc93b3ccda07a2b37076f (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.rst88
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
304KMS Properties 304KMS Properties
305============== 305==============
306 306
307Drivers may need to expose additional parameters to applications than
308those described in the previous sections. KMS supports attaching
309properties to CRTCs, connectors and planes and offers a userspace API to
310list, get and set the property values.
311
312Properties are identified by a name that uniquely defines the property
313purpose, and store an associated value. For all property types except
314blob properties the value is a 64-bit unsigned integer.
315
316KMS differentiates between properties and property instances. Drivers
317first create properties and then create and associate individual
318instances of those properties to objects. A property can be instantiated
319multiple times and associated with different objects. Values are stored
320in property instances, and all other property information are stored in
321the property and shared between all instances of the property.
322
323Every property is created with a type that influences how the KMS core
324handles the property. Supported property types are
325
326DRM_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
331DRM_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
338DRM_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
344DRM_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
353To create a property drivers call one of the following functions
354depending on the property type. All property creation functions take
355property 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
374Properties can additionally be created as immutable, in which case they
375will be read-only for applications but can be modified by the driver. To
376create an immutable property drivers must set the
377DRM_MODE_PROP_IMMUTABLE flag at property creation time.
378
379When no array of value-name pairs is readily available at property
380creation time for enumerated or range properties, drivers can create the
381property using the :c:func:`drm_property_create()` function and
382manually add enumeration value-name pairs by calling the
383:c:func:`drm_property_add_enum()` function. Care must be taken to
384properly specify the property type through the ``flags`` argument.
385
386After creating properties drivers can attach property instances to CRTC,
387connector and plane objects by calling the
388:c:func:`drm_object_attach_property()`. The function takes a
389pointer to the target object, a pointer to the previously created
390property and an initial instance value.
391
392Property Types and Blob Property Support 307Property 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