12 Feb, 2019

1 commit


11 Aug, 2017

2 commits

  • While at it, also ocd and give them a consistent drm_dev_ prefix, like
    the other device instance functionality. Plus move the functions into
    the right places.

    Reviewed-by: Alex Deucher
    Signed-off-by: Daniel Vetter
    Link: https://patchwork.freedesktop.org/patch/msgid/20170802115604.12734-3-daniel.vetter@ffwll.ch

    Daniel Vetter
     
  • I need this to untangle an include loop in the next patch.

    Reviewed-by: Alex Deucher
    Signed-off-by: Daniel Vetter
    Link: https://patchwork.freedesktop.org/patch/msgid/20170802115604.12734-2-daniel.vetter@ffwll.ch

    Daniel Vetter
     

20 Jun, 2017

1 commit

  • Unify and review everything, plus make sure it's all correct markup.
    Drop the kernel-doc for internal functions. Also rework the overview
    section, it's become rather outdated.

    Unfortuantely the kernel-doc in drm_driver isn't rendered yet, but
    that will change as soon as drm_driver is kernel-docified properly.

    Also document properly that drm_vblank_cleanup is optional, the core
    calls this already.

    v2: Make it clear that cleanup happens in drm_dev_fini for drivers
    with their own ->release callback (Thierry).

    Acked-by: Thierry Reding
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/20170524145212.27837-11-daniel.vetter@ffwll.ch

    Daniel Vetter
     

01 Jun, 2017

