1. 23 4月, 2014 4 次提交
    • D
      drm/irq: Look up the pci irq directly in the drm_control ioctl · a319c1a4
      Daniel Vetter 提交于
      It's only ever called for legacy drivers, which are all pci.
      Reviewed-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a319c1a4
    • D
      drm/irq: track the irq installed in drm_irq_install in dev->irq · 7c1a38e3
      Daniel Vetter 提交于
      To get rid of the dev->bus->get_irq callback we need to pass in the
      desired irq explicitly into drm_irq_install. To avoid having to do the
      same for drm_irq_unistall just track it internally. That leaves
      drivers with less room to botch things up.
      
      v2: Add the hunk lost in an earlier patch to this one (Thierry).
      
      v3: Fix up the totally fumbled logic in drm_irq_install and use the
      local variable consistently. Spotted by both Thierry and Laurent.
      Shame on me for failing to properly test the rebase version of this
      patch ...
      
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Reviewed-by: NThierry Reding <treding@nvidia.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      7c1a38e3
    • D
      drm: rename dev->count_lock to dev->buf_lock · 2177a218
      Daniel Vetter 提交于
      Since really that's all it protects - legacy horror stories in
      drm_bufs.c. Since I don't want to waste any more time on this I didn't
      bother to actually look at what it protects in there, but it's at
      least contained now.
      
      v2: Move the spurious hunk to the right patch (Thierry).
      
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Reviewed-by: NThierry Reding <treding@nvidia.com>
      Reviewed-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      2177a218
    • D
      drm: Rip out totally bogus vga_switcheroo->can_switch locking · fc8fd40e
      Daniel Vetter 提交于
      So I just wanted to add a new field to struct drm_device and
      accidentally stumbled over something. According to comments
      dev->open_count is protected by dev->count_lock, but that's totally
      not the case. It's protected by drm_global_mutex.
      
      Unfortunately the vga switcheroo callbacks took this comment at face
      value. The problem is that we can't just take the drm_global_mutex
      because:
      - It would lead to a locking inversion with the driver load/unload
        paths.
      - It wouldn't actually protect anything, for that we'd need to wrap
        the entire vga switcheroo code in the drm_global_mutex. And I'm not
        sure whether that would actually solve anything.
      
      What we probably want is a try_to_grab_switcheroo reference kind of
      thing which is used in the driver's ->open callback. Then we could
      move all that ->can_switch madness into the vga switcheroo core where
      it really belongs.
      
      But since that would amount to real work take the easy way out and
      just add a comment. It's definitely not going to make anything worse
      since doing switcheroo state changes while restarting X just isn't
      recommended. Even though the delayed switching code does exactly that.
      
      v2:
      - Simplify the ->can_switch implementations more (Thierry)
      - Fix comment about the dev->open_count locking (Thierry)
      
      Cc: Thierry Reding <treding@nvidia.com>
      Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> (v1)
      Reviewed-by: NThierry Reding <treding@nvidia.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      fc8fd40e
  2. 22 4月, 2014 6 次提交
  3. 18 4月, 2014 7 次提交
    • G
      drm: bochs: drop unused struct fields · c044330b
      Gerd Hoffmann 提交于
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      c044330b
    • G
      drm: bochs: add power management support · b8ccd70f
      Gerd Hoffmann 提交于
      bochs kms driver lacks power management support, thus
      the vga display doesn't work any more after S3 resume.
      
      Fix this by adding suspend and resume functions.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      b8ccd70f
    • G
      drm: cirrus: add power management support · 2f1e8007
      Gerd Hoffmann 提交于
      cirrus kms driver lacks power management support, thus
      the vga display doesn't work any more after S3 resume.
      
      Fix this by adding suspend and resume functions.
      Also make the mode_set function unblank the screen.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      2f1e8007
    • D
      drm: Split out drm_probe_helper.c from drm_crtc_helper.c · 8d754544
      Daniel Vetter 提交于
      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: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      8d754544
    • D
      drm/plane-helper: Don't fake-implement primary plane disabling · b6ccd7b9
      Daniel Vetter 提交于
      After thinking about this topic a bit more I've reached the conclusion
      that implementing this doesn't make sense:
      
      - The locking is all wrong: set_config(NULL) will also unlink encoders
        and connectors, but those links are protected with the mode_config
        mutex. In the ->disable_plane callback we only hold all modeset
        locks, but eventually we want to switch to just grabbing the
        per-crtc (and maybe per-plane) locks as needed, maybe based on
        ww_mutexes. Having a callback which absolutely needs all modeset
        locks is bad for this conversion.
      
        Note that the same isn't true for the provided ->update_plane since
        we've audited the crtc helpers to make sure that not encoder or
        connector links are changed.
      
      - There's no way to re-enable the plane with an ->update_plane: The
        connectors/encoder links are lost and so we can't re-enable the
        CRTC. Even without that issue the driver might have reassigned some
        shared resources (as opposed to e.g. DPMS off, where drivers are not
        allowed to do that to make sure the CRTC can be enabled again).
      
      - The semantics don't make much sense: Userspace asked to scan out
        black (or some other color if the driver supports a background
        color), not that the screen be disabled.
      
      - Implementing proper primary plane support (i.e. actually disabling
        the primary plane without disabling the CRTC) is really simple, at
        least if all the hw needs is flipping a bit. The big task is
        auditing all the interactions with other ioctls when the CRTC is on
        but there's no primary plane (e.g. pageflips). And some of that work
        still needs to be done.
      
      Cc: Matt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      b6ccd7b9
    • D
      drm/ast: fix value check in cbr_scan2 · a82049b1
      Dave Airlie 提交于
      this is a typo vs the ums driver, fix to check correct value.
      
      Found initially by Coverity.
      Reported-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      a82049b1
    • S
      drm/nouveau/bios: fix a bit shift error introduced by 457e77b2 · 9a118439
      Sergei Antonov 提交于
      Commit 457e77b2 added two checks applied to a
      value received from nv_rd32(bios, 0x619f04). But after this new piece of code
      is executed, the addr local variable does not hold the same value it used to
      hold before the commit. Here is what is was assigned in the original code:
      	(u64)(nv_rd32(bios, 0x619f04) & 0xffffff00) << 8
      in the committed code it ends up with this value:
      	(u64)(nv_rd32(bios, 0x619f04) >> 8) << 8
      These expressions are obviously not equivalent.
      
      My Nvidia video card does not show anything on the display when I boot a
      kernel containing this commit.
      
      The patch fixes the code so that the new checks are still done, but the
      side effect of an incorrect addr value is gone.
      
      Cc: Ben Skeggs <bskeggs@redhat.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NSergei Antonov <saproj@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      9a118439
  4. 17 4月, 2014 12 次提交
  5. 16 4月, 2014 1 次提交
    • S
      gpu: host1x: handle the correct # of syncpt regs · 22bbd5d9
      Stephen Warren 提交于
      BIT_WORD() truncates rather than rounds, so the loops in
      syncpt_thresh_isr() and _host1x_intr_disable_all_syncpt_intrs() use <=
      rather than < in an attempt to process the correct number of registers
      when rounding of the conversion of count of bits to count of words is
      necessary. However, when rounding isn't necessary because the value is
      already a multiple of the divisor (as is the case for all values of
      nb_pts the code actually sees), this causes one too many registers to
      be processed.
      
      Solve this by using and explicit DIV_ROUND_UP() call, rather than
      BIT_WORD(), and comparing with < rather than <=.
      
      Fixes: 7ede0b0b ("gpu: host1x: Add syncpoint wait and interrupts")
      Cc: <stable@vger.kernel.org> # 3.10
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Acked-By: NTerje Bergstrom <tbergstrom@nvidia.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      22bbd5d9
  6. 15 4月, 2014 9 次提交
  7. 14 4月, 2014 1 次提交