drm: Import Linux commit ff4bd0827764e10a428a9d39e6814c5478863f94

Author: Ilija Hadzic <ihadzic@research.bell-labs.com>
Date:   Mon Jan 7 18:21:57 2013 -0500

    drm/radeon: fix NULL pointer dereference in UMS mode

    In UMS mode parser->rdev is NULL, so dereferencing
    will cause an oops.

    Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drm: Import Linux commit a6b7e1a02b77ab8fe8775d20a88c53d8ba55482e

Author: Ilija Hadzic <ihadzic@research.bell-labs.com>
Date:   Mon Jan 7 18:21:58 2013 -0500

    drm/radeon: fix a bogus kfree

    parser->chunks[.].kpage[.] is not always kmalloc-ed
    by the parser initialization, so parser_fini should
    not try to kfree it if it didn't allocate it.

    This patch fixes a kernel oops that can be provoked
    in UMS mode.

    Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drm: Import Linux commit 25d8999780f8c1f53928f4a24a09c01550423109

Author: Ilija Hadzic <ihadzic@research.bell-labs.com>
Date:   Mon Jan 7 18:21:59 2013 -0500

    drm/radeon: fix error path in kpage allocation

    Index into chunks[] array doesn't look right.

    Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drm: Import Linux commit 51861d4eebc2ddc25c77084343d060fa79f6e291

Author: Jerome Glisse <jglisse@redhat.com>
Date:   Tue Jan 8 18:41:01 2013 -0500

    radeon/kms: force rn50 chip to always report connected on analog output

    Those rn50 chip are often connected to console remoting hw and load
    detection often fails with those. Just don't try to load detect and
    report connect.

    Signed-off-by: Jerome Glisse <jglisse@redhat.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Cc: stable@vger.kernel.org
drm: Import Linux commit 9305ede6afe2998b391cd225e02a18f37d62028e

Author: Jerome Glisse <jglisse@redhat.com>
Date:   Wed Jan 9 16:40:42 2013 -0500

    radeon/kms: fix dma relocation checking

    We were checking the index against the size of the relocation buffer
    instead of against the last index. This fix kernel segfault when
    userspace submit ill formated command stream/relocation buffer pair.

    Signed-off-by: Jerome Glisse <jglisse@redhat.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drm: Import Linux commit 19fc42ed9950d5fe17089c0a928121047c882092

Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Mon Jan 14 11:04:39 2013 -0500

    drm/radeon: clear reset flags if engines are idle

    Fixes a hard lock in the gpu reset code after the
    rework for DMA support (0ecebb9e0d14e9948e0b1529883a776758117d6f
    "drm/radeon: switch to a finer grained reset for evergreen")
    due to not bailing before the MC shutdown if the relevant engines
    are idle.

    Discussion:
    http://lists.freedesktop.org/archives/dri-devel/2013-January/032985.html

    Reported-by: Eldad Zack <eldad@fogrefinery.com>
    Tested-by: Eldad Zack <eldad@fogrefinery.com>
    Acked-by: Paul Menzel <paulepanter@users.sourceforge.net>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drm: Import Linux commit c18b1170493de637eea58671da7df5689ce13491

Author: Marek Olšák <maraeo@gmail.com>
Date:   Sat Jan 12 04:19:37 2013 +0100

    drm/radeon: allow FP16 color clear registers on r500

    Probably not a candidate for stable kernels because of conflicts
    in DRM versioning.

    Signed-off-by: Marek Olšák <maraeo@gmail.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drm: Import Linux commit 5f0839c11e17d8d942ab02626752f95e30a02a4c