2 commits

  • Pull a (much shorter) overview into drm_irq.c, and instead put the
    callback documentation into in-line comments in drm_drv.h.

    v2: Move the include stanzas back to the split-up patch (Stefan).

    Cc: Stefan Agner
    Reviewed-by: Stefan Agner
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/20170531092253.12833-1-daniel.vetter@ffwll.ch

    Daniel Vetter
     
  • drm_irq.c contains both the irq helper library (optional) and the
    vblank support (optional, but part of the modeset uapi, and doesn't
    require the use of the irq helpers at all.

    Split this up for more clarity of the scope of the individual bits.

    v2: Move misplaced hunks to this patch (Stefan).

    Cc: Stefan Agner
    Reviewed-by: Stefan Agner
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/20170531092146.12528-1-daniel.vetter@ffwll.ch

    Daniel Vetter
     

31 May, 2017

1 commit

  • And document them lightly. Unfortunately kernel-doc isn't the most
    awesome for documenting #defines that don't look like functions, it
    makes functions out of them :-/

    Signed-off-by: Daniel Vetter
    Reviewed-by: Neil Armstrong
    Link: http://patchwork.freedesktop.org/patch/msgid/20170524145212.27837-2-daniel.vetter@ffwll.ch
    Link: http://patchwork.freedesktop.org/patch/msgid/20170524145212.27837-3-daniel.vetter@ffwll.ch

    Daniel Vetter
     

30 May, 2017

1 commit

  • This is a leftover from the drm_bus days, where we've had a
    bus-specific device type for every bus type in drm_device. Except for
    pci (which we can't remove because dri1 drivers) this is all gone. And
    the virt driver also doesn't really need it, dev_to_virtio works
    perfectly fine.

    Cc: David Airlie
    Cc: Gerd Hoffmann
    Cc: virtualization@lists.linux-foundation.org
    Reviewed-by: Gerd Hoffmann
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/20170524145212.27837-3-daniel.vetter@ffwll.ch

    Daniel Vetter
     

18 May, 2017

1 commit

  • Now that drm_[cm]alloc* helpers are simple one line wrappers around
    kvmalloc_array and drm_free_large is just kvfree alias we can drop
    them and replace by their native forms.

    This shouldn't introduce any functional change.

    Changes since v1
    - fix typo in drivers/gpu//drm/etnaviv/etnaviv_gem.c - noticed by 0day
    build robot

    Suggested-by: Daniel Vetter
    Signed-off-by: Michal Hocko drm: drop drm_[cm]alloc* helpers
    [danvet: Fixup vgem which grew another user very recently.]
    Signed-off-by: Daniel Vetter
    Acked-by: Christian König
    Link: http://patchwork.freedesktop.org/patch/msgid/20170517122312.GK18247@dhcp22.suse.cz

    Michal Hocko
     

10 May, 2017

2 commits

  • If we restrict this helper to only kms drivers (which is the case) we
    can look up the correct mode easily ourselves. But it's a bit tricky:

    - All legacy drivers look at crtc->hwmode. But that is updated already
    at the beginning of the modeset helper, which means when we disable
    a pipe. Hence the final timestamps might be a bit off. But since
    this is an existing bug I'm not going to change it, but just try to
    be bug-for-bug compatible with the current code. This only applies
    to radeon&amdgpu.

    - i915 tries to get it perfect by updating crtc->hwmode when the pipe
    is off (i.e. vblank->enabled = false).

    - All other atomic drivers look at crtc->state->adjusted_mode. Those
    that look at state->requested_mode simply don't adjust their mode,
    so it's the same. That has two problems: Accessing crtc->state from
    interrupt handling code is unsafe, and it's updated before we shut
    down the pipe. For nonblocking modesets it's even worse.

    For atomic drivers try to implement what i915 does. To do that we add
    a new hwmode field to the vblank structure, and update it from
    drm_calc_timestamping_constants(). For atomic drivers that's called
    from the right spot by the helper library already, so all fine. But
    for safety let's enforce that.

    For legacy driver this function is only called at the end (oh the
    fun), which is broken, so again let's not bother and just stay
    bug-for-bug compatible.

    The benefit is that we can use drm_calc_vbltimestamp_from_scanoutpos
    directly to implement ->get_vblank_timestamp in every driver, deleting
    a lot of code.

    v2: Completely new approach, trying to mimick the i915 solution.

    v3: Fixup kerneldoc.

    v4: Drop the WARN_ON to check that the vblank is off, atomic helpers
    currently unconditionally call this. Recomputing the same stuff should
    be harmless.

    v5: Fix typos and move misplaced hunks to the right patches (Neil).

    v6: Undo hunk movement (kbuild).

    Cc: Mario Kleiner
    Cc: Eric Anholt
    Cc: Rob Clark
    Cc: linux-arm-msm@vger.kernel.org
    Cc: freedreno@lists.freedesktop.org
    Cc: Alex Deucher
    Cc: Christian König
    Cc: Ben Skeggs
    Reviewed-by: Neil Armstrong
    Acked-by: Ville Syrjälä
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/20170509140329.24114-4-daniel.vetter@ffwll.ch

    Daniel Vetter
     
  • There's really no reason for anything more:
    - Calling this while the crtc vblank stuff isn't set up is a driver
    bug. Those places alrready DRM_ERROR.
    - Calling this when the crtc is off is either a driver bug (calling
    drm_crtc_handle_vblank at the wrong time) or a core bug (for
    anything else). Again, we DRM_ERROR.
    - EINVAL is checked at higher levels already, and if we'd use struct
    drm_crtc * instead of (dev, pipe) it would be real obvious that
    those are again core bugs.

    The only valid failure mode is crap hardware that couldn't sample a
    useful timestamp, to ask the core to just grab a not-so-accurate
    timestamp. Bool is perfectly fine for that.

    v2: Also fix up the one caller, I lost that in the shuffling (Jani).

    v3: Fixup commit message (Neil).

    Cc: Jani Nikula
    Cc: Mario Kleiner
    Cc: Eric Anholt
    Cc: Rob Clark
    Cc: linux-arm-msm@vger.kernel.org
    Cc: freedreno@lists.freedesktop.org
    Cc: Alex Deucher
    Cc: Christian König
    Cc: Ben Skeggs
    Reviewed-by: Neil Armstrong
    Acked-by: Ville Syrjälä
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/20170509140329.24114-1-daniel.vetter@ffwll.ch

    Daniel Vetter
     

05 Apr, 2017

1 commit

  • - remove docs for internal func, doesn't add value
    - add short overview snippet instead explaining that drivers don't
    have to bother themselves with reg/unreg concerns
    - drop the ttm comment about drmP.h, drmP.h is disappearing ...

    Reviewed-by: Neil Armstrong
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/20170404095304.17599-2-daniel.vetter@ffwll.ch

    Daniel Vetter
     

26 Mar, 2017

2 commits


24 Mar, 2017

1 commit

  • Doc polish will follow in the next patch.

    v2: Put the include guard #endif at the end (Ville).

    Cc: Ville Syrjälä
    Reviewed-by: Ville Syrjälä
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/20170322205336.24549-1-daniel.vetter@ffwll.ch

    Daniel Vetter
     

11 Mar, 2017

1 commit


09 Mar, 2017

6 commits

  • I'm torn on whether drm_minor really should be here or somewhere else.
    Maybe with more clarity after untangling drmP.h more this is easier to
    decide, for now I've put a FIXME comment right next to it. Right now
    we need struct drm_minor for the inline drm_file type helpers, and so
    it does kinda make sense to have them here.

    Next patch will kerneldoc-ify the entire pile.

    Reviewed-by: Gustavo Padovan
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/20170308141257.12119-10-daniel.vetter@ffwll.ch

    Daniel Vetter
     
  • This was originally added by David Herrmann for range checks, but
    entirely unused. It confused me, so let's remove it.

    Cc: David Herrmann
    Reviewed-by: David Herrmann
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/20170308141257.12119-9-daniel.vetter@ffwll.ch

    Daniel Vetter
     
  • It's not just file ops, but drm_file stuff in general. This is prep
    work to extracting a drm_file.h header in the next patch.

    Reviewed-by: Gustavo Padovan
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/20170308141257.12119-8-daniel.vetter@ffwll.ch

    Daniel Vetter
     
  • Just another step in finally making drmP.h obsolete.

    Reviewed-by: Gustavo Padovan
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/20170308141257.12119-5-daniel.vetter@ffwll.ch

    Daniel Vetter
     
  • And remove the semi-kernel-doc stuff, to make sure no one uses this.

    Reviewed-by: Gustavo Padovan
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/20170308141257.12119-4-daniel.vetter@ffwll.ch

    Daniel Vetter
     
  • Plus a little bit more documentation.

    v2: Untangle the missing forward decls to make drm_prime|gem.h
    free-standing.

    Reviewed-by: Gustavo Padovan
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/20170308141257.12119-3-daniel.vetter@ffwll.ch

    Daniel Vetter
     

23 Feb, 2017

1 commit


17 Feb, 2017

2 commits

  • The field contains a pointer to the parent platform device of the DRM
    device. As struct drm_device also contains a dev pointer to the struct
    device embedded in the platform_device structure, the platformdev field
    is redundant. Remove it and use the dev pointer directly.

    Signed-off-by: Laurent Pinchart
    Reviewed-by: Daniel Vetter
    Acked-by: Jyri Sarha
    Acked-by: Vincent Abriou # For sti
    Acked-by: Russell King # For armada
    Acked-by: Rob Clark # For msm
    Acked-by: Xinwei Kong

    Laurent Pinchart
     
  • Now that the last driver has been converted, the drm_platform midlayer
    is unused. Remove it.

    Signed-off-by: Laurent Pinchart
    Reviewed-by: Daniel Vetter

    Laurent Pinchart
     

30 Jan, 2017

1 commit

  • I was under the misconception that the sysfs dev stuff can be fully
    set up, and then registered all in one step with device_add. That's
    true for properties and property groups, but not for parents and child
    devices. Those must be fully registered before you can register a
    child.

    Add a bit of tracking to make sure that asynchronous mst connector
    hotplugging gets this right. For consistency we rely upon the implicit
    barriers of the connector->mutex, which is taken anyway, to ensure
    that at least either the connector or device registration call will
    work out.

    Mildly tested since I can't reliably reproduce this on my mst box
    here.

    Reported-by: Dave Hansen
    Cc: Dave Hansen
    Acked-by: Chris Wilson
    Cc: Chris Wilson
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/1484237756-2720-1-git-send-email-daniel.vetter@ffwll.ch

    Daniel Vetter
     

26 Jan, 2017

1 commit

  • With that the drm_pci_device_is_agp function becomes trivial, so
    inline that too. And while at it, move the drm_pci_agp_destroy
    declaration into drm-internal.h, since it's not used by drivers.

    Cc: Alex Deucher
    Cc: Ben Skeggs
    Reviewed-by: Alex Deucher
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/20170125062657.19270-11-daniel.vetter@ffwll.ch

    Daniel Vetter
     

10 Jan, 2017

2 commits

  • Continue to clean up drmP.h by moving the cache flushing functions into
    it's own header file.

    Compile-tested only

    Signed-off-by: Gabriel Krisman Bertazi
    Reviewed-by: Alex Deucher
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/20170109215649.6860-2-krisman@collabora.co.uk

    Gabriel Krisman Bertazi
     
  • Back to regular -misc pulls with reasonable sizes:
    - dma_fence error clarification (Chris)
    - drm_crtc_from_index helper (Shawn), pile more patches on the m-l to roll
    this out to drivers
    - mmu-less support for fbdev helpers from Benjamin
    - piles of kerneldoc work
    - some polish for crc support from Tomeu and Benjamin
    - odd misc stuff all over

    * tag 'drm-misc-next-2017-01-09' of git://anongit.freedesktop.org/git/drm-misc: (48 commits)
    dma-fence: Introduce drm_fence_set_error() helper
    dma-fence: Wrap querying the fence->status
    dma-fence: Clear fence->status during dma_fence_init()
    drm: fix compilations issues introduced by "drm: allow to use mmuless SoC"
    drm: Change the return type of the unload hook to void
    drm: add more document for drm_crtc_from_index()
    drm: remove useless parameters from drm_pick_cmdline_mode function
    drm: crc: Call wake_up_interruptible() each time there is a new CRC entry
    drm: allow to use mmuless SoC
    drm: compile drm_vm.c only when needed
    fbmem: add a default get_fb_unmapped_area function
    drm: crc: Wait for a frame before returning from open()
    drm: Move locking into drm_debugfs_crtc_crc_add
    drm/imx: imx-tve: Remove unused variable
    Revert "drm: nouveau: fix build when LEDS_CLASS=m"
    drm: Add kernel-doc for drm_crtc_commit_get/put
    drm/atomic: Fix outdated comment.
    drm: reference count event->completion
    gpu: drm: mgag200: mgag200_main:- Handle error from pci_iomap
    drm: Document deprecated load/unload hook
    ...

    Dave Airlie
     

09 Jan, 2017

1 commit

  • First -misc pull for 4.11:
    - drm_mm rework + lots of selftests (Chris Wilson)
    - new connector_list locking+iterators
    - plenty of kerneldoc updates
    - format handling rework from Ville
    - atomic helper changes from Maarten for better plane corner-case handling
    in drivers, plus the i915 legacy cursor patch that needs this
    - bridge cleanup from Laurent
    - plus plenty of small stuff all over
    - also contains a merge of the 4.10 docs tree so that we could apply the
    dma-buf kerneldoc patches

    It's a lot more than usual, but due to the merge window blackout it also
    covers about 4 weeks, so all in line again on a per-week basis. The more
    annoying part with no pull request for 4 weeks is managing cross-tree
    work. The -intel pull request I'll follow up with does conflict quite a
    bit with -misc here. Longer-term (if drm-misc keeps growing) a
    drm-next-queued to accept pull request for the next merge window during
    this time might be useful.

    I'd also like to backmerge -rc2+this into drm-intel next week, we have
    quite a pile of patches waiting for the stuff in here.

    * tag 'drm-misc-next-2016-12-30' of git://anongit.freedesktop.org/git/drm-misc: (126 commits)
    drm: Add kerneldoc markup for new @scan parameters in drm_mm
    drm/mm: Document locking rules
    drm: Use drm_mm_insert_node_in_range_generic() for everyone
    drm: Apply range restriction after color adjustment when allocation
    drm: Wrap drm_mm_node.hole_follows
    drm: Apply tight eviction scanning to color_adjust
    drm: Simplify drm_mm scan-list manipulation
    drm: Optimise power-of-two alignments in drm_mm_scan_add_block()
    drm: Compute tight evictions for drm_mm_scan
    drm: Fix application of color vs range restriction when scanning drm_mm
    drm: Unconditionally do the range check in drm_mm_scan_add_block()
    drm: Rename prev_node to hole in drm_mm_scan_add_block()
    drm: Fix O= out-of-tree builds for selftests
    drm: Extract struct drm_mm_scan from struct drm_mm
    drm: Add asserts to catch overflow in drm_mm_init() and drm_mm_init_scan()
    drm: Simplify drm_mm_clean()
    drm: Detect overflow in drm_mm_reserve_node()
    drm: Fix kerneldoc for drm_mm_scan_remove_block()
    drm: Promote drm_mm alignment to u64
    drm: kselftest for drm_mm and restricted color eviction
    ...

    Dave Airlie
     

04 Jan, 2017

1 commit

  • When writing the generic nonblocking commit code I assumed that
    through clever lifetime management I can assure that the completion
    (stored in drm_crtc_commit) only gets freed after it is completed. And
    that worked.

    I also wanted to make nonblocking helpers resilient against driver
    bugs, by having timeouts everywhere. And that worked too.

    Unfortunately taking boths things together results in oopses :( Well,
    at least sometimes: What seems to happen is that the drm event hangs
    around forever stuck in limbo land. The nonblocking helpers eventually
    time out, move on and release it. Now the bug I tested all this
    against is drivers that just entirely fail to deliver the vblank
    events like they should, and in those cases the event is simply
    leaked. But what seems to happen, at least sometimes, on i915 is that
    the event is set up correctly, but somohow the vblank fails to fire in
    time. Which means the event isn't leaked, it's still there waiting for
    eventually a vblank to fire. That tends to happen when re-enabling the
    pipe, and then the trap springs and the kernel oopses.

    The correct fix here is simply to refcount the crtc commit to make
    sure that the event sticks around even for drivers which only
    sometimes fail to deliver vblanks for some arbitrary reasons. Since
    crtc commits are already refcounted that's easy to do.

    References: https://bugs.freedesktop.org/show_bug.cgi?id=96781
    Cc: Jim Rees
    Cc: Chris Wilson
    Cc: Maarten Lankhorst
    Cc: Jani Nikula
    Reviewed-by: Maarten Lankhorst
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/20161221102331.31033-1-daniel.vetter@ffwll.ch

    Daniel Vetter
     

27 Dec, 2016

1 commit

  • This check is useful for drivers that do not have DRIVER_ATOMIC set but
    have atomic modesetting internally implemented. Wrap the check into a
    function since this is used in many places and as a bonus, the function
    name helps to document what the check is for.

    v2:
    Change return type to bool (Ville)
    Move the function drm_atomic.h (Daniel)
    Fixed comment marker for documentation

    Suggested-by: Daniel Vetter
    Cc: Daniel Vetter
    Cc: Ben Skeggs
    Signed-off-by: Dhinakaran Pandiyan
    [danvet: Move back to drmP.h because include hell.]
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/1482396643-32456-1-git-send-email-dhinakaran.pandiyan@intel.com

    Dhinakaran Pandiyan
     

25 Dec, 2016

1 commit


30 Nov, 2016

1 commit

  • drm/virtio: fix busid in a different way, allocate more vbufs.
    drm/qxl: various bugfixes and cleanups,

    * tag 'drm-qemu-20161121' of git://git.kraxel.org/linux: (224 commits)
    drm/virtio: allocate some extra bufs
    qxl: Allow resolution which are not multiple of 8
    qxl: Don't notify userspace when monitors config is unchanged
    qxl: Remove qxl_bo_init() return value
    qxl: Call qxl_gem_{init, fini}
    qxl: Add missing '\n' to qxl_io_log() call
    qxl: Remove unused prototype
    qxl: Mark some internal functions as static
    Revert "drm: virtio: reinstate drm_virtio_set_busid()"
    drm/virtio: fix busid regression
    drm: re-export drm_dev_set_unique
    Linux 4.9-rc5
    gp8psk: Fix DVB frontend attach
    gp8psk: fix gp8psk_usb_in_op() logic
    dvb-usb: move data_mutex to struct dvb_usb_device
    iio: maxim_thermocouple: detect invalid storage size in read()
    aoe: fix crash in page count manipulation
    lightnvm: invalid offset calculation for lba_shift
    Kbuild: enable -Wmaybe-uninitialized warnings by default
    pcmcia: fix return value of soc_pcmcia_regulator_set
    ...

    Dave Airlie
     

16 Nov, 2016

1 commit

  • Now that all drivers are switched over to drm_crtc_vblank_on/off we
    can relegate pre/post_modeset to the purely drm_irq.c internal role of
    supporting old ums userspace.

    As usual switch to the drm_legacy_ prefix to make it clear this is
    for old drivers only.

    v2: Rebase on top of Thierry's s/int crtc/unsigned int pipe/ changes.

    Cc: Ben Skeggs
    Cc: Alex Deucher
    Reviewed-by: Alex Deucher
    Signed-off-by: Daniel Vetter

    Daniel Vetter
     

15 Nov, 2016

2 commits

  • I want to move dumb buffer documentation into the right vfuncs, and
    for that I first need to be able to pull that into kerneldoc without
    having to clean up all of drmP.h. Also, header-splitting is nice.

    While at it shuffle all the function declarations for drm_drv.c into
    the right spots, and drop the kerneldoc for drm_minor_acquire/release
    since it's only used internally.

    v2: Keep all existing copyright notices (Chris).

    Reviewed-by: Chris Wilson
    Signed-off-by: Daniel Vetter

    Daniel Vetter
     
  • We still need it, for virtio-gpu for example.
    Partial revert of commit a742946a1ba57e24e8be205ea87224c05b38c380.

    Signed-off-by: Gerd Hoffmann

    Gerd Hoffmann
     

09 Nov, 2016

2 commits

  • The contents of drm_{plane,crtc,connector}_state is dumped before
    commit. If a driver extends any of the state structs, it can implement
    the corresponding funcs->atomic_print_state() to add it's own driver
    specific state.

    Signed-off-by: Rob Clark
    [seanpaul resolved conflict in drm_plane.h]
    Signed-off-by: Sean Paul

    Rob Clark
     
  • I'll want to print things in a similar way in a later patch. This will
    make it easier.

    Signed-off-by: Rob Clark
    Reviewed-by: Sean Paul
    Signed-off-by: Sean Paul
    Link: http://patchwork.freedesktop.org/patch/msgid/1478358492-30738-2-git-send-email-robdclark@gmail.com

    Rob Clark
     

02 Nov, 2016

1 commit