09 Aug, 2013

1 commit

  • …rm-intel into drm-fixes

    Daniel writes:
    A few bugfixes for serious stuff and regressions. Highlight is the
    reinstated hack to keep the i915 backlight on when running on an optimus
    machine, this prevents black screens especially with some radeon muxed
    platforms. And the patch to quiet dmesg on Linus' old mac mini ;-)

    * tag 'drm-intel-fixes-2013-08-08' of git://people.freedesktop.org/~danvet/drm-intel:
    drm/i915: do not disable backlight on vgaswitcheroo switch off
    drm/i915: Don't call encoder's get_config unless encoder is active
    drm/i915: avoid brightness overflow when doing scale
    drm/i915: update last_vblank when disabling the power well
    drm/i915: fix gen4 digital port hotplug definitions

    Dave Airlie
     

08 Aug, 2013

18 commits

  • It takes an unsigned value. This happens not to blow up on 64-bit
    architectures, but it does on 32-bit, causing
    drm_calc_vbltimestamp_from_scanoutpos() to calculate totally bogus
    timestamps for vblank events. Which in turn causes e.g. gnome-shell to
    hang after a DPMS off cycle with current xf86-video-ati Git.

    [airlied: regression introduced in drm: use monotonic time in drm_calc_vbltimestamp_from_scanoutpos]

    Cc: stable@vger.kernel.org
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59339
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59836
    Tested-by: shui yangwei
    Signed-off-by: Michel Dänzer
    Reviewed-by: Imre Deak
    Signed-off-by: Dave Airlie

    Michel Dänzer
     
  • Some more radeon fixes. Mostly dpm and uvd fixes. Fixes hangs
    with dpm on more rv6xx asics, and fixes suspend and resume with UVD.

    * 'drm-fixes-3.11' of git://people.freedesktop.org/~agd5f/linux:
    drm/radeon: make missing smc ucode non-fatal
    drm/radeon/dpm: require rlc for dpm
    drm/radeon/cik: use a mutex to properly lock srbm instanced registers
    drm/radeon: remove unnecessary unpin
    drm/radeon: add more UVD CS checking
    drm/radeon: stop sending invalid UVD destroy msg
    drm/radeon: only save UVD bo when we have open handles
    drm/radeon: always program the MC on startup
    drm/radeon: fix audio dto calculation on DCE3+ (v3)
    drm/radeon/dpm: disable sclk ss on rv6xx
    drm/radeon: fix halting UVD
    drm/radeon/dpm: adjust power state properly for UVD on SI
    drm/radeon/dpm: fix spread spectrum setup (v2)
    drm/radeon/dpm: adjust thermal protection requirements
    drm/radeon: select audio dto based on encoder id for DCE3
    drm/radeon: properly handle pm on gpu reset

    Dave Airlie
     
  • The smc ucode is required for dpm (dynamic power
    management), but if it's missing just skip dpm setup
    and don't disable acceleration.

    Should fix:
    https://bugs.freedesktop.org/show_bug.cgi?id=67876

    Signed-off-by: Alex Deucher

    Alex Deucher
     
  • The rlc is required for dpm to work properly, so if
    the rlc ucode is missing, don't enable dpm. Enabling
    dpm without the rlc enabled can result in hangs.

    Signed-off-by: Alex Deucher

    Alex Deucher
     
  • We need proper locking in the driver when accessing instanced
    registers on CIK.

    Signed-off-by: Alex Deucher

    Alex Deucher
     
  • We don't pin the BO on allocation, so don't unpin it on free.

    Signed-off-by: Christian König
    Signed-off-by: Alex Deucher

    Christian König
     
  • Improve error handling in case userspace sends us
    an invalid command buffer.

    Signed-off-by: Christian König
    Signed-off-by: Alex Deucher

    Christian König
     
  • We also need to check the handle.

    Signed-off-by: Christian König
    Cc: stable@vger.kernel.org
    Signed-off-by: Alex Deucher

    Christian König
     
  • Otherwise just reinitialize from scratch on resume,
    and so make it more likely to succeed.

    Signed-off-by: Christian König
    Cc: stable@vger.kernel.org
    Signed-off-by: Alex Deucher

    Christian König
     
  • For r6xx+ asics. This mirrors the behavior of pre-r6xx
    asics. We need to program the MC even if something
    else in startup() fails. Failure to do so results in
    an unusable GPU.

    Based on a fix from: Mark Kettenis
    Signed-off-by: Alex Deucher
    Cc: stable@vger.kernel.org

    Alex Deucher
     
  • Need to set the wallclock ratio and adjust the phase
    and module registers appropriately. May fix problems
    with audio timing at certain display timings.

    v2: properly handle clocks below 24mhz
    v3: rebase r600 changes

    Signed-off-by: Alex Deucher

    Alex Deucher
     
  • Enabling spread spectrum on the engine clock
    leads to hangs on some asics.

    Fixes:
    https://bugs.freedesktop.org/show_bug.cgi?id=66963

    Signed-off-by: Alex Deucher

    Alex Deucher
     
  • Removing the clock/power or resetting the VCPU can cause
    hangs if that happens in the middle of a register write.

    Stall the memory and register bus before putting the VCPU
    into reset. Keep it in reset when unloading the module or
    suspending.

    Signed-off-by: Christian König
    Cc: stable@vger.kernel.org
    Signed-off-by: Alex Deucher

    Christian König
     
  • There are some hardware issue with reclocking on SI when
    UVD is active, so use a stable power state when UVD is
    active. Fixes possible hangs and performance issues when
    using UVD on SI.

    Signed-off-by: Alex Deucher

    Alex Deucher
     
  • Need to check for engine and memory clock ss separately
    and only enable dynamic ss if either of them are found.

    This should fix systems which have a ss table, but do
    not have entries for engine or memory. On those systems
    we may enable dynamic spread spectrum without enabling
    it on the engine or memory clocks which can lead to a
    hang in some cases.

    fixes some systems reported here:
    https://bugs.freedesktop.org/show_bug.cgi?id=66963

    v2: fix typo

    Signed-off-by: Alex Deucher

    Alex Deucher
     
  • On rv770 and newer, clock gating is not required
    for thermal protection. The only requirement is that
    the design utilizes a thermal sensor.

    Signed-off-by: Alex Deucher

    Alex Deucher
     
  • There are two audio dtos on radeon asics that you can
    select between. Normally, dto0 is used for hdmi and
    dto1 for DP, but it seems that the dto is somehow
    tied to the encoders on DCE3 asics.

    fixes:
    https://bugs.freedesktop.org/show_bug.cgi?id=67435

    Signed-off-by: Alex Deucher
    Cc: stable@vger.kernel.org

    Alex Deucher
     
  • When we reset the GPU, we need to properly tear
    down power management before reseting the GPU and then
    set it back up again after reset. Add the missing
    radeon_pm_[suspend|resume] calls to the gpu reset
    function.

    Signed-off-by: Alex Deucher

    Alex Deucher
     