Author: Jerome Glisse <jglisse@redhat.com>
Date:   Fri Jan 11 15:19:43 2013 -0500

    drm/radeon: improve semaphore debugging on lockup

    Signed-off-by: Jerome Glisse <jglisse@redhat.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drm: Import Linux commit 20707874fd4fd37e09513f508e642fa8bd06365a

Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Thu Jan 17 13:10:50 2013 -0500

    Revert "drm/radeon: do not move bo to different placement at each cs"

    This reverts commit d025e9e2b890db679f1246037bf65bd4be512627.

    This causes corruption for a number of users and needs further
    investigation in the next cycle.
    https://bugzilla.kernel.org/show_bug.cgi?id=52491
    https://bugs.freedesktop.org/show_bug.cgi?id=58659
    http://lists.freedesktop.org/archives/dri-devel/2013-January/032961.html

    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drm: Import Linux commit e521a29014794d139cca46396d1af8faf1295a26

Author: Jerome Glisse <jglisse@redhat.com>
Date:   Mon Jan 21 15:50:03 2013 -0500

    drm/radeon: fix cursor corruption on DCE6 and newer

    Aruba and newer gpu does not need the avivo cursor work around,
    quite the opposite this work around lead to corruption.

    agd5f: check DCE6 rather than ARUBA since the issue is DCE
    version specific rather than family specific.

    Signed-off-by: Jerome Glisse <jglisse@redhat.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Cc: stable@vger.kernel.org
drm: Import Linux commit 1da80cfa8727abf404fcee44d04743febea54069

Author: Ilija Hadzic <ihadzic@research.bell-labs.com>
Date:   Wed Jan 23 13:59:05 2013 -0500

    drm/radeon: fix a rare case of double kfree

    If one (but not both) allocations of p->chunks[].kpage[]
    in radeon_cs_parser_init fail, the error path will free
    the successfully allocated page, but leave a stale pointer
    value in the kpage[] field. This will later cause a
    double-free when radeon_cs_parser_fini is called.
    This patch fixes the issue by forcing both pointers to NULL
    after kfree in the error path.

    The circumstances under which the problem happens are very
    rare. The card must be AGP and the system must run out of
    kmalloc area just at the right time so that one allocation
    succeeds, while the other fails.

    Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
    Cc: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Cc: stable@vger.kernel.org
drm: Import Linux commit b3dfcb207e550dffb8680cab7afaf6b4fb6eae33

Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Thu Jan 24 19:02:01 2013 +0100

    drm/radeon: Enable DMA_IB_SWAP_ENABLE on big endian hosts.

    Fixes GPU hang during DMA ring IB test.

    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59672

    Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drm: Import Linux commit bb588820ef421c6098dca1fec29c3b347f1c8c19

Author: Christopher Staite <chris@yourdreamnet.co.uk>
Date:   Sat Jan 26 11:10:58 2013 -0500

    drm/radeon: fix MC blackout on evergreen+

    Force the crtc mem requests on/off immediately rather
    than waiting for the double buffered updates to kick in.
    Seems we miss the update in certain conditions.  Also
    handle the DCE6 case.

    Signed-off-by: Christopher Staite <chris@yourdreamnet.co.uk>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Cc: stable@vger.kernel.org
drm: Import Linux commit 674a16f2b4724880d07389abbb95abf320b924aa

Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Sun Jan 27 21:57:51 2013 -0500

    drm/radeon: add WAIT_UNTIL to the non-VM safe regs list for cayman/TN

    Newer versions of mesa emit this.

    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Cc: stable@vger.kernel.org
drm: Import Linux commit 9200ee4941a6e5d1ec5df88982243686882dff3f

Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Tue Jan 29 16:36:47 2013 -0500

    drm/radeon: add quirk for RV100 board

    vbios says external TMDS while the board is actually
    internal TMDS.

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

    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Cc: stable@vger.kernel.org
drm: Import Linux commit f7eb97300832f4fe5fe916c5d84cd2e25169330e

Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Wed Jan 30 13:57:40 2013 -0500

    drm/radeon: fix backend map setup on 1 RB sumo boards

    Need to adjust the backend map depending on which
    RB is enabled.

    Fixes:
    https://bugzilla.redhat.com/show_bug.cgi?id=892233

    Reported-by: Mikko Tiihonen <mikko.tiihonen@iki.fi>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Cc: stable@vger.kernel.org
drm: Import Linux commit f689e3acbd2e48cc4101e0af454193f81af4baaf

Author: Mikko Tiihonen <mikko.tiihonen@iki.fi>
Date:   Wed Jan 30 14:10:04 2013 -0500

    drm/radeon: protect against div by 0 in backend setup

    Make sure at least one RB is enabled in
    r6xx_remap_render_backend() to avoid an division by
    zero in some corner cases.

    See:
    https://bugzilla.redhat.com/show_bug.cgi?id=892233

    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Cc: stable@vger.kernel.org
drm: Import Linux commit 83e68189745ad931c2afd45d8ee3303929233e7f

Author: Matt Fleming <matt.fleming@intel.com>
Date:   Wed Nov 14 09:42:35 2012 +0000

    efi: Make 'efi_enabled' a function to query EFI facilities

    Originally 'efi_enabled' indicated whether a kernel was booted from
    EFI firmware. Over time its semantics have changed, and it now
    indicates whether or not we are booted on an EFI machine with
    bit-native firmware, e.g. 64-bit kernel with 64-bit firmware.

    The immediate motivation for this patch is the bug report at,

        https://bugs.launchpad.net/ubuntu-cdimage/+bug/1040557

    which details how running a platform driver on an EFI machine that is
    designed to run under BIOS can cause the machine to become
    bricked. Also, the following report,

        https://bugzilla.kernel.org/show_bug.cgi?id=47121

    details how running said driver can also cause Machine Check
    Exceptions. Drivers need a new means of detecting whether they're
    running on an EFI machine, as sadly the expression,

        if (!efi_enabled)

    hasn't been a sufficient condition for quite some time.

    Users actually want to query 'efi_enabled' for different reasons -
    what they really want access to is the list of available EFI
    facilities.

    For instance, the x86 reboot code needs to know whether it can invoke
    the ResetSystem() function provided by the EFI runtime services, while
    the ACPI OSL code wants to know whether the EFI config tables were
    mapped successfully. There are also checks in some of the platform
    driver code to simply see if they're running on an EFI machine (which
    would make it a bad idea to do BIOS-y things).

    This patch is a prereq for the samsung-laptop fix patch.

    Cc: David Airlie <airlied@linux.ie>
    Cc: Corentin Chary <corentincj@iksaif.net>
    Cc: Matthew Garrett <mjg59@srcf.ucam.org>
    Cc: Dave Jiang <dave.jiang@intel.com>
    Cc: Olof Johansson <olof@lixom.net>
    Cc: Peter Jones <pjones@redhat.com>
    Cc: Colin Ian King <colin.king@canonical.com>
    Cc: Steve Langasek <steve.langasek@canonical.com>
    Cc: Tony Luck <tony.luck@intel.com>
    Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>
    Cc: Rafael J. Wysocki <rjw@sisk.pl>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Matt Fleming <matt.fleming@intel.com>
    Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
drm: Import Linux commit ed39fadd6df01095378e499fac3674883f16b853

Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Thu Jan 31 09:00:52 2013 -0500

    drm/radeon/evergreen+: wait for the MC to settle after MC blackout

    Some chips seem to need a little delay after blacking out
    the MC before the requests actually stop.

    May fix:
    https://bugs.freedesktop.org/show_bug.cgi?id=56139
    https://bugs.freedesktop.org/show_bug.cgi?id=57567

    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Cc: stable@vger.kernel.org
drm: Import Linux commit 39dc9aabd8708944031e6307819b2a794b841f83

Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Thu Jan 31 09:01:59 2013 -0500

    drm/radeon/r5xx-r7xx: wait for the MC to settle after MC blackout

    Some chips seem to need a little delay after blacking out
    the MC before the requests actually stop. Stop DMAR errors
    reported by Shuah Khan.

    Reported-by: Shuah Khan <shuahkhan@gmail.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>