Lines Matching +full:pre +full:- +full:blending

6  * DRM core plane blending related functions
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.
109 * "rotate-<degrees>":
113 * "reflect-<axis>":
117 * reflect-x::
120 * | | -> | |
123 * reflect-y::
126 * | | -> | |
137 * value can also be immutable, to inform userspace about the hard-coded
144 * It adds a blend mode for alpha blending equation selection, describing
148 * Three alpha blending equations are defined:
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
207 * drm_plane_create_alpha_property - create a new alpha property
223 prop = drm_property_create_range(plane->dev, 0, "alpha", in drm_plane_create_alpha_property()
226 return -ENOMEM; in drm_plane_create_alpha_property()
228 drm_object_attach_property(&plane->base, prop, DRM_BLEND_ALPHA_OPAQUE); in drm_plane_create_alpha_property()
229 plane->alpha_property = prop; in drm_plane_create_alpha_property()
231 if (plane->state) in drm_plane_create_alpha_property()
232 plane->state->alpha = DRM_BLEND_ALPHA_OPAQUE; in drm_plane_create_alpha_property()
239 * drm_plane_create_rotation_property - create a new rotation property
255 * "rotate-0"
257 * "rotate-90"
259 * "rotate-180"
261 * "rotate-270"
263 * "reflect-x"
265 * "reflect-y"
277 { __builtin_ffs(DRM_MODE_ROTATE_0) - 1, "rotate-0" }, in drm_plane_create_rotation_property()
278 { __builtin_ffs(DRM_MODE_ROTATE_90) - 1, "rotate-90" }, in drm_plane_create_rotation_property()
279 { __builtin_ffs(DRM_MODE_ROTATE_180) - 1, "rotate-180" }, in drm_plane_create_rotation_property()
280 { __builtin_ffs(DRM_MODE_ROTATE_270) - 1, "rotate-270" }, in drm_plane_create_rotation_property()
281 { __builtin_ffs(DRM_MODE_REFLECT_X) - 1, "reflect-x" }, in drm_plane_create_rotation_property()
282 { __builtin_ffs(DRM_MODE_REFLECT_Y) - 1, "reflect-y" }, in drm_plane_create_rotation_property()
290 prop = drm_property_create_bitmask(plane->dev, 0, "rotation", in drm_plane_create_rotation_property()
294 return -ENOMEM; in drm_plane_create_rotation_property()
296 drm_object_attach_property(&plane->base, prop, rotation); in drm_plane_create_rotation_property()
298 if (plane->state) in drm_plane_create_rotation_property()
299 plane->state->rotation = rotation; in drm_plane_create_rotation_property()
301 plane->rotation_property = prop; in drm_plane_create_rotation_property()
308 * drm_rotation_simplify() - Try to simplify the rotation
340 * drm_plane_create_zpos_property - create mutable zpos property
348 * support for configurable planes arrangement during blending operation.
353 * should be set to 0 and max to maximal number of planes for given crtc - 1.
375 prop = drm_property_create_range(plane->dev, 0, "zpos", min, max); in drm_plane_create_zpos_property()
377 return -ENOMEM; in drm_plane_create_zpos_property()
379 drm_object_attach_property(&plane->base, prop, zpos); in drm_plane_create_zpos_property()
381 plane->zpos_property = prop; in drm_plane_create_zpos_property()
383 if (plane->state) { in drm_plane_create_zpos_property()
384 plane->state->zpos = zpos; in drm_plane_create_zpos_property()
385 plane->state->normalized_zpos = zpos; in drm_plane_create_zpos_property()
393 * drm_plane_create_zpos_immutable_property - create immuttable zpos property
399 * to get the arrangement of the planes for blending operation and notifies
413 prop = drm_property_create_range(plane->dev, DRM_MODE_PROP_IMMUTABLE, in drm_plane_create_zpos_immutable_property()
416 return -ENOMEM; in drm_plane_create_zpos_immutable_property()
418 drm_object_attach_property(&plane->base, prop, zpos); in drm_plane_create_zpos_immutable_property()
420 plane->zpos_property = prop; in drm_plane_create_zpos_immutable_property()
422 if (plane->state) { in drm_plane_create_zpos_immutable_property()
423 plane->state->zpos = zpos; in drm_plane_create_zpos_immutable_property()
424 plane->state->normalized_zpos = zpos; in drm_plane_create_zpos_immutable_property()
436 if (sa->zpos != sb->zpos) in drm_atomic_state_zpos_cmp()
437 return sa->zpos - sb->zpos; in drm_atomic_state_zpos_cmp()
439 return sa->plane->base.id - sb->plane->base.id; in drm_atomic_state_zpos_cmp()
445 struct drm_atomic_state *state = crtc_state->state; in drm_atomic_helper_crtc_normalize_zpos()
446 struct drm_device *dev = crtc->dev; in drm_atomic_helper_crtc_normalize_zpos()
447 int total_planes = dev->mode_config.num_total_plane; in drm_atomic_helper_crtc_normalize_zpos()
454 crtc->base.id, crtc->name); in drm_atomic_helper_crtc_normalize_zpos()
458 return -ENOMEM; in drm_atomic_helper_crtc_normalize_zpos()
464 drm_for_each_plane_mask(plane, dev, crtc_state->plane_mask) { in drm_atomic_helper_crtc_normalize_zpos()
473 plane->base.id, plane->name, plane_state->zpos); in drm_atomic_helper_crtc_normalize_zpos()
479 plane = states[i]->plane; in drm_atomic_helper_crtc_normalize_zpos()
481 states[i]->normalized_zpos = i; in drm_atomic_helper_crtc_normalize_zpos()
483 plane->base.id, plane->name, i); in drm_atomic_helper_crtc_normalize_zpos()
485 crtc_state->zpos_changed = true; in drm_atomic_helper_crtc_normalize_zpos()
493 * drm_atomic_normalize_zpos - calculate normalized zpos values for all crtcs
508 * Zero for success or -errno
520 crtc = new_plane_state->crtc; in drm_atomic_normalize_zpos()
523 if (old_plane_state->zpos != new_plane_state->zpos) { in drm_atomic_normalize_zpos()
525 new_crtc_state->zpos_changed = true; in drm_atomic_normalize_zpos()
530 if (old_crtc_state->plane_mask != new_crtc_state->plane_mask || in drm_atomic_normalize_zpos()
531 new_crtc_state->zpos_changed) { in drm_atomic_normalize_zpos()
543 * drm_plane_create_blend_mode_property - create a new blend mode property
559 * "Pre-multiplied":
561 * pre-multiplied with the alpha channel values.
565 * pre-multiplied and will do so when blending them to the background color
569 * Zero for success or -errno
574 struct drm_device *dev = plane->dev; in drm_plane_create_blend_mode_property()
578 { DRM_MODE_BLEND_PREMULTI, "Pre-multiplied" }, in drm_plane_create_blend_mode_property()
588 return -EINVAL; in drm_plane_create_blend_mode_property()
594 return -ENOMEM; in drm_plane_create_blend_mode_property()
612 drm_object_attach_property(&plane->base, prop, DRM_MODE_BLEND_PREMULTI); in drm_plane_create_blend_mode_property()
613 plane->blend_mode_property = prop; in drm_plane_create_blend_mode_property()