07 Aug, 2013

8 commits

  • On muxed systems, the other vgaswitcheroo client may depend on i915 to
    handle the backlight. We began switching off the backlight since

    commit a261b246ebd552fd5d5a8ed84cc931bb821c427f
    Author: Daniel Vetter
    Date: Thu Jul 26 19:21:47 2012 +0200

    drm/i915: disable all crtcs at suspend time

    breaking backlight on discreet graphics in (some) muxed systems.

    Keep the backlight on when the state is changed through vgaswitcheroo.

    Note: The alternative would be to add a quirk table to achieve the same
    based on system identifiers, but AFAICS it would asymptotically approach
    effectively the same as this patch as more IDs are added, but with the
    maintenance burden of the quirk table.

    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=55311
    Tested-by: Fede
    Tested-by: Aximab
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59785
    Tested-by: sfievet
    Signed-off-by: Jani Nikula
    Cc: stable@vger.kernel.org
    Signed-off-by: Daniel Vetter

    Jani Nikula
     
  • The SDVO code tries to compare the encoder's and crtc's idea of the
    pixel_multiplier. Normally they have to match, but when transitioning
    to DPMS off, we turn off the pipe before reading out the pipe_config,
    so the pixel_multiplier in the pipe_config will be 0, whereas the
    encoder will still have its pixel_multiplier set to whatever value we
    were using when the display was active. This leads to a warning
    from intel_modeset_check_state().

    WARNING: CPU: 1 PID: 2846 at drivers/gpu/drm/i915/intel_sdvo.c:1378 intel_sdvo_get_config+0x158/0x160()
    SDVO pixel multiplier mismatch, port: 0, encoder: 1
    Modules linked in: snd_hda_codec_idt snd_hda_intel snd_hda_codec snd_hwdep
    CPU: 1 PID: 2846 Comm: Xorg Not tainted 3.11.0-rc3-00208-gbe1e8d7-dirty #19
    Hardware name: Apple Computer, Inc. Macmini1,1/Mac-F4208EC8, BIOS MM11.88Z.0055.B03.0604071521 04/07/06
    00000000 00000000 ef0afa54 c1597bbb c1737ea4 ef0afa84 c10392ca c1737e6c
    ef0afab0 00000b1e c1737ea4 00000562 c12dfbe8 c12dfbe8 ef0afb14 00000000
    f697ec00 ef0afa9c c103936e 00000009 ef0afa94 c1737e6c ef0afab0 ef0afadc
    Call Trace:
    [] dump_stack+0x41/0x56
    [] warn_slowpath_common+0x7a/0xa0
    [] warn_slowpath_fmt+0x2e/0x30
    [] intel_sdvo_get_config+0x158/0x160
    [] check_crtc_state+0x1e0/0xb10
    [] intel_modeset_check_state+0x29d/0x7c0
    [] intel_sdvo_dpms+0x5c/0xa0
    [] drm_mode_obj_set_property_ioctl+0x40e/0x420
    [] drm_mode_connector_property_set_ioctl+0x35/0x40
    [] drm_ioctl+0x3e4/0x540
    [] do_vfs_ioctl+0x72/0x570
    [] SyS_ioctl+0x8f/0xa0
    [] sysenter_do_call+0x12/0x22
    ---[ end trace 7ce940aff1366d60 ]---

    Fix the problem by skipping the encoder get_config() function for
    inactive encoders.

    Tested-by: Linus Torvalds
    Signed-off-by: Ville Syrjälä
    Signed-off-by: Daniel Vetter

    Ville Syrjälä
     
  • Some card's max brightness level is pretty large, e.g. on Acer Aspire
    4732Z, the max level is 989910. If user space set a large enough level
    then the current scale done in intel_panel_set_backlight will cause an
    integer overflow and the scaled level will be mistakenly small, leaving
    user with an almost black screen. This patch fixes this problem.

    Signed-off-by: Aaron Lu
    [danvet: Add a comment to explain what's going on.]
    Signed-off-by: Daniel Vetter

    Aaron Lu
     
  • The DRM layer keeps track of our vblanks and it assumes our vblank
    counters only go back to zero when they overflow. The problem is that
    when we disable the power well our counters also go to zero, but it
    doesn't mean they did overflow. So on this patch we grab the lock and
    update last_vblank so the DRM layer won't think our counters
    overflowed.

    This patch fixes the following intel-gpu-tools test:
    ./kms_flip --run-subtest blocking-absolute-wf_vblank

    Regression introduced by the following commit:

    commit bf51d5e2cda5d36d98e4b46ac7fca9461e512c41
    Author: Paulo Zanoni
    Date: Wed Jul 3 17:12:13 2013 -0300
    drm/i915: switch disable_power_well default value to 1

    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66808
    Signed-off-by: Paulo Zanoni
    [danvet: Added a comment that this might be better done in
    drm_vblank_post_modeset in general.]
    Signed-off-by: Daniel Vetter

    Paulo Zanoni
     
  • Apparently Bspec is wrong in this case here even for gm45. Note that
    Bspec is horribly misguided on i965g/gm, so we don't have any other
    data points besides that it seems to make machines work better.

    With this changes all the bits in PORT_HOTPLUG_STAT for the digital
    ports are ordered the same way. This seems to agree with what register
    dumps from the hpd storm handling code shows, where the LIVE bit and
    the short/long pulse STATUS bits light up at the same time with this
    enumeration (but no with the one from Bspec).

    Also tested on my gm45 which has two DP+ ports, and everything seems
    to still work as expected.

    References: http://www.mail-archive.com/intel-gfx@lists.freedesktop.org/msg23054.html
    Cc: Egbert Eich
    Cc: Jan Niggemann
    Tested-by: Jan Niggemann
    [danvet: Add a big warning that Bspec seems to be wrong for these
    bits, suggested by Jani.]
    Acked-by: Jani Nikula
    Signed-off-by: Daniel Vetter

    Daniel Vetter
     
  • same fix as cirrus and mgag200.

    Cc: stable@vger.kernel.org
    Signed-off-by: Dave Airlie

    Dave Airlie
     
  • When a BO gets pinned the placement may get changed. If the memory is
    mapped into user space and user space has already accessed the mapped
    range the page tables are set up but now point to the wrong memory.
    Set bo.mdev->dev_mapping in mgag200_bo_create() to make sure that
    ttm_bo_unmap_virtual() called from ttm_bo_handle_move_mem() will take
    care of this.

    v2: Don't call ttm_bo_unmap_virtual() in mgag200_bo_pin(), fix comment.

    Signed-off-by: Egbert Eich
    Cc: stable@vger.kernel.org
    Signed-off-by: Dave Airlie

    Egbert Eich
     
  • This is a cirrus version of Egbert Eich's patch for mgag200.

    Without bo.bdev->dev_mapping set, the ttm_bo_unmap_virtual_locked
    called from ttm_bo_handle_move_mem returns with no effect. If any
    application accessed the memory before it was moved, it will
    access wrong memory next time. This causes crashes when changing
    resolution down.

    Signed-off-by: Michal Srb
    Cc: stable@vger.kernel.org
    Signed-off-by: Dave Airlie

    Michal Srb
     

04 Aug, 2013

1 commit


31 Jul, 2013

5 commits


30 Jul, 2013

7 commits

  • nouveau fixes a number of regressions and a few user triggerable oops
    since -rc1. Along with a few mpeg engine fixes.

    * 'drm-nouveau-next' of git://anongit.freedesktop.org/git/nouveau/linux-2.6:
    drm/nouveau: fix semaphore dmabuf obj
    drm/nouveau/vm: make vm refcount into a kref
    drm/nv31/mpeg: don't recognize nv3x cards as having nv44 graph class
    drm/nv40/mpeg: write magic value to channel object to make it work
    drm/nouveau: fix size check for cards without vm
    drm/nv50-/disp: remove dcb_outp_match call, and related variables
    drm/nva3-/disp: fix hda eld writing, needs to be padded
    drm/nv31/mpeg: fix mpeg engine initialization
    drm/nv50/mc: include vp in the fb error reporting mask
    drm/nouveau: fix null pointer dereference in poll_changed
    drm/nv50/gpio: post-nv92 cards have 32 interrupt lines
    drm/nvc0/fb: take lock in nvc0_ram_put()
    drm/nouveau/core: xtensa firmware size needs to be 0x40000 no matter what

    Dave Airlie
     
  • Fixes some dmabuf object errors on nv50 chipset and below.

    Cc: stable@vger.kernel.org [3.7+]
    Signed-off-by: Maarten Lankhorst
    Signed-off-by: Ben Skeggs

    Maarten Lankhorst
     
  • Never used to be required, but a recent change made it necessary.

    Reported-by: Maarten Lankhorst
    Signed-off-by: Ben Skeggs

    Ben Skeggs
     
  • This pull request fixes module build and g2d clock
    control issues, and includes related cleanup.

    * 'exynos-drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos:
    drm/exynos: Remove module.h header inclusion
    drm/exynos: consider common clock framework to g2d driver.
    drm/exynos: fix module build error
    drm/exynos: exynos_drm_ipp: fix return value check

    Dave Airlie
     
  • Signed-off-by: Ilia Mirkin
    Signed-off-by: Ben Skeggs

    Ilia Mirkin
     
  • Looks like the rewrite in commit ebb945a94b ("drm/nouveau: port all
    engines to new engine module format") missed that one little detail.

    Signed-off-by: Ilia Mirkin
    Signed-off-by: Ben Skeggs

    Ilia Mirkin
     
  • Op 24-07-13 17:55, Dan Carpenter schreef:
    > Hello Maarten Lankhorst,
    >
    > This is a semi-automatic email about new static checker warnings.
    >
    > The patch 0108bc808107: "drm/nouveau: do not allow negative sizes for
    > now" from Jul 7, 2013, leads to the following Smatch complaint:
    >
    > drivers/gpu/drm/nouveau/nouveau_bo.c:222 nouveau_bo_new()
    > warn: variable dereferenced before check 'drm->client.base.vm' (see line 201)
    >
    > drivers/gpu/drm/nouveau/nouveau_bo.c
    > 200 int type = ttm_bo_type_device;
    > 201 int max_size = INT_MAX & ~((1 << drm->client.base.vm->vmm->lpg_shift) - 1);
    > ^^^^^^^^^^^^^^^^^^^
    > New dereference.
    >
    > 202
    > 203 if (size max_size) {
    > 204 nv_warn(drm, "skipped size %x\n", (u32)size);
    > 205 return -EINVAL;
    > 206 }
    > 207
    > 208 if (sg)
    > 209 type = ttm_bo_type_sg;
    > 210
    > 211 nvbo = kzalloc(sizeof(struct nouveau_bo), GFP_KERNEL);
    > 212 if (!nvbo)
    > 213 return -ENOMEM;
    > 214 INIT_LIST_HEAD(&nvbo->head);
    > 215 INIT_LIST_HEAD(&nvbo->entry);
    > 216 INIT_LIST_HEAD(&nvbo->vma_list);
    > 217 nvbo->tile_mode = tile_mode;
    > 218 nvbo->tile_flags = tile_flags;
    > 219 nvbo->bo.bdev = &drm->ttm.bdev;
    > 220
    > 221 nvbo->page_shift = 12;
    > 222 if (drm->client.base.vm) {
    > ^^^^^^^^^^^^^^^^^^^
    > Old check.
    >
    > 223 if (!(flags & TTM_PL_FLAG_TT) && size > 256 * 1024)
    > 224 nvbo->page_shift = drm->client.base.vm->vmm->lpg_shift;
    >
    > regards,
    > dan carpenter

    8
    Reported-by: konrad wilk
    Signed-off-by: Maarten Lankhorst
    Signed-off-by: Ben Skeggs

    Maarten Lankhorst