25 Aug, 2018

1 commit

  • Pixel blend modes represent the alpha blending equation
    selection, describing how the pixels from the current
    plane are composited with the background.

    Adds a pixel_blend_mode to drm_plane_state and a
    blend_mode_property to drm_plane, and related support
    functions.

    Defines three blend modes in drm_blend.h.

    Changes since v1:
    - Moves the blending equation into the DOC comment
    - Refines the comments of drm_plane_create_blend_mode_property to not
    enumerate the #defines, but instead the string values
    - Uses fg.* instead of pixel.* and plane_alpha instead of plane.alpha
    Changes since v2:
    - Refines the comments of drm_plane_create_blend_mode_property:
    1) Puts the descriptions (after the ":") on a new line
    2) Adds explaining why @supported_modes need PREMUL as default
    Changes since v3:
    - Refines drm_plane_create_blend_mode_property(). drm_property_add_enum()
    can calculate the index itself just fine, so no point in having the
    caller pass it in.
    - Since the current DRM assumption is that alpha is premultiplied
    as default, define DRM_MODE_BLEND_PREMULTI as 0 will be better.
    - Refines some comments.
    Changes since v4:
    - Adds comments in drm_blend.h.
    - Removes setting default value in drm_plane_create_blend_mode_property()
    as it is already in __drm_atomic_helper_plane_reset().
    - Fixes to use state->pixel_blend_mode instead of using
    plane->state->pixel_blend_mode in reset function.
    - Rebases on drm-misc-next.

    Reviewed-by: Liviu Dudau
    Signed-off-by: Lowry Li
    Signed-off-by: Ayan Kumar Halder
    Reviewed-by: Sean Paul
    Link: https://patchwork.freedesktop.org/patch/245734/

    Lowry Li
     

17 Apr, 2018

1 commit

  • Some drivers duplicate the logic to create a property to store a per-plane
    alpha.

    This is especially useful if we ever want to support extra protocols for
    Wayland like:
    https://lists.freedesktop.org/archives/wayland-devel/2017-August/034741.html

    Let's create a helper in order to move that to the core.

    Acked-by: Maarten Lankhorst
    Acked-by: Sean Paul
    Reviewed-by: Boris Brezillon
    Reviewed-by: Eric Anholt
    Reviewed-by: Laurent Pinchart
    Reviewed-by: Paul Kocialkowski
    Signed-off-by: Maxime Ripard
    Link: https://patchwork.freedesktop.org/patch/msgid/6e1ce0db78fcfc407e94913c64819e65109d034d.1523432341.git-series.maxime.ripard@bootlin.com

    Maxime Ripard
     

22 May, 2017

1 commit

  • Add DRM_MODE_ROTATE_ and DRM_MODE_REFLECT_ defines to the UAPI
    as a convenience.

    Ideally the DRM_ROTATE_ and DRM_REFLECT_ property ids are looked up
    through the atomic API, but realizing that userspace is likely to take
    shortcuts and assume that the enum values are what is sent over the
    wire.

    As a result these defines are provided purely as a convenience to
    userspace applications.

    Changes since v3:
    - Switched away from past tense in comments
    - Add define name change to previously mis-spelled DRM_REFLECT_X comment
    - Improved the comment for the DRM_MODE_REFLECT_ comment

    Changes since v2:
    - Changed define prefix from DRM_MODE_PROP_ to DRM_MODE_
    - Fix compilation errors
    - Changed comment formatting
    - Deduplicated comment lines
    - Clarified DRM_MODE_PROP_REFLECT_ comment

    Changes since v1:
    - Moved defines from drm.h to drm_mode.h
    - Changed define prefix from DRM_ to DRM_MODE_PROP_
    - Updated uses of the defines to the new prefix
    - Removed include from drm_rect.c
    - Stopped using the BIT() macro

    Signed-off-by: Robert Foss
    Reviewed-by: Emil Velikov
    Reviewed-by: Sinclair Yeh
    Acked-by: Liviu Dudau
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/20170519205017.23307-2-robert.foss@collabora.com

    Robert Foss
     

16 May, 2017

1 commit


22 Oct, 2016

3 commits

  • Now that all drivers have been converted over to the per-plane rotation
    property, we can just nuke the global rotation property.

    v2: Rebase due to BIT(),__builtin_ffs() & co.
    Deal with superfluous code shuffling

    Signed-off-by: Ville Syrjälä
    Reviewed-by: Joonas Lahtinen
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/1477077768-4274-4-git-send-email-ville.syrjala@linux.intel.com

    Ville Syrjälä
     
  • Not all planes on the system may support the same rotations/reflections,
    so make it possible to create a separate property for each plane.
    This way userspace gets told exactly which rotations/reflections are
    possible for each plane.

    v2: Add drm_plane_create_rotation_property() helper
    v3: Drop the BIT(), __builtin_ffs(x) - 1,
    Moar WARNs for bad parameters
    Deal with superfluous code shuffling

    Signed-off-by: Ville Syrjälä
    Reviewed-by: Chris Wilson (v1)
    Reviewed-by: Joonas Lahtinen
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/1474907460-10717-4-git-send-email-ville.syrjala@linux.intel.com

    Ville Syrjälä
     
  • We have intel_rotation_90_or_270() in i915 to check if the rotation is
    90 or 270 degrees. Similar checks are elsewhere in drm, so let's move
    the helper into a central place and use it everwhere.

    v2: Drop the BIT()
    Convert all new intel_rotation_90_or_270() calls
    Deal with superfluous code shuffling

    Signed-off-by: Ville Syrjälä
    Reviewed-by: Chris Wilson (v1)
    Reviewed-by: Joonas Lahtinen
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/1474907460-10717-2-git-send-email-ville.syrjala@linux.intel.com

    Ville Syrjälä
     

23 Sep, 2016

1 commit

  • Turns out assuming that only stuff in uabi is uabi is a bit naive, and
    we have a bunch of properties for which the enum values are placed in
    random headers. A proper fix would be to split out uapi include
    headers, but meanwhile sprinkle at least some warning over them.

    Fixes: 532b36712ddf ("drm/doc: Polish for drm_plane.[hc]")
    Cc: Archit Taneja
    Cc: Sean Paul
    Reviewed-by: Jani Nikula
    Signed-off-by: Daniel Vetter
    Signed-off-by: Sean Paul
    Link: http://patchwork.freedesktop.org/patch/msgid/1474612525-9488-1-git-send-email-daniel.vetter@ffwll.ch

    Daniel Vetter
     

22 Sep, 2016

1 commit

  • Imo zpos, rotatation, blending eq (once we have it) and all that
    should be in drm_blend.c, since those are all about how exactly the
    pixels are rendered onto the CRTC's visible area. Also noticed that
    one exported function accidentally ended up in drm_crtc_internal.h,
    move it to the right place too.

    Reviewed-by: Sean Paul
    Signed-off-by: Daniel Vetter
    Signed-off-by: Sean Paul
    Link: http://patchwork.freedesktop.org/patch/msgid/1474448370-32227-3-git-send-email-daniel.vetter@ffwll.ch

    Daniel Vetter