30 Nov, 2019

1 commit

  • This thing can get called several thousand times per LUT
    so seems like we want to inline it to:
    - avoid the function call overhead
    - allow constant folding

    A quick synthetic test (w/o any hardware interaction) with
    a ridiculously large LUT size shows about 50% reduction in
    runtime on my HSW and BSW boxes. Slightly less with more
    reasonable LUT size but still easily measurable in tens
    of microseconds.

    v2: Include drm_color_mgmt.h in the .rst (Daniel)

    Cc: Daniel Vetter
    Signed-off-by: Ville Syrjälä
    Reviewed-by: Nicholas Kazlauskas
    Link: https://patchwork.freedesktop.org/patch/msgid/20191108135654.12907-1-ville.syrjala@linux.intel.com

    Ville Syrjälä
     

14 Nov, 2019

1 commit

  • Add a new helper function drm_color_ctm_s31_32_to_qm_n() for driver to
    convert S31.32 sign-magnitude to Qm.n 2's complement that supported by
    hardware.

    V4: Address Mihai, Daniel and Ilia's review comments.
    V5: Includes the sign bit in the value of m (Qm.n).
    V6: Allows m = 0 according to Mihail's comments.
    V7: Address Mihail's comments.
    V8: Use type 'u32' to replace 'uint32_t'
    V9: Rebase.

    Signed-off-by: james qian wang (Arm Technology China)
    Reviewed-by: Mihail Atanassov
    Reviewed-by: Daniel Vetter
    Link: https://patchwork.freedesktop.org/patch/msgid/20191112110927.20931-2-james.qian.wang@arm.com

    james qian wang (Arm Technology China)
     

30 Jan, 2019

1 commit

  • drm_color_lut_check() doens't modify the passed in blob so
    let's make it const.

    Also s/uint32_t/u32/ while at it.

    v2: Reduce line wraps (Sam)

    Cc: Matt Roper
    Signed-off-by: Ville Syrjälä
    Link: https://patchwork.freedesktop.org/patch/msgid/20190129170609.5718-1-ville.syrjala@linux.intel.com
    Reviewed-by: Sam Ravnborg
    Acked-by: Daniel Vetter

    Ville Syrjälä
     

24 Jan, 2019

1 commit

  • Some hardware may place additional restrictions on the gamma/degamma
    curves described by our LUT properties. E.g., that a gamma curve never
    decreases or that the red/green/blue channels of a LUT's entries must be
    equal. Let's add a helper function that drivers can use to test that a
    userspace-provided LUT is valid and doesn't violate hardware
    requirements.

    v2:
    - Combine into a single helper that just takes a bitmask of the tests
    to apply. (Brian Starkey)
    - Add additional check (always performed) that LUT property blob size
    is always a multiple of the LUT entry size. (stolen from ARM driver)

    v3:
    - Drop the LUT size check again since
    drm_atomic_replace_property_blob_from_id() already covers this for
    us. (Alexandru Gheorghe)

    v4:
    - Use an enum to describe possible test values rather than #define's;
    this is cleaner to provide kerneldoc for. (Daniel Vetter)
    - s/DRM_COLOR_LUT_INCREASING/DRM_COLOR_LUT_NON_DECREASING/. (Ville)

    Cc: Uma Shankar
    Cc: Swati Sharma
    Cc: Brian Starkey
    Cc: Daniel Vetter
    Cc: Ville Syrjälä
    Signed-off-by: Matt Roper
    Reviewed-by: Brian Starkey
    Reviewed-by: Alexandru Gheorghe
    Reviewed-by: Uma Shankar
    Acked-by: Daniel Vetter
    Link: https://patchwork.freedesktop.org/patch/msgid/20181217224415.12848-1-matthew.d.roper@intel.com

    Matt Roper
     

09 Sep, 2018

1 commit

  • Just a bit of missing includes and pre declarations.

    v2: Compiles now, with drm/drm_util.h extracted.

    v3: Rebase

    v3: Fix up commit message (Sam Ravnborg)

    Reviewed-by: Sean Paul
    Signed-off-by: Daniel Vetter
    Link: https://patchwork.freedesktop.org/patch/msgid/20180905135711.28370-3-daniel.vetter@ffwll.ch

    Daniel Vetter
     

16 Mar, 2018

1 commit

  • Provide a small helper to convert the blob length in bytes
    to the number of LUT entries.

    v2: Add kerneldoc (Daniel)

    Cc: Daniel Vetter
    Signed-off-by: Ville Syrjälä
    Reviewed-by: Daniel Vetter
    Link: https://patchwork.freedesktop.org/patch/msgid/20180315152338.7248-1-ville.syrjala@linux.intel.com

    Ville Syrjälä
     

02 Mar, 2018

1 commit

  • Add a standard optional properties to support different non RGB color
    encodings in DRM planes. COLOR_ENCODING select the supported non RGB
    color encoding, for instance ITU-R BT.709 YCbCr. COLOR_RANGE selects
    the value ranges within the selected color encoding. The properties
    are stored to drm_plane object to allow different set of supported
    encoding for different planes on the device.

    v2: Add/fix kerneldocs, verify bitmasks (danvet)

    Cc: Harry Wentland
    Cc: Daniel Vetter
    Cc: Daniel Stone
    Cc: Russell King - ARM Linux
    Cc: Ilia Mirkin
    Cc: Hans Verkuil
    Cc: Uma Shankar
    Cc: Shashank Sharma
    Reviewed-by: Ville Syrjälä
    Signed-off-by: Jyri Sarha
    [vsyrjala v2: Add/fix kerneldocs, verify bitmasks]
    Signed-off-by: Ville Syrjälä
    Link: https://patchwork.freedesktop.org/patch/msgid/20180219202823.10508-1-ville.syrjala@linux.intel.com
    Acked-by: Harry Wentland
    Reviewed-by: Daniel Vetter

    Jyri Sarha
     

02 May, 2017

1 commit


31 Jan, 2017

1 commit

  • The function is not that big, but it's also not used for anything
    performance critical. Make it a normal function.

    As a side effect, this apparently makes sparse smarter about what it's
    doing, and gets rid of the warning:

    ./include/drm/drm_color_mgmt.h:53:28: warning: shift too big (4294967295) for type unsigned long
    ./include/drm/drm_color_mgmt.h:53:28: warning: cast truncates bits from constant value (8000000000000000 becomes 0)

    v2: rebased

    Cc: Lionel Landwerlin
    Reviewed-by: Daniel Vetter
    Reviewed-by: Lionel Landwerlin
    Signed-off-by: Jani Nikula
    Link: http://patchwork.freedesktop.org/patch/msgid/1485531291-24821-1-git-send-email-jani.nikula@intel.com

    Jani Nikula
     

25 Jan, 2017

1 commit

  • I just learned that &struct_name.member_name works and looks pretty
    even. It doesn't (yet) link to the member directly though, which would
    be really good for big structures or vfunc tables (where the
    per-member kerneldoc tends to be long).

    Also some minor drive-by polish where it makes sense, I read a lot
    of docs ...

    v2: Review from Eric.

    Cc: Jani Nikula
    Cc: Chris Wilson
    Reviewed-by: Eric Engestrom
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/20170125062657.19270-4-daniel.vetter@ffwll.ch

    Daniel Vetter
     

22 Sep, 2016

2 commits

  • Again move it from the unmaintainable csv into DOC free-form overview
    sections.

    v2: Types Lionel&Sean spotted.

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

    Daniel Vetter
     
  • For both the new degamm/lut/gamma atomic combo, and the old legacy
    gamma tables.

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

    Daniel Vetter