16 Aug, 2016

1 commit

  • While reviewing docs I spotted that we have a few functions that
    really just don't fit into their containing helper library section.
    Extract them and shovel them all into a new library for random one-off
    aux stuff.

    v2: Remove wrongly added files for real.

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

    Daniel Vetter
     

07 Jun, 2016

1 commit

  • Add drm_crtc_enable_color_mgmt(), remove drm_helper_crtc_enable_color_mgmt()
    and update drm/i915-driver (the only user of the old function).

    The new function is more flexible. It allows driver to enable only the
    features it has without forcing to enable all three color management
    properties: degamma lut, csc matrix (ctm), and gamma lut.

    Suggested-by: Daniel Vetter
    Signed-off-by: Jyri Sarha
    Signed-off-by: Tomi Valkeinen

    Jyri Sarha
     

08 Mar, 2016

1 commit

  • Patch based on a previous series by Shashank Sharma.

    This introduces optional properties to enable color correction at the
    pipe level. It relies on 3 transformations applied to every pixels
    displayed. First a lookup into a degamma table, then a multiplication
    of the rgb components by a 3x3 matrix and finally another lookup into
    a gamma table.

    The following properties can be added to a pipe :
    - DEGAMMA_LUT : blob containing degamma LUT
    - DEGAMMA_LUT_SIZE : number of elements in DEGAMMA_LUT
    - CTM : transformation matrix applied after the degamma LUT
    - GAMMA_LUT : blob containing gamma LUT
    - GAMMA_LUT_SIZE : number of elements in GAMMA_LUT

    DEGAMMA_LUT_SIZE and GAMMA_LUT_SIZE are read only properties, set by
    the driver to tell userspace applications what sizes should be the
    lookup tables in DEGAMMA_LUT and GAMMA_LUT.

    A helper is also provided so legacy gamma correction is redirected
    through these new properties.

    v2: Register LUT size properties as range

    v3: Fix round in drm_color_lut_get_value() helper
    More docs on how degamma/gamma properties are used

    v4: Update contributors

    v5: Rename CTM_MATRIX property to CTM (Doh!)
    Add legacy gamma_set atomic helper
    Describe CTM/LUT acronyms in the kernel doc

    v6: Fix missing blob unref in drm_atomic_helper_crtc_reset

    Signed-off-by: Shashank Sharma
    Signed-off-by: Kumar, Kiran S
    Signed-off-by: Kausal Malladi
    Signed-off-by: Lionel Landwerlin
    Reviewed-by: Matt Roper
    Acked-by: Rob Bradford
    [danvet: CrOS maintainers are also happy with the userspacde side:
    https://codereview.chromium.org/1182063002/ ]
    Reviewed-by: Daniel Stone
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/1456506302-640-4-git-send-email-lionel.g.landwerlin@intel.com

    Lionel Landwerlin
     

11 Dec, 2015

1 commit

  • Now that the mode type bit merge logic is fixed to only merge
    between new probed modes, hopefully we can eliminat the special
    case for qxl and virtio. That is make the merge the mode type
    bits from all matching new probed modes, just like every other
    driver.

    qxl and virtio got excluded from the merging in
    commit 3fbd6439e463 ("drm: copy mode type in drm_mode_connector_list_update()")
    commit abce1ec9b08a ("Revert "drm: copy mode type in drm_mode_connector_list_update()"")
    commit b87577b7c768 ("drm: try harder to avoid regression when merging mode bits")

    Cc: Marc-André Lureau
    Cc: Dave Airlie
    Cc: Daniel Vetter
    Cc: Adam Jackson
    Signed-off-by: Ville Syrjälä
    [danvet: Resolve conflicts with doc updates.]
    Signed-off-by: Daniel Vetter

    Ville Syrjälä
     

08 Dec, 2015

2 commits

  • Currently we have 4 helper libraries (probe, crtc, plane & atomic)
    that all use the same helper vtables. And that's by necessity since we
    don't want to litter the core structs with one ops pointer per helper
    library. Also often the reuse the same hooks (like atomic does, to
    facilite conversion from existing drivers using crtc and plane
    helpers).

    Given all that it doesn't make sense to put the docs for these next to
    specific helpers. Instead extract them into a new header file and
    section in the docbook, and add references to them everywhere.

    Unfortunately kernel-doc complains when an include directive doesn't
    find anything (and it does by dumping crap into the output file). We
    have to remove the now empty includes to avoid that, instead of leaving
    them in for future proofing.

    v2: More OCD in ordering functions.

    v3: Spelling plus collate copyright headers properly.

    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/1449218769-16577-4-git-send-email-daniel.vetter@ffwll.ch
    Reviewed-by: Thierry Reding

    Daniel Vetter
     
  • This is only used for kgdb (and previously panic) handlers in
    the fbdev emulation, so belongs there.

    Note that this means we'll leave behind a forward declaration, but
    once all the helper vtables are consolidated (in the next patch) that
    will make more sense.

    v2: fixup radone/amdgpu.

    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/1449218769-16577-3-git-send-email-daniel.vetter@ffwll.ch
    Reviewed-by: Thierry Reding (v2)

    Daniel Vetter
     

24 Nov, 2015

1 commit


30 Sep, 2015

1 commit

  • drm_kms_helper_poll_enable() was converted to lock the mode_config
    mutex in commit 8c4ccc4ab6f64e859d4ff8d7c02c2ed2e956e07f
    ("drm/probe-helper: Grab mode_config.mutex in poll_init/enable").

    This disregarded the cases where this function is called from a context
    where this mutex is already locked.

    Add a non-locking version as well.

    Changes since v1:
    - use function name suffix '_locked' for the function that
    is to be called from a locked context.

    Signed-off-by: Egbert Eich
    Reviewed-by: Daniel Vetter
    Signed-off-by: Jani Nikula

    Egbert Eich
     

17 Aug, 2015

1 commit


04 Aug, 2015

1 commit

  • With legacy helpers all the routing was already set up when calling
    best_encoder and so could be inspected. But with atomic it's staged,
    hence we need a new atomic compliant callback for drivers which need
    to inspect the requested state and can't just decided the best encoder
    statically.

    This is needed to fix up i915 dp mst where we need to pick the right
    encoder depending upon the requested CRTC for the connector.

    v2: Don't forget to amend the kerneldoc

    Cc: Chris Wilson
    Cc: Linus Torvalds
    Cc: Theodore Ts'o
    Acked-by: Thierry Reding
    Reviewed-by: Ander Conselvan de Oliveira
    Signed-off-by: Daniel Vetter

    Daniel Vetter
     

27 Jul, 2015

2 commits

  • This is required to properly handle failing dpms calls.
    When making a wait in i915 interruptible, I've noticed
    that the dpms sequence could fail with -ERESTARTSYS because
    it was waiting interruptibly for flips. So from now on
    allow drivers to fail in their connector dpms callback.

    Encoder and crtc dpms callbacks are unaffected.

    Changes since v1:
    - Update kerneldoc for the drm helper functions.

    Signed-off-by: Maarten Lankhorst
    [danvet: Resolve conflicts due to different merge order.]
    Signed-off-by: Daniel Vetter

    Maarten Lankhorst
     
  • In intel it's useful to keep track of some state changes with old
    crtc state vs new state, for example to disable initial planes or
    when a modeset's prevented during fastboot.

    Cc: dri-devel@lists.freedesktop.org
    Signed-off-by: Maarten Lankhorst
    Reviewed-by: Ander Conselvan de Oliveira
    [danvet: squash in fixup for exynos provided by Maarten.]
    Signed-off-by: Daniel Vetter

    Maarten Lankhorst
     

13 Apr, 2015

1 commit


24 Feb, 2015

1 commit

  • With runtime PM the hw might still be off while doing the ->mode_set
    callbacks - runtime PM get/put should only happen in the
    enable/disable hooks to properly support DPMS. Which essentially makes
    these callbacks useless for drivers support runtime PM, so make them
    optional. Again motivated by discussions with Laurent.

    Cc: Laurent Pinchart
    Acked-by: Laurent Pinchart
    Signed-off-by: Daniel Vetter

    Daniel Vetter
     

28 Jan, 2015

1 commit

  • * tag 'topic/atomic-core-2015-01-27' of git://anongit.freedesktop.org/drm-intel:
    drm/atomic: Fix potential use of state after free
    drm/atomic-helper: debug output for modesets
    drm/atomic-helpers: Saner encoder/crtc callbacks
    drm/atomic-helpers: Recover full cursor plane behaviour
    drm/atomic-helper: add connector->dpms() implementation
    drm/atomic: Add drm_crtc_state->active
    drm: Add standardized boolean props
    drm/plane-helper: Fix transitional helper kerneldocs
    drm/plane-helper: Skip prepare_fb/cleanup_fb when newfb==oldfb

    Conflicts:
    include/drm/drm_crtc_helper.h

    Dave Airlie
     

27 Jan, 2015

2 commits

  • This callback can be used instead of the legacy ->mode_fixup() and is
    passed the CRTC and connector states. It can thus use these states to
    validate the modeset and cache values in the state to be used during
    the actual modeset.

    Reviewed-by: Daniel Vetter
    Signed-off-by: Thierry Reding

    Thierry Reding
     
  • For historical reasons going all the way back to how the Xrandr code
    was implemented the semantics of the callbacks used to enable/disable
    crtcs and encoders are ... interesting.

    But with atomic helpers all that complexity has been binned, with only
    a well-defined on/off action left. Unfortunately the names stuck.

    Let's fix that by adding enable/disable hooks every, make them the
    preferred variant for atomic and update documentations.

    Later on we add debug warnings when drivers have deprecated hooks. But
    while everything is in-flight with lots of drivers converting to
    atomic that's a bit too much - better wait for things to settle a bit
    first.

    v2: Fix kerneldoc, reported by Wu Fengguang.

    Reviewed-by: Thierry Reding
    Signed-off-by: Daniel Vetter

    Daniel Vetter
     

18 Dec, 2014

2 commits

  • There is already a section that describes the helpers implemented by
    this module. Add the kerneldoc-generated structure descriptions to this
    section.

    While at it, add missing kerneldoc for the structures to avoid warnings
    when generating the documentation.

    Signed-off-by: Thierry Reding
    Reviewed-by: Alex Deucher
    Signed-off-by: Daniel Vetter

    Thierry Reding
     
  • The file refers to a bunch of structure declared in drm_crtc.h, so
    include it to make sure the drm_crtc_helper.h header can be included
    standalone.

    Signed-off-by: Thierry Reding
    Signed-off-by: Daniel Vetter

    Thierry Reding
     

06 Nov, 2014

2 commits

  • These two functions allow drivers to reuse their atomic plane helpers
    functions for the primary plane to implement the interfaces required
    by the crtc helpers for the legacy ->set_config callback.

    This is purely transitional and won't be used once the driver is fully
    converted. But it allows partial conversions to the atomic plane
    helpers which are functional.

    v2:
    - Use ->atomic_duplicate_state if available.
    - Don't forget to run crtc_funcs->atomic_check.

    v3: Shift source coordinates correctly for 16.16 fixed point.

    v4: Don't forget to call ->atomic_destroy_state if available.

    v5: Fixup kerneldoc.

    v6: Reuse the plane_commit function from the transitional plane
    helpers to avoid too much duplication.

    v7:
    - Remove some stale comment.
    - Correctly handle the lack of plane->state object, necessary for
    transitional use.

    v8: Fixup an embarrassing h/vdisplay mixup.

    Reviewed-by: Sean Paul
    Signed-off-by: Daniel Vetter

    Daniel Vetter
     
  • This is the first cut of atomic helper code. As-is it's only useful to
    implement a pure atomic interface for plane updates.

    Later patches will integrate this with the crtc helpers so that full
    atomic updates are possible. We also need a pile of helpers to aid
    drivers in transitioning from the legacy world to the shiny new atomic
    age. Finally we need helpers to implement legacy ioctls on top of the
    atomic interface.

    The design of the overall helpersdriver interaction is fairly
    simple, but has an unfortunate large interface:

    - We have ->atomic_check callbacks for crtcs and planes. The idea is
    that connectors don't need any checking, and if they do they can
    adjust the relevant crtc driver-private state. So no connector hooks
    should be needed. Also the crtc helpers integration will do the
    ->best_encoder checks, so no need for that.

    - Framebuffer pinning needs to be done before we can commit to the hw
    state. This is especially important for async updates where we must
    pin all buffers before returning to userspace, so that really only
    hw failures can happen in the asynchronous worker.

    Hence we add ->prepare_fb and ->cleanup_fb hooks for this resources
    management.

    - The actual atomic plane commit can't fail (except hw woes), so has
    void return type. It has three stages:
    1. Prepare all affected crtcs with crtc->atomic_begin. Drivers can
    use this to unset the GO bit or similar latches to prevent plane
    updates.
    2. Update plane state by looping over all changed planes and calling
    plane->atomic_update. Presuming the hardware is sane and has GO
    bits drivers can simply bash the state into the hardware in this
    function. Other drivers might use this to precompute hw state for
    the final step.
    3. Finally latch the update for the next vblank with
    crtc->atomic_flush. Note that this function doesn't need to wait
    for the vblank to happen even for the synchronous case.

    v2: Clear drm__state->state to NULL when swapping in state.

    v3: Add TODO that we don't short-circuit plane updates for now. Likely
    no one will care.

    v4: Squash in a bit of polish that somehow landed in the wrong (later)
    patche.

    v5: Integrate atomic functions into the drm docbook and fixup the
    kerneldoc.

    v6: Fixup fixup patch squashing fumble.

    v7: Don't touch the legacy plane state plane->fb and plane->crtc. This
    is only used by the legacy ioctl code in the drm core, and that code
    already takes care of updating the pointers in all relevant cases.
    This is in stark contrast to connector->encoder->crtc links on the
    modeset side, which we still need to set since the core doesn't touch
    them.

    Also some more kerneldoc polish.

    v8: Drop outdated comment.

    v9: Handle the state->state pointer correctly: Only clearing the
    ->state pointer when assigning the state to the kms object isn't good
    enough. We also need to re-link the swapped out state into the
    drm_atomic_state structure.

    v10: Shuffle the misplaced docbook template hunk around that Sean spotted.

    Cc: Sean Paul
    Reviewed-by: Sean Paul
    Signed-off-by: Daniel Vetter

    Daniel Vetter
     

16 May, 2014

1 commit

  • Update pull request with drm core patches. Mostly some polish for the
    primary plane stuff and a pile of patches all over from Thierry. Has
    survived a few days in drm-intel-nightly without causing ill.

    I've frobbed my scripts a bit to also tag my topic branches so that you
    have something stable to pull - I've accidentally pushed a bunch more
    patches onto this branch before you've taken the old pull request.

    * tag 'topic/core-stuff-2014-05-05' of git://anongit.freedesktop.org/drm-intel:
    drm: Make drm_crtc_helper_disable() return void
    drm: Fix indentation of closing brace
    drm/dp: Fix typo in comment
    drm: Fixup flip-work kerneldoc
    drm/fb: Fix typos
    drm/edid: Cleanup kerneldoc
    drm/edid: Drop revision argument for drm_mode_std()
    drm: Try to acquire modeset lock on panic or sysrq
    drm: remove unused argument from drm_open_helper
    drm: Handle ->disable_plane failures correctly
    drm: Simplify fb refcounting rules around ->update_plane
    drm/crtc-helper: gc usless connector loop in disable_unused_functions
    drm/plane_helper: don't disable plane in destroy function
    drm/plane-helper: Fix primary plane scaling check
    drm: make mode_valid callback optional
    drm/edid: Fill PAR in AVI infoframe based on CEA mode list

    Dave Airlie
     

01 May, 2014

1 commit

  • For QXL hw we really want the bits to be replaced as we change
    the preferred mode on the fly, and the same goes for virgl when
    I get to it, however the original fix for this seems to have caused
    a wierd regression on Intel G33 that in a stunning display of failure
    at opposition to his normal self, Daniel failed to diagnose.

    So we are left doing this, ugly ugly ugly ugly, Daniel you fixed
    that G33 yet?, ugly, ugly.

    Tested-by: Marc-André Lureau
    Signed-off-by: Dave Airlie

    Dave Airlie
     

22 Apr, 2014

1 commit

  • Many drm connectors do not need mode validation.
    The patch makes this callback optional and removes dumb implementations.

    v2: Rebase:
    - imx move to a shared (but still dummy) ->mode_valid implementation.
    - probe helpers have been extracted to drm_probe_helper.c

    Signed-off-by: Andrzej Hajda (v1)
    Signed-off-by: Daniel Vetter

    Andrzej Hajda
     

18 Apr, 2014

1 commit

  • This is leftover stuff from my previous doc round which I kinda wanted
    to do but didn't yet due to rebase hell.

    The modeset helpers and the probing helpers a independent and e.g.
    i915 uses the probing stuff but has its own modeset infrastructure. It
    hence makes to split this up. While at it add a DOC: comment for the
    probing libraray.

    It would be rather neat to pull some of the DocBook documenting these
    two helpers into in-line DOC: comments. But unfortunately kerneldoc
    doesn't support markdown or something similar to make nice-looking
    documentation, so the current state is better.

    Signed-off-by: Daniel Vetter
    Signed-off-by: Dave Airlie

    Daniel Vetter
     

13 Mar, 2014

2 commits


21 Jan, 2014

1 commit


23 Oct, 2013

1 commit


20 Nov, 2012

1 commit


12 Nov, 2012

1 commit

  • Userspace seems to like this, see

    commit cb0953d734348e8862d6d7edc666cfb3bf6d8fae
    Author: Adam Jackson
    Date: Fri Jul 16 14:46:29 2010 -0400

    drm/i915: Initialize LVDS and eDP outputs before anything else

    This makes them sort to the front in X, which makes them likely to be
    the primary outputs if you haven't specified a preference in your DE,
    which is likely to be what you want.

    Signed-off-by: Adam Jackson
    Signed-off-by: Eric Anholt

    Sorting the connector list after the fact is much easier than trying
    to be clever with the init sequence.

    Acked-by: Dave Airlie
    Reviewed-by: Adam Jackson
    Acked-by: Chris Wilson
    Signed-off-by: Daniel Vetter

    Daniel Vetter
     

20 Jul, 2012

1 commit


22 May, 2012

1 commit


20 Apr, 2012

1 commit


21 Dec, 2011

1 commit


30 Nov, 2011

1 commit


16 Nov, 2011

1 commit

  • To properly support the various plane formats supported by different
    hardware, the kernel must know the pixel format of a framebuffer object.
    So add a new ioctl taking a format argument corresponding to a fourcc
    name from the new drm_fourcc.h header file. Implement the fb creation
    hooks in terms of the new mode_fb_cmd2 using helpers where the old
    bpp/depth values are needed.

    v2: create DRM specific fourcc header file for sharing with libdrm etc
    v3: fix rebase failure and use DRM fourcc codes in intel_display.c and
    update commit message
    v4: make fb_cmd2 handle field into an array for multi-object formats
    pull in Ville's fix for the memcpy in drm_plane_init
    apply Ville's cleanup to zero out fb_cmd2 arg in drm_mode_addfb
    v5: add 'flags' field for interlaced support (from Ville)

    Signed-off-by: Ville Syrjälä
    Acked-by: Alan Cox
    Reviewed-by: Rob Clark
    Signed-off-by: Jesse Barnes
    Signed-off-by: Dave Airlie

    Jesse Barnes
     

19 Oct, 2010

1 commit

  • The enter argument as implemented by commit 413d45d3627 (drm, kdb, kms:
    Add an enter argument to mode_set_base_atomic() API) should be more
    descriptive as to what it does vs just passing 1 and 0 around.

    There is no runtime behavior change as a result of this patch.

    Reported-by: Jesse Barnes
    Signed-off-by: Jason Wessel
    CC: David Airlie
    CC: dri-devel@lists.freedesktop.org
    Signed-off-by: Dave Airlie

    Jason Wessel
     

06 Oct, 2010

1 commit

  • Some devices such as the radeon chips receive information from user
    space which needs to be saved when executing an atomic mode set
    operation, else the user space would have to be queried again for the
    information.

    This patch extends the mode_set_base_atomic() call to pass an argument
    to indicate if this is an entry or an exit from an atomic kernel mode
    set change. Individual drm drivers can properly save and restore
    state accordingly.

    Signed-off-by: Jason Wessel
    CC: Jesse Barnes
    CC: David Airlie
    CC: dri-devel@lists.freedesktop.org
    Signed-off-by: Dave Airlie

    Jason Wessel
     

06 Aug, 2010

1 commit

  • * 'drm-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (204 commits)
    agp: intel-agp: do not use PCI resources before pci_enable_device()
    agp: efficeon-agp: do not use PCI resources before pci_enable_device()
    drm: kill BKL from common code
    drm/kms: Simplify setup of the initial I2C encoder config.
    drm,io-mapping: Specify slot to use for atomic mappings
    drm/radeon/kms: only expose underscan on avivo chips
    drm/radeon: add new pci ids
    drm: Cleanup after failing to create master->unique and dev->name
    drm/radeon: tone down overchatty acpi debug messages.
    drm/radeon/kms: enable underscan option for digital connectors
    drm/radeon/kms: fix calculation of h/v scaling factors
    drm/radeon/kms/igp: sideport is AMD only
    drm/radeon/kms: handle the case of no active displays properly in the bandwidth code
    drm: move ttm global code to core drm
    drm/i915: Clear the Ironlake dithering flags when the pipe doesn't want it.
    drm/radeon/kms: make sure HPD is set to NONE on analog-only connectors
    drm/radeon/kms: make sure rio_mem is valid before unmapping it
    drm/agp/i915: trim stolen space to 32M
    drm/i915: Unset cursor if out-of-bounds upon mode change (v4)
    drm/i915: Unreference object not handle on creation
    ...

    Linus Torvalds