Lines Matching +full:int +full:- +full:property

43  * sub-pixel accuracy, which is scaled up to a pixel-aligned destination
96 * plane-wide opacity, from transparent (0) to opaque (0xffff). It can be
99 * pre-multiplied by the global alpha associated to the plane.
104 * Without this property the rectangle is only scaled, but not rotated or
109 * "rotate-<degrees>":
113 * "reflect-<axis>":
117 * reflect-x::
120 * | | -> | |
123 * reflect-y::
126 * | | -> | |
132 * planes. Without this property the primary plane is always below the cursor
137 * value can also be immutable, to inform userspace about the hard-coded
139 * any plane has a zpos property (either mutable or immutable), then all
140 * planes shall have a zpos property.
154 * (1 - plane_alpha) * bg.rgb
156 * "Pre-multiplied":
158 * have been already pre-multiplied with the alpha
162 * (1 - (plane_alpha * fg.alpha)) * bg.rgb
166 * been pre-multiplied and will do so when blending them to the
170 * (1 - (plane_alpha * fg.alpha)) * bg.rgb
179 * 1.0. In these cases, this property has no effect, as all three
184 * Plane alpha value set by the plane "alpha" property. If the
185 * plane does not expose the "alpha" property, then this is
189 * Blob property which contains the set of buffer format and modifier
191 * struct. Without this property the plane doesn't support buffers with
192 * modifiers. Userspace cannot change this property.
194 * Note that all the property extensions described here apply either to the
200 * drm_plane_create_alpha_property - create a new alpha property
203 * This function creates a generic, mutable, alpha property and enables support
206 * The alpha property will be allowed to be within the bounds of 0
212 int drm_plane_create_alpha_property(struct drm_plane *plane) in drm_plane_create_alpha_property()
216 prop = drm_property_create_range(plane->dev, 0, "alpha", in drm_plane_create_alpha_property()
219 return -ENOMEM; in drm_plane_create_alpha_property()
221 drm_object_attach_property(&plane->base, prop, DRM_BLEND_ALPHA_OPAQUE); in drm_plane_create_alpha_property()
222 plane->alpha_property = prop; in drm_plane_create_alpha_property()
224 if (plane->state) in drm_plane_create_alpha_property()
225 plane->state->alpha = DRM_BLEND_ALPHA_OPAQUE; in drm_plane_create_alpha_property()
232 * drm_plane_create_rotation_property - create a new rotation property
234 * @rotation: initial value of the rotation property
237 * This creates a new property with the selected support for transformations.
240 * and the y axis the rotation property is somewhat redundant. Drivers can use
241 * drm_rotation_simplify() to normalize values of this property.
243 * The property exposed to userspace is a bitmask property (see
248 * "rotate-0"
250 * "rotate-90"
252 * "rotate-180"
254 * "rotate-270"
256 * "reflect-x"
258 * "reflect-y"
265 int drm_plane_create_rotation_property(struct drm_plane *plane, in drm_plane_create_rotation_property()
266 unsigned int rotation, in drm_plane_create_rotation_property()
267 unsigned int supported_rotations) in drm_plane_create_rotation_property()
270 { __builtin_ffs(DRM_MODE_ROTATE_0) - 1, "rotate-0" }, in drm_plane_create_rotation_property()
271 { __builtin_ffs(DRM_MODE_ROTATE_90) - 1, "rotate-90" }, in drm_plane_create_rotation_property()
272 { __builtin_ffs(DRM_MODE_ROTATE_180) - 1, "rotate-180" }, in drm_plane_create_rotation_property()
273 { __builtin_ffs(DRM_MODE_ROTATE_270) - 1, "rotate-270" }, in drm_plane_create_rotation_property()
274 { __builtin_ffs(DRM_MODE_REFLECT_X) - 1, "reflect-x" }, in drm_plane_create_rotation_property()
275 { __builtin_ffs(DRM_MODE_REFLECT_Y) - 1, "reflect-y" }, in drm_plane_create_rotation_property()
283 prop = drm_property_create_bitmask(plane->dev, 0, "rotation", in drm_plane_create_rotation_property()
287 return -ENOMEM; in drm_plane_create_rotation_property()
289 drm_object_attach_property(&plane->base, prop, rotation); in drm_plane_create_rotation_property()
291 if (plane->state) in drm_plane_create_rotation_property()
292 plane->state->rotation = rotation; in drm_plane_create_rotation_property()
294 plane->rotation_property = prop; in drm_plane_create_rotation_property()
301 * drm_rotation_simplify() - Try to simplify the rotation
318 unsigned int drm_rotation_simplify(unsigned int rotation, in drm_rotation_simplify()
319 unsigned int supported_rotations) in drm_rotation_simplify()
333 * drm_plane_create_zpos_property - create mutable zpos property
335 * @zpos: initial value of zpos property
336 * @min: minimal possible value of zpos property
337 * @max: maximal possible value of zpos property
339 * This function initializes generic mutable zpos property and enables support
340 * for it in drm core. Drivers can then attach this property to planes to enable
342 * Drivers that attach a mutable zpos property to any plane should call the
346 * should be set to 0 and max to maximal number of planes for given crtc - 1.
357 * The property exposed to userspace is called "zpos".
362 int drm_plane_create_zpos_property(struct drm_plane *plane, in drm_plane_create_zpos_property()
363 unsigned int zpos, in drm_plane_create_zpos_property()
364 unsigned int min, unsigned int max) in drm_plane_create_zpos_property()
368 prop = drm_property_create_range(plane->dev, 0, "zpos", min, max); in drm_plane_create_zpos_property()
370 return -ENOMEM; in drm_plane_create_zpos_property()
372 drm_object_attach_property(&plane->base, prop, zpos); in drm_plane_create_zpos_property()
374 plane->zpos_property = prop; in drm_plane_create_zpos_property()
376 if (plane->state) { in drm_plane_create_zpos_property()
377 plane->state->zpos = zpos; in drm_plane_create_zpos_property()
378 plane->state->normalized_zpos = zpos; in drm_plane_create_zpos_property()
386 * drm_plane_create_zpos_immutable_property - create immuttable zpos property
388 * @zpos: value of zpos property
390 * This function initializes generic immutable zpos property and enables
391 * support for it in drm core. Using this property driver lets userspace
396 * The property exposed to userspace is called "zpos".
401 int drm_plane_create_zpos_immutable_property(struct drm_plane *plane, in drm_plane_create_zpos_immutable_property()
402 unsigned int zpos) in drm_plane_create_zpos_immutable_property()
406 prop = drm_property_create_range(plane->dev, DRM_MODE_PROP_IMMUTABLE, in drm_plane_create_zpos_immutable_property()
409 return -ENOMEM; in drm_plane_create_zpos_immutable_property()
411 drm_object_attach_property(&plane->base, prop, zpos); in drm_plane_create_zpos_immutable_property()
413 plane->zpos_property = prop; in drm_plane_create_zpos_immutable_property()
415 if (plane->state) { in drm_plane_create_zpos_immutable_property()
416 plane->state->zpos = zpos; in drm_plane_create_zpos_immutable_property()
417 plane->state->normalized_zpos = zpos; in drm_plane_create_zpos_immutable_property()
424 static int drm_atomic_state_zpos_cmp(const void *a, const void *b) in drm_atomic_state_zpos_cmp()
429 if (sa->zpos != sb->zpos) in drm_atomic_state_zpos_cmp()
430 return sa->zpos - sb->zpos; in drm_atomic_state_zpos_cmp()
432 return sa->plane->base.id - sb->plane->base.id; in drm_atomic_state_zpos_cmp()
435 static int drm_atomic_helper_crtc_normalize_zpos(struct drm_crtc *crtc, in drm_atomic_helper_crtc_normalize_zpos()
438 struct drm_atomic_state *state = crtc_state->state; in drm_atomic_helper_crtc_normalize_zpos()
439 struct drm_device *dev = crtc->dev; in drm_atomic_helper_crtc_normalize_zpos()
440 int total_planes = dev->mode_config.num_total_plane; in drm_atomic_helper_crtc_normalize_zpos()
443 int i, n = 0; in drm_atomic_helper_crtc_normalize_zpos()
444 int ret = 0; in drm_atomic_helper_crtc_normalize_zpos()
447 crtc->base.id, crtc->name); in drm_atomic_helper_crtc_normalize_zpos()
451 return -ENOMEM; in drm_atomic_helper_crtc_normalize_zpos()
457 drm_for_each_plane_mask(plane, dev, crtc_state->plane_mask) { in drm_atomic_helper_crtc_normalize_zpos()
466 plane->base.id, plane->name, in drm_atomic_helper_crtc_normalize_zpos()
467 plane_state->zpos); in drm_atomic_helper_crtc_normalize_zpos()
473 plane = states[i]->plane; in drm_atomic_helper_crtc_normalize_zpos()
475 states[i]->normalized_zpos = i; in drm_atomic_helper_crtc_normalize_zpos()
477 plane->base.id, plane->name, i); in drm_atomic_helper_crtc_normalize_zpos()
479 crtc_state->zpos_changed = true; in drm_atomic_helper_crtc_normalize_zpos()
487 * drm_atomic_normalize_zpos - calculate normalized zpos values for all crtcs
502 * Zero for success or -errno
504 int drm_atomic_normalize_zpos(struct drm_device *dev, in drm_atomic_normalize_zpos()
511 int i, ret = 0; in drm_atomic_normalize_zpos()
514 crtc = new_plane_state->crtc; in drm_atomic_normalize_zpos()
517 if (old_plane_state->zpos != new_plane_state->zpos) { in drm_atomic_normalize_zpos()
519 new_crtc_state->zpos_changed = true; in drm_atomic_normalize_zpos()
524 if (old_crtc_state->plane_mask != new_crtc_state->plane_mask || in drm_atomic_normalize_zpos()
525 new_crtc_state->zpos_changed) { in drm_atomic_normalize_zpos()
537 * drm_plane_create_blend_mode_property - create a new blend mode property
542 * the property defaults to anything else.
544 * This creates a new property describing the blend mode.
546 * The property exposed to userspace is an enumeration property (see
553 * "Pre-multiplied":
555 * pre-multiplied with the alpha channel values.
559 * pre-multiplied and will do so when blending them to the background color
563 * Zero for success or -errno
565 int drm_plane_create_blend_mode_property(struct drm_plane *plane, in drm_plane_create_blend_mode_property()
566 unsigned int supported_modes) in drm_plane_create_blend_mode_property()
568 struct drm_device *dev = plane->dev; in drm_plane_create_blend_mode_property()
572 { DRM_MODE_BLEND_PREMULTI, "Pre-multiplied" }, in drm_plane_create_blend_mode_property()
575 unsigned int valid_mode_mask = BIT(DRM_MODE_BLEND_PIXEL_NONE) | in drm_plane_create_blend_mode_property()
578 int i; in drm_plane_create_blend_mode_property()
582 return -EINVAL; in drm_plane_create_blend_mode_property()
588 return -ENOMEM; in drm_plane_create_blend_mode_property()
591 int ret; in drm_plane_create_blend_mode_property()
606 drm_object_attach_property(&plane->base, prop, DRM_MODE_BLEND_PREMULTI); in drm_plane_create_blend_mode_property()
607 plane->blend_mode_property = prop; in drm_plane_create_blend_mode_property()