1. 06 8月, 2015 3 次提交
    • A
      drm/fb_helper: Create wrappers for fb_sys_read/write funcs · cbb1a82e
      Archit Taneja 提交于
      Some drm drivers populate their fb_ops with fb_sys_read/write fb sysfs
      ops.
      
      Create a drm_fb_helper function that wraps around these calls.
      
      This is part of an effort to prevent drm drivers from calling fbdev
      functions directly, in order to make fbdev emulation a top level drm
      option.
      
      v3:
      - Fix kerneldoc errors
      
      v2:
      - Added kerneldocs
      - Follow the drm way of aligning of arguments in func definitions
      - Remove unnecessary checks for non NULL fb_info
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      cbb1a82e
    • A
      drm/fb_helper: Create a wrapper for unlink_framebuffer · 47074ab7
      Archit Taneja 提交于
      Some drm drivers call unlink_framebuffer. Create a drm_fb_helper function
      that wraps around these calls.
      
      This is part of an effort to prevent drm drivers from calling fbdev
      functions directly, in order to make fbdev emulation a top level drm
      option.
      
      v2:
      - Added kerneldocs
      - Added a check for non-NULL fb_helper before proceeding. This will
        make the helpers work when we have a module param for fbdev emulation
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      47074ab7
    • A
      drm/fb_helper: Add drm_fb_helper functions to manage fb_info creation · b8017d6c
      Archit Taneja 提交于
      Every drm driver calls framebuffer_alloc, fb_alloc_cmap,
      unregister_framebuffer, fb_dealloc_cmap and framebuffer_release in
      order to emulate fbdev support.
      
      Create drm_fb_helper functions that perform the above operations.
      
      This is part of an effort to prevent drm drivers from calling fbdev
      functions directly. It also removes repetitive code from drivers.
      
      There are some drivers that call alloc_apertures after framebuffer_alloc
      and some that don't. Make the helper always call alloc_apertures. This
      would make certain drivers allocate memory for apertures but not use
      them. Since it's a small amount of memory, it shouldn't be an issue.
      
      v2:
      - Added kerneldocs
      - Added a check for non-NULL fb_helper before proceeding. This will
        make the helpers work when we have a module param for fbdev emulation
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      b8017d6c
  2. 27 7月, 2015 4 次提交
  3. 22 7月, 2015 6 次提交
    • D
      drm: gc now dead mode_group code · 3fdefa39
      Daniel Vetter 提交于
      Two nice things here:
      - drm_dev_register will truly register everything in the right order
        if the driver doesn't have a ->load callback. Before this we had to
        init the primary mode_group after the device nodes where already
        registered.
      
      - Less things to keep track of when reworking the connector locking,
        yay!
      Reviewed-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      3fdefa39
    • D
      drm: Amend connector list locking rules · cff20ba2
      Daniel Vetter 提交于
      Now that dp mst hotplug takes all locks we can amend the locking rules
      for the iterators. This is needed before we can roll these out in the
      atomic code to avoid getting burried in WARNINGs.
      
      v2: Rebase onto the extracted list locking assert and add a comment to
      explain the rules.
      
      v3: Fixup German->English translation fail in the comment.
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      cff20ba2
    • D
      drm: Check locking in drm_for_each_fb · 4676ba0b
      Daniel Vetter 提交于
      Ever since framebuffers are reference counted we have a special lock
      for the global fb list. Make sure users of that list do hold that
      lock when using the new iterators.
      Reviewed-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      4676ba0b
    • D
      drm: Check locking in drm_for_each_connector · 7a3f3d66
      Daniel Vetter 提交于
      Because of DP MST connectors can now be hotplugged and we must hold
      the right lock when walking the connector lists.  Enforce this by
      checking the locking in our shiny new list walking macros.
      
      v2: Extract the locking check into a small static inline helper to
      help readability. This will be more important when we make the
      read list access rules more complicated in later patches. Inspired by
      comments from Chris. Unfortunately, due to header loops around the
      definition of struct drm_device the function interface is a bit funny.
      
      v3: Encoders aren't hotadded/removed. For each dp mst encoder we
      statically create one fake encoder per pipe so that we can support as
      many mst sinks as the hw can (Dave).
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Dave Airlie <airlied@redhat.com>
      Reviewed-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      7a3f3d66
    • D
      drm: Add modeset object iterators · 6295d607
      Daniel Vetter 提交于
      And roll them out across drm_* files. The point here isn't code
      prettification (it helps with that too) but that some of these lists
      aren't static any more. And having macros will gives us a convenient
      place to put locking checks into.
      
      I didn't add an iterator for props since that's only used by a
      list_for_each_entry_safe in the driver teardown code.
      
      Search&replace was done with the below cocci spatch. Note that there's
      a bunch more places that didn't match and which would need some manual
      changes, but I've intentially left these out for this mostly automated
      patch.
      
      iterator name drm_for_each_crtc;
      struct drm_crtc *crtc;
      struct drm_device *dev;
      expression head;
      @@
      - list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
      + drm_for_each_crtc (crtc, dev) {
      ...
      }
      
      @@
      iterator name drm_for_each_encoder;
      struct drm_encoder *encoder;
      struct drm_device *dev;
      expression head;
      @@
      - list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
      + drm_for_each_encoder (encoder, dev) {
      ...
      }
      
      @@
      iterator name drm_for_each_fb;
      struct drm_framebuffer *fb;
      struct drm_device *dev;
      expression head;
      @@
      - list_for_each_entry(fb, &dev->mode_config.fb_list, head) {
      + drm_for_each_fb (fb, dev) {
      ...
      }
      
      @@
      iterator name drm_for_each_connector;
      struct drm_connector *connector;
      struct drm_device *dev;
      expression head;
      @@
      - list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
      + drm_for_each_connector (connector, dev) {
      ...
      }
      Reviewed-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      6295d607
    • D
      drm: Simplify drm_for_each_legacy_plane arguments · 4ea50e99
      Daniel Vetter 提交于
      No need to pass the planelist when everyone just uses
      dev->mode_config.plane_list anyway.
      
      I want to add a pile more of iterators with unified (obj, dev)
      arguments. This is just prep.
      Reviewed-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      4ea50e99
  4. 02 7月, 2015 1 次提交
    • P
      drm: Turn off Legacy Context Functions · 0e975980
      Peter Antoine 提交于
      The context functions are not used by the i915 driver and should not
      be used by modeset drivers. These driver functions contain several bugs
      and security holes. This change makes these functions optional can be
      turned on by a setting, they are turned off by default for modeset
      driver with the exception of the nouvea driver that may require them with
      an old version of libdrm.
      
      The previous attempt was
      
      commit 7c510133
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Thu Aug 8 15:41:21 2013 +0200
      
          drm: mark context support as a legacy subsystem
      
      but this had to be reverted
      
      commit c21eb21c
      Author: Dave Airlie <airlied@redhat.com>
      Date:   Fri Sep 20 08:32:59 2013 +1000
      
          Revert "drm: mark context support as a legacy subsystem"
      
      v2: remove returns from void function, and formatting (Daniel Vetter)
      
      v3:
      - s/Nova/nouveau/ in the commit message, and add references to the
        previous attempts
      - drop the part touching the drm hw lock, that should be a separate
        patch.
      
      Signed-off-by: Peter Antoine <peter.antoine@intel.com> (v2)
      Cc: Peter Antoine <peter.antoine@intel.com> (v2)
      Reviewed-by: NPeter Antoine <peter.antoine@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      0e975980
  5. 01 7月, 2015 1 次提交
  6. 26 6月, 2015 1 次提交
  7. 25 6月, 2015 1 次提交
    • D
      drm/dp/mst: close deadlock in connector destruction. · 6b8eeca6
      Dave Airlie 提交于
      I've only seen this once, and I failed to capture the
      lockdep backtrace, but I did some investigations.
      
      If we are calling into the MST layer from EDID probing,
      we have the mode_config mutex held, if during that EDID
      probing, the MST hub goes away, then we can get a deadlock
      where the connector destruction function in the driver
      tries to retake the mode config mutex.
      
      This offloads connector destruction to a workqueue,
      and avoid the subsequenct lock ordering issue.
      Acked-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      6b8eeca6
  8. 19 6月, 2015 1 次提交
  9. 05 6月, 2015 1 次提交
  10. 03 6月, 2015 1 次提交
    • D
      Add virtio gpu driver. · dc5698e8
      Dave Airlie 提交于
      This patch adds a kms driver for the virtio gpu.  The xorg modesetting
      driver can handle the device just fine, the framebuffer for fbcon is
      there too.
      
      Qemu patches for the host side are under review currently.
      
      The pci version of the device comes in two variants: with and without
      vga compatibility.  The former has a extra memory bar for the vga
      framebuffer, the later is a pure virtio device.  The only concern for
      this driver is that in the virtio-vga case we have to kick out the
      firmware framebuffer.
      
      Initial revision has only 2d support, 3d (virgl) support requires
      some more work on the qemu side and will be added later.
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Acked-by: NMichael S. Tsirkin <mst@redhat.com>
      dc5698e8
  11. 26 5月, 2015 4 次提交
  12. 22 5月, 2015 2 次提交
  13. 21 5月, 2015 3 次提交
    • A
      drm: bridge: Allow daisy chaining of bridges · 862e686c
      Archit Taneja 提交于
      Allow drm_bridge objects to link to each other in order to form an encoder
      chain. The requirement for creating a chain of bridges comes because the
      MSM drm driver uses up its encoder and bridge objects for blocks within
      the SoC itself. There isn't anything left to use if the SoC display output
      is connected to an external encoder IC. Having an additional bridge
      connected to the existing bridge helps here. In general, it is possible for
      platforms to have  multiple devices between the encoder and the
      connector/panel that require some sort of configuration.
      
      We create drm bridge helper functions corresponding to each op in
      'drm_bridge_funcs'. These helpers call the corresponding
      'drm_bridge_funcs' op for the entire chain of bridges. These helpers are
      used internally by drm_atomic_helper.c and drm_crtc_helper.c.
      
      The drm_bridge_enable/pre_enable helpers execute enable/pre_enable ops of
      the bridge closet to the encoder, and proceed until the last bridge in the
      chain is enabled. The same holds for drm_bridge_mode_set/mode_fixup
      helpers. The drm_bridge_disable/post_disable helpers disable the last
      bridge in the chain first, and proceed until the first bridge in the chain
      is disabled.
      
      drm_bridge_attach() remains the same. As before, the driver calling this
      function should make sure it has set the links correctly. The order in
      which the bridges are connected to each other determines the order in which
      the calls are made. One requirement is that every bridge in the chain
      should point the parent encoder object. This is required since bridge
      drivers expect a valid encoder pointer in drm_bridge. For example, consider
      a chain where an encoder's output is connected to bridge1, and bridge1's
      output is connected to bridge2:
      
      	/* Like before, attach bridge to an encoder */
      	bridge1->encoder = encoder;
      	ret = drm_bridge_attach(dev, bridge1);
      	..
      
      	/*
      	 * set the first bridge's 'next' bridge to bridge2, set its encoder
      	 * as bridge1's encoder
      	 */
      	bridge1->next = bridge2
      	bridge2->encoder = bridge1->encoder;
      	ret = drm_bridge_attach(dev, bridge2);
      
      	...
      	...
      
      This method of bridge chaining isn't intrusive and existing drivers that
      use drm_bridge will behave the same way as before. The bridge helpers also
      cleans up the atomic and crtc helper files a bit.
      Reviewed-by: NJani Nikula <jani.nikula@linux.intel.com>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      Reviewed-by: NDaniel Vetter <daniel@ffwll.ch>
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      862e686c
    • M
      drm/atomic: add drm_atomic_add_affected_planes · e01e9f75
      Maarten Lankhorst 提交于
      This is a convenience function to add all planes for a crtc,
      similar to add_affected_connectors. This will be used in
      drm_atomic_helper_check_modeset, but drivers can call it too
      when they need to recalculate all state.
      Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      [danvet: Amend kerneldoc a bit.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e01e9f75
    • M
      drm/atomic: add commit_planes_on_crtc helper · de28d021
      Maarten Lankhorst 提交于
      drm_atomic_helper_commit_planes calls all atomic_begin's first,
      then updates all planes, finally calling atomic_flush.
      
      Some drivers may want to things like disabling irq's
      from their atomic_begin, in which case a second call to atomic_begin
      will splat. By using commit_planes_on_crtc on each crtc in the
      atomic state they'll evade that issue.
      Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      [danvet: Extend kerneldoc a bit as discussed with Maarten on irc.]
      [danvet: Squash in fixup to check for crtc_funcs in all places.
      Reported by Dan Carpenter.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      de28d021
  14. 20 5月, 2015 1 次提交
  15. 18 5月, 2015 2 次提交
  16. 13 5月, 2015 3 次提交
  17. 12 5月, 2015 1 次提交
  18. 08 5月, 2015 3 次提交
    • D
      drm/edid: Kerneldoc for newly added edid_corrupt · ac6f2e29
      Daniel Vetter 提交于
      Also treat it as a proper boolean.
      
      Cc: Todd Previte <tprevite@gmail.com>
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Cc: dri-devel@lists.freedesktop.org
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      ac6f2e29
    • D
      drm: Introduce blob_lock · 8fb6e7a5
      Daniel Stone 提交于
      Create a new global blob_lock mutex, which protects the blob property
      list from insertion and/or deletion.
      Signed-off-by: NDaniel Stone <daniels@collabora.com>
      Reviewed-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      8fb6e7a5
    • T
      drm: Add edid_corrupt flag for Displayport Link CTS 4.2.2.6 · 6ba2bd3d
      Todd Previte 提交于
      Displayport compliance test 4.2.2.6 requires that a source device be capable of
      detecting a corrupt EDID. The test specification states that the sink device
      sets up the EDID with an invalid checksum. To do this, the sink sets up an
      invalid EDID header, expecting the source device to generate the checksum and
      compare it to the value stored in the last byte of the block data.
      
      Unfortunately, the DRM EDID reading and parsing functions are actually too good
      in this case; the header is fixed before the checksum is computed and thus the
      test never sees the invalid checksum. This results in a failure to pass the
      compliance test.
      
      To correct this issue, when the EDID code detects that the header is invalid,
      a flag is set to indicate that the EDID is corrupted. In this case, it sets
      edid_corrupt flag and continues with its fix-up code. This flag is also set in
      the case of a more seriously damaged header (fixup score less than the
      threshold). For consistency, the edid_corrupt flag is also set when the
      checksum is invalid as well.
      
      V2:
      - Removed the static bool global
      - Added a bool to the drm_connector struct to reaplce the static one for
        holding the status of raw edid header corruption detection
      - Modified the function signature of the is_valid function to take an
        additional parameter to store the corruption detected value
      - Fixed the other callers of the above is_valid function
      V3:
      - Updated the commit message to be more clear about what and why this
        patch does what it does.
      - Added comment in code to clarify the operations there
      - Removed compliance variable and check_link_status update; those
        have been moved to a later patch
      - Removed variable assignment from the bottom of the test handler
      V4:
      - Removed i915 tag from subject line as the patch is not i915-specific
      V5:
      - Moved code causing a compilation error to this patch where the variable
        is actually declared
      - Maintained blank lines / spacing so as to not contaminate the patch
      V6:
      - Removed extra debug messages
      - Added documentation to for the added parameter on drm_edid_block_valid
      - Fixed more whitespace issues in check_link_status
      - Added a clear of the header_corrupt flag to the end of the test handler
        in intel_dp.c
      - Changed the usage of the new function prototype in several places to use
        NULL where it is not needed by compliance testing
      V7:
      - Updated to account for long_pulse flag propagation
      V8:
      - Removed clearing of header_corrupt flag from the test handler in intel_dp.c
      - Added clearing of header_corrupt flag in the drm_edid_block_valid function
      V9:
      - Renamed header_corrupt flag to edid_corrupt to more accurately reflect its
        value and purpose
      - Updated commit message
      V10:
      - Updated for versioning and patch swizzle
      - Revised the title to more accurately reflect the nature and contents of
        the patch
      - Fixed formatting/whitespace problems
      - Added set flag when computed checksum is invalid
      Signed-off-by: NTodd Previte <tprevite@gmail.com>
      Cc: dri-devel@lists.freedesktop.org
      Acked-by: NDave Airlie <airlied@redhat.com>
      Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      6ba2bd3d
  19. 05 5月, 2015 1 次提交