aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm
AgeCommit message (Collapse)Author
2016-01-14Merge remote-tracking branch 'lts/linux-3.18.y' into linux-linaro-lsk-v3.18linux-linaro-lsk-v3.18Alex Shi
2015-11-15drm/radeon: don't try to recreate sysfs entries on resumeAlex Deucher
[ Upstream commit 49abb26651167c892393cd9f2ad23df429645ed9 ] Fixes a harmless error message caused by: 51a4726b04e880fdd9b4e0e58b13f70b0a68a7f5 Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-11-15drm/i915: Restore lost DPLL register write on gen2-4Ville Syrjälä
[ Upstream commit 8e7a65aa70bcc1235a44e40ae0da5056525fe081 ] We accidentally lost the initial DPLL register write in 1c4e02746147 drm/i915: Fix DVO 2x clock enable on 830M The "three times for luck" hack probably saved us from a total disaster. But anyway, bring the initial write back so that the code actually makes some sense. Reported-and-tested-by: Nick Bowler <nbowler@draconx.ca> References: http://mid.gmane.org/CAN_QmVyMaArxYgEcVVsGvsMo7-6ohZr8HmF5VhkkL4i9KOmrhw@mail.gmail.com Cc: stable@vger.kernel.org Cc: Nick Bowler <nbowler@draconx.ca> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-11-15drm/nouveau/gem: return only valid domain when there's only oneIlia Mirkin
[ Upstream commit 2a6c521bb41ce862e43db46f52e7681d33e8d771 ] On nv50+, we restrict the valid domains to just the one where the buffer was originally created. However after the buffer is evicted to system memory, we might move it back to a different domain that was not originally valid. When sharing the buffer and retrieving its GEM_INFO data, we still want the domain that will be valid for this buffer in a pushbuf, not the one where it currently happens to be. This resolves fdo#92504 and several others. These are due to suspend evicting all buffers, making it more likely that they temporarily end up in the wrong place. Cc: stable@vger.kernel.org Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92504 Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-11-13drm/radeon: add pm sysfs files lateAlex Deucher
[ Upstream commit 51a4726b04e880fdd9b4e0e58b13f70b0a68a7f5 ] They were added relatively early in the driver init process which meant that in some cases the driver was not finished initializing before external tools tried to use them which could result in a crash depending on the timing. Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-11-13drm/nouveau/fbcon: take runpm reference when userspace has an open fdBen Skeggs
[ Upstream commit f231976c2e8964ceaa9250e57d27c35ff03825c2 ] We need to do this in order to prevent accesses to the device while it's powered down. Userspace may have an mmap of the fb, and there's no good way (that I know of) to prevent it from touching the device otherwise. This fixes some nasty races between runpm and plymouth on some systems, which result in the GPU getting very upset and hanging the boot. Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-11-04Merge tag 'v3.18.24' of ↵Kevin Hilman
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable into linux-linaro-lsk-v3.18 Linux 3.18.24 # gpg: Signature made Sat Oct 31 13:44:30 2015 PDT using RSA key ID 97772CDC # gpg: Can't check signature: public key not found * tag 'v3.18.24' of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable: (234 commits) Linux 3.18.24 tty: fix stall caused by missing memory barrier in drivers/tty/n_tty.c Revert "tty: fix stall caused by missing memory barrier in drivers/tty/n_tty.c" Linux 3.18.23 x86: Init per-cpu shadow copy of CR4 on 32-bit CPUs too 3w-9xxx: don't unmap bounce buffered commands fib_rules: Fix dump_rules() not to exit early vfs: Test for and handle paths that are unreachable from their mnt_root md: flush ->event_work before stopping array. x86/nmi/64: Fix a paravirt stack-clobbering bug in the NMI code Revert "iio: bmg160: IIO_BUFFER and IIO_TRIGGERED_BUFFER are required" net: Fix skb_set_peeked use-after-free bug mm: check if section present during memory block registering hpfs: update ctime and mtime on directory modification drivercore: Fix unregistration path of platform devices ARM: OMAP2+: DRA7: clockdomain: change l4per2_7xx_clkdm to SW_WKUP of/address: Don't loop forever in of_find_matching_node_by_address(). auxdisplay: ks0108: fix refcount Doc: ABI: testing: configfs-usb-gadget-sourcesink Doc: ABI: testing: configfs-usb-gadget-loopback ...
2015-10-27drm/qxl: validate monitors config modesJonathon Jongsma
[ Upstream commit bd3e1c7c6de9f5f70d97cdb6c817151c0477c5e3 ] Due to some recent changes in drm_helper_probe_single_connector_modes_merge_bits(), old custom modes were not being pruned properly. In current kernels, drm_mode_validate_basic() is called to sanity-check each mode in the list. If the sanity-check passes, the mode's status gets set to to MODE_OK. In older kernels this check was not done, so old custom modes would still have a status of MODE_UNVERIFIED at this point, and would therefore be pruned later in the function. As a result of this new behavior, the list of modes for a device always includes every custom mode ever configured for the device, with the largest one listed first. Since desktop environments usually choose the first preferred mode when a hotplug event is emitted, this had the result of making it very difficult for the user to reduce the size of the display. The qxl driver did implement the mode_valid connector function, but it was empty. In order to restore the old behavior where old custom modes are pruned, we implement a proper mode_valid function for the qxl driver. This function now checks each mode against the last configured custom mode and the list of standard modes. If the mode doesn't match any of these, its status is set to MODE_BAD so that it will be pruned as expected. Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-10-27drm/amdgpu: Don't link train DisplayPort on HPD until we get the dpcdStephen Chandler Paul
[ Upstream commit a887adadb7b9ef9eb4ee48e4ad575aefcfd1db14 ] This is a port of: DRM - radeon: Don't link train DisplayPort on HPD until we get the dpcd to amdgpu. Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-10-27drm/amdgpu: Restore LCD backlight level on resumeMichel Dänzer
[ Upstream commit 74b3112e95073b351e3b0b9799795bc76f8415fa ] Instead of only enabling the backlight (which seems to set it to max brightness), just re-set the current backlight level, which also takes care of enabling the backlight if necessary. Port of radeon commit: drm/radeon: Restore LCD backlight level on resume (>= R5xx) Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-10-27drm: Reject DRI1 hw lock ioctl functions for kms driversDaniel Vetter
[ Upstream commit da168d81b44898404d281d5dbe70154ab5f117c1 ] I've done some extensive history digging across libdrm, mesa and xf86-video-{intel,nouveau,ati}. The only potential user of this with kms drivers I could find was ttmtest, which once used drmGetLock still. But that mistake was quickly fixed up. Even the intel xvmc library (which otherwise was really good with using dri1 stuff in kms mode) managed to never take the hw lock for dri2 (and hence kms). Hence it should be save to unconditionally disallow this. Cc: Peter Antoine <peter.antoine@intel.com> Reviewed-by: Peter Antoine <peter.antoine@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-10-27drm/i915/bios: handle MIPI Sequence Block v3+ gracefullyJani Nikula
[ Upstream commit cd67d226ebd909d239d2c6e5a6abd6e2a338d1cd ] The VBT MIPI Sequence Block version 3 has forward incompatible changes: First, the block size in the header has been specified reserved, and the actual size is a separate 32-bit value within the block. The current find_section() function to will only look at the size in the block header, and, depending on what's in that now reserved size field, continue looking for other sections in the wrong place. Fix this by taking the new block size field into account. This will ensure that the lookups for other sections will work properly, as long as the new 32-bit size does not go beyond the opregion VBT mailbox size. Second, the contents of the block have been completely changed. Gracefully refuse parsing the yet unknown data version. Cc: Deepak M <m.deepak@intel.com> Cc: stable@vger.kernel.org Reviewed-by: Deepak M <m.deepak@intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-10-27drm/qxl: recreate the primary surface when the bo is not primaryFabiano Fidêncio
[ Upstream commit 8d0d94015e96b8853c4f7f06eac3f269e1b3d866 ] When disabling/enabling a crtc the primary area must be updated independently of which crtc has been disabled/enabled. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1264735 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-10-27drm/qxl: only report first monitor as connected if we have no stateDave Airlie
[ Upstream commit 69e5d3f893e19613486f300fd6e631810338aa4b ] If the server isn't new enough to give us state, report the first monitor as always connected, otherwise believe the server side. Cc: stable@vger.kernel.org Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-10-13Merge tag 'v3.18.22' of ↵Kevin Hilman
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable into linux-linaro-lsk-v3.18 Linux 3.18.22 * tag 'v3.18.22' of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable: (178 commits) Linux 3.18.22 net: call rcu_read_lock early in process_backlog lpfc: Fix scsi prep dma buf error. rds: fix an integer overflow test in rds_info_getsockopt() net/mlx4_core: Fix wrong index in propagating port change event to VFs netlink: don't hold mutex in rcu callback when releasing mmapd ring inet: frags: fix defragmented packet's IP header for af_packet bonding: correct the MAC address for "follow" fail_over_mac policy bonding: fix destruction of bond with devices different from arphrd_ether ipv6: lock socket in ip6_datagram_connect() isdn/gigaset: reset tty->receive_room when attaching ser_gigaset bridge: mdb: fix double add notification net: Fix skb csum races when peeking net: do not process device backlog during unregistration net: pktgen: fix race between pktgen_thread_worker() and kthread_stop() bridge: mdb: zero out the local br_ip variable before use net/tipc: initialize security state for new connection socket ip_tunnel: fix ipv4 pmtu check to honor inner ip header df net: graceful exit from netif_alloc_netdev_queues() ipv6: Make MLD packets to only be processed locally ...
2015-10-07Add radeon suspend/resume quirk for HP Compaq dc5750.Jeffery Miller
[ Upstream commit 09bfda10e6efd7b65bcc29237bee1765ed779657 ] With the radeon driver loaded the HP Compaq dc5750 Small Form Factor machine fails to resume from suspend. Adding a quirk similar to other devices avoids the problem and the system resumes properly. Signed-off-by: Jeffery Miller <jmiller@neverware.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-09-27drm/radeon: fix hotplug race at startupDave Airlie
[ Upstream commit 7f98ca454ad373fc1b76be804fa7138ff68c1d27 ] We apparantly get a hotplug irq before we've initialised modesetting, [drm] Loading R100 Microcode BUG: unable to handle kernel NULL pointer dereference at (null) IP: [<c125f56f>] __mutex_lock_slowpath+0x23/0x91 *pde = 00000000 Oops: 0002 [#1] Modules linked in: radeon(+) drm_kms_helper ttm drm i2c_algo_bit backlight pcspkr psmouse evdev sr_mod input_leds led_class cdrom sg parport_pc parport floppy intel_agp intel_gtt lpc_ich acpi_cpufreq processor button mfd_core agpgart uhci_hcd ehci_hcd rng_core snd_intel8x0 snd_ac97_codec ac97_bus snd_pcm usbcore usb_common i2c_i801 i2c_core snd_timer snd soundcore thermal_sys CPU: 0 PID: 15 Comm: kworker/0:1 Not tainted 4.2.0-rc7-00015-gbf67402 #111 Hardware name: MicroLink /D850MV , BIOS MV85010A.86A.0067.P24.0304081124 04/08/2003 Workqueue: events radeon_hotplug_work_func [radeon] task: f6ca5900 ti: f6d3e000 task.ti: f6d3e000 EIP: 0060:[<c125f56f>] EFLAGS: 00010282 CPU: 0 EIP is at __mutex_lock_slowpath+0x23/0x91 EAX: 00000000 EBX: f5e900fc ECX: 00000000 EDX: fffffffe ESI: f6ca5900 EDI: f5e90100 EBP: f5e90000 ESP: f6d3ff0c DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068 CR0: 8005003b CR2: 00000000 CR3: 36f61000 CR4: 000006d0 Stack: f5e90100 00000000 c103c4c1 f6d2a5a0 f5e900fc f6df394c c125f162 f8b0faca f6d2a5a0 c138ca00 f6df394c f7395600 c1034741 00d40000 00000000 f6d2a5a0 c138ca00 f6d2a5b8 c138ca10 c1034b58 00000001 f6d40000 f6ca5900 f6d0c940 Call Trace: [<c103c4c1>] ? dequeue_task_fair+0xa4/0xb7 [<c125f162>] ? mutex_lock+0x9/0xa [<f8b0faca>] ? radeon_hotplug_work_func+0x17/0x57 [radeon] [<c1034741>] ? process_one_work+0xfc/0x194 [<c1034b58>] ? worker_thread+0x18d/0x218 [<c10349cb>] ? rescuer_thread+0x1d5/0x1d5 [<c103742a>] ? kthread+0x7b/0x80 [<c12601c0>] ? ret_from_kernel_thread+0x20/0x30 [<c10373af>] ? init_completion+0x18/0x18 Code: 42 08 e8 8e a6 dd ff c3 57 56 53 83 ec 0c 8b 35 48 f7 37 c1 8b 10 4a 74 1a 89 c3 8d 78 04 8b 40 08 89 63 Reported-and-Tested-by: Meelis Roos <mroos@linux.ee> Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-09-16drm/vmwgfx: Fix execbuf locking issuesThomas Hellstrom
[ Upstream commit 3e04e2fe6d87807d27521ad6ebb9e7919d628f25 ] This addresses two issues that cause problems with viewperf maya-03 in situation with memory pressure. The first issue causes attempts to unreserve buffers if batched reservation fails due to, for example, a signal pending. While previously the ttm_eu api was resistant against this type of error, it is no longer and the lockdep code will complain about attempting to unreserve buffers that are not reserved. The issue is resolved by avoid calling ttm_eu_backoff_reservation in the buffer reserve error path. The second issue is that the binding_mutex may be held when user-space fence objects are created and hence during memory reclaims. This may cause recursive attempts to grab the binding mutex. The issue is resolved by not holding the binding mutex across fence creation and submission. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Sinclair Yeh <syeh@vmware.com> Cc: <stable@vger.kernel.org> Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-08-19drm/dp-mst: Remove debug WARN_ONDaniel Vetter
[ Upstream commit 42639ba554655c280ae6cb72df0522b1201f2961 ] Apparently been in there since forever and fairly easy to hit when hotplugging really fast. I can do that since my mst hub has a manual button to flick the hpd line for reprobing. The resulting WARNING spam isn't pretty. Cc: Dave Airlie <airlied@gmail.com> Cc: stable@vger.kernel.org Reviewed-by: Thierry Reding <treding@nvidia.com> Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-08-19drm/radeon/combios: add some validation of lvds valuesAlex Deucher
[ Upstream commit 0a90a0cff9f429f886f423967ae053150dce9259 ] Fixes a broken hsync start value uncovered by: abc0b1447d4974963548777a5ba4a4457c82c426 (drm: Perform basic sanity checks on probed modes) The driver handled the bad hsync start elsewhere, but the above commit prevented it from getting added. bug: https://bugs.freedesktop.org/show_bug.cgi?id=91401 Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-08-19drm/i915: Replace WARN inside I915_READ64_2x32 with retry loopChris Wilson
[ Upstream commit ee0a227b7ac6e75f28e10269f81c7ec6eb600952 ] Since we may conceivably encounter situations where the upper part of the 64bit register changes between reads, for example when a timestamp counter overflows, change the WARN into a retry loop. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Michał Winiarski <michal.winiarski@intel.com> Cc: stable@vger.kernel.org Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-08-10Merge tag 'v3.18.20' into linux-linaro-lsk-v3.18Kevin Hilman
Linux 3.18.20 * tag 'v3.18.20': (52 commits) Linux 3.18.20 blk-mq: fix CPU hotplug handling SCSI: add 1024 max sectors black list flag Fix firmware loader uevent buffer NULL pointer dereference arm64: Don't report clear pmds and puds as huge 9p: don't leave a half-initialized inode sitting around 9p: forgetting to cancel request on interrupted zero-copy RPC NFS: Fix size of NFSACL SETACL operations watchdog: omap: assert the counter being stopped before reprogramming of: return NUMA_NO_NODE from fallback of_node_to_nid() USB: usbfs: allow URBs to be reaped after disconnection dell-laptop: Fix allocating & freeing SMI buffer page mac80211: prevent possible crypto tx tailroom corruption security_syslog() should be called once only __bitmap_parselist: fix bug in empty string handling mmc: card: Fixup request missing in mmc_blk_issue_rw_rq iser-target: Fix possible deadlock in RDMA_CM connection error iscsi-target: Convert iscsi_thread_set usage to kthread.h ACPICA: Tables: Fix an issue that FACS initialization is performed twice Btrfs: fix memory leak in the extent_same ioctl ...
2015-08-04Merge tag 'v3.18.19' of ↵Kevin Hilman
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable into linux-linaro-lsk-v3.18 Linux 3.18.19 * tag 'v3.18.19' of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable: (237 commits) Linux 3.18.19 x86/xen: allow privcmd hypercalls to be preempted rtnl: restore notifications for deleted interfaces Input: synaptics - add min/max quirk for Lenovo S540 Revert "Input: synaptics - add min/max quirk for Lenovo S540" Revert "nfs: take extra reference to fl->fl_file when running a LOCKU operation" fs/ufs: restore s_lock mutex_init() ufs: Fix possible deadlock when looking up directories ufs: Fix warning from unlock_new_inode() vfs: Ignore unlocked mounts in fs_fully_visible KVM: x86: properly restore LVT0 KVM: s390: virtio-ccw: don't overwrite config space values selinux: fix setting of security labels on NFS usb: gadget: f_fs: add extra check before unregister_gadget_item perf/x86: Honor the architectural performance monitoring version perf: Fix ring_buffer_attach() RCU sync, again x86/boot: Fix overflow warning with 32-bit binutils vfs: Remove incorrect debugging WARN in prepend_path KVM: x86: make vapics_in_nmi_mode atomic arm: KVM: force execution of HCPTR access on VM exit ...
2015-08-04drm: add a check for x/y in drm_mode_setcrtcZhao Junwang
[ Upstream commit 01447e9f04ba1c49a9534ae6a5a6f26c2bb05226 ] legacy setcrtc ioctl does take a 32 bit value which might indeed overflow the checks of crtc_req->x > INT_MAX and crtc_req->y > INT_MAX aren't needed any more with this v2: -polish the annotation according to Daniel's comment Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Zhao Junwang <zhjwpku@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-08-04drm/radeon: add a dpm quirk for Sapphire Radeon R9 270X 2GB GDDR5Alex Deucher
[ Upstream commit 5dfc71bc44d91d1620505c064fa22b0b3db58a9d ] bug: https://bugs.freedesktop.org/show_bug.cgi?id=76490 Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-07-05drm/radeon: SDMA fix hibernation (CI GPU family).Jérôme Glisse
[ Upstream commit 2ba8d1bb8f6b589037f7db1f01144fc80750e8f7 ] In order for hibernation to reliably work we need to properly turn off the SDMA block, sadly after numerous attemps i haven't not found proper sequence for clean and full shutdown. So simply reset both SDMA block, this makes hibernation works reliably on sea island GPU family (CI) Hibernation and suspend to ram were tested (several times) on : Bonaire Hawaii Mullins Kaveri Kabini Cc: stable@vger.kernel.org Signed-off-by: Jérôme Glisse <jglisse@redhat.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-07-05drm/radeon: compute ring fix hibernation (CI GPU family) v2.Jérôme Glisse
[ Upstream commit 161569deaa03cf3c00ed63352006193f250b0648 ] In order for hibernation to reliably work we need to cleanup more thoroughly the compute ring. Hibernation is different from suspend resume as when we resume from hibernation the hardware is first fully initialize by regular kernel then freeze callback happens (which correspond to a suspend inside the radeon kernel driver) and turn off each of the block. It turns out we were not cleanly shutting down the compute ring. This patch fix that. Hibernation and suspend to ram were tested (several times) on : Bonaire Hawaii Mullins Kaveri Kabini Changed since v1: - Factor the ring stop logic into a function taking ring as arg. Cc: stable@vger.kernel.org Signed-off-by: Jérôme Glisse <jglisse@redhat.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-07-05drm/dp/mst: take lock around looking up the branch device on hpd irqDave Airlie
[ Upstream commit 9eb1e57f564d4e6e10991402726cc83fe0b9172f ] If we are doing an MST transaction and we've gotten HPD and we lookup the device from the incoming msg, we should take the mgr lock around it, so that mst_primary and mstb->ports are valid. Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: stable@vger.kernel.org Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-07-05drm/dp/mst: make sure mst_primary mstb is valid in work functionDaniel Vetter
[ Upstream commit 9254ec496a1dbdddeab50021a8138dc627a8166a ] This validates the mst_primary under the lock, and then calls into the check and send function. This makes the code a lot easier to understand the locking rules in. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: stable@vger.kernel.org Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-07-03drm/qxl: Do not leak memory if qxl_release_list_add failsFrediano Ziglio
[ Upstream commit 8451cc964c1d193b989c41a44e5e77109cc696f8 ] If the function fails reference counter to the object is not decremented causing leaks. This is hard to spot as it happens only on very low memory situations. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Cc: stable@vger.kernel.org Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-07-03drm/qxl: Do not cause spice-server to clean our objectsFrediano Ziglio
[ Upstream commit 2fa19535ca6abcbfd1ccc9ef694db52f49f77747 ] If objects are moved back from system memory to VRAM (and spice id created again) memory is already initialized so we need to set flag to not clear memory. If you don't do it after a while using desktop many images turns to black or transparents. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Cc: stable@vger.kernel.org Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-07-03drm/radeon: take the mode_config mutex when dealing with hpds (v2)Alex Deucher
[ Upstream commit 39fa10f7e21574a70cecf1fed0f9b36535aa68a0 ] Since we are messing with state in the worker. v2: drop the changes in the mst worker Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-07-03Revert "drm/radeon: adjust pll when audio is not enabled"Alex Deucher
[ Upstream commit ebb9bf18636926d5da97136c22e882c5d91fda73 ] This reverts commit 7fe04d6fa824ccea704535a597dc417c8687f990. Fixes some systems at the expense of others. Need to properly fix the pll divider selection. bug: https://bugzilla.kernel.org/show_bug.cgi?id=99651 Cc: stable@vger.kernel.org Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-07-03Revert "drm/radeon: don't share plls if monitors differ in audio support"Alex Deucher
[ Upstream commit 6fb3c025fee16f11ebd73f84f5aba1ee9ce7f8c6 ] This reverts commit a10f0df0615abb194968fc08147f3cdd70fd5aa5. Fixes some systems at the expense of others. Need to properly fix the pll divider selection. bug: https://bugzilla.kernel.org/show_bug.cgi?id=99651 Cc: stable@vger.kernel.org Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-07-03drm/radeon: fix freeze for laptop with Turks/Thames GPU.Jérôme Glisse
[ Upstream commit 6dfd197283bffc23a2b046a7f065588de7e1fc1e ] Laptop with Turks/Thames GPU will freeze if dpm is enabled. It seems the SMC engine is relying on some state inside the CP engine. CP needs to chew at least one packet for it to get in good state for dynamic power management. This patch simply disabled and re-enable DPM after the ring test which is enough to avoid the freeze. Signed-off-by: Jérôme Glisse <jglisse@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-07-03drm/i915: Fix DDC probe for passive adaptersJani Nikula
[ Upstream commit 3f5f1554ee715639e78d9be87623ee82772537e0 ] Passive DP->DVI/HDMI dongles on DP++ ports show up to the system as HDMI devices, as they do not have a sink device in them to respond to any AUX traffic. When probing these dongles over the DDC, sometimes they will NAK the first attempt even though the transaction is valid and they support the DDC protocol. The retry loop inside of drm_do_probe_ddc_edid() would normally catch this case and try the transaction again, resulting in success. That, however, was thwarted by the fix for [1]: commit 9292f37e1f5c79400254dca46f83313488093825 Author: Eugeni Dodonov <eugeni.dodonov@intel.com> Date: Thu Jan 5 09:34:28 2012 -0200 drm: give up on edid retries when i2c bus is not responding This added code to exit immediately if the return code from the i2c_transfer function was -ENXIO in order to reduce the amount of time spent in waiting for unresponsive or disconnected devices. That was possible because the underlying i2c bit banging algorithm had retries of its own (which, of course, were part of the reason for the bug the commit fixes). Since its introduction in commit f899fc64cda8569d0529452aafc0da31c042df2e Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Tue Jul 20 15:44:45 2010 -0700 drm/i915: use GMBUS to manage i2c links we've been flipping back and forth enabling the GMBUS transfers, but we've settled since then. The GMBUS implementation does not do any retries, however, bailing out of the drm_do_probe_ddc_edid() retry loop on first encounter of -ENXIO. This, combined with Eugeni's commit, broke the retry on -ENXIO. Retry GMBUS once on -ENXIO on first message to mitigate the issues with passive adapters. This patch is based on the work, and commit message, by Todd Previte <tprevite@gmail.com>. [1] https://bugs.freedesktop.org/show_bug.cgi?id=41059 v2: Don't retry if using bit banging. v3: Move retry within gmbux_xfer, retry only on first message. v4: Initialize GMBUS0 on retry (Ville). v5: Take index reads into account (Ville). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85924 Cc: Todd Previte <tprevite@gmail.com> Cc: stable@vger.kernel.org Tested-by: Oliver Grafe <oliver.grafe@ge.com> (v2) Tested-by: Jim Bride <jim.bride@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-07-03drm/i915/hsw: Fix workaround for server AUX channel clock divisorJim Bride
[ Upstream commit e058c945e03a629c99606452a6931f632dd28903 ] According to the HSW b-spec we need to try clock divisors of 63 and 72, each 3 or more times, when attempting DP AUX channel communication on a server chipset. This actually wasn't happening due to a short-circuit that only checked the DP_AUX_CH_CTL_DONE bit in status rather than checking that the operation was done and that DP_AUX_CH_CTL_TIME_OUT_ERROR was not set. [v2] Implemented alternate solution suggested by Jani Nikula. Cc: stable@vger.kernel.org Signed-off-by: Jim Bride <jim.bride@linux.intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-07-03drm/radeon: partially revert "fix VM_CONTEXT*_PAGE_TABLE_END_ADDR handling"Christian König
[ Upstream commit 7c0411d2fabc2e2702c9871ffb603e251158b317 ] We have that bug for years and some users report side effects when fixing it on older hardware. So revert it for VM_CONTEXT0_PAGE_TABLE_END_ADDR, but keep it for VM 1-15. Signed-off-by: Christian König <christian.koenig@amd.com> CC: stable@vger.kernel.org Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-07-03drm/radeon: fix VM_CONTEXT*_PAGE_TABLE_END_ADDR handlingChristian König
[ Upstream commit 607d48063512707a414e346972e2210dc71ab491 ] The mapping range is inclusive between starting and ending addresses. Signed-off-by: Christian König <christian.koenig@amd.com> CC: stable@vger.kernel.org Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-07-03drm/radeon: reset BOs address after clearing it.Christian König
[ Upstream commit 48afbd70ac7b6aa62e8d452091023941d8085f8a ] Otherwise it is possible that we will have page table corruption if we change a BOs address multiple times. Signed-off-by: Christian König <christian.koenig@amd.com> CC: stable@vger.kernel.org Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-07-03drm/radeon: fix lockup when BOs aren't part of the VM on releaseChristian König
[ Upstream commit 26d4d129b6042197b4cbc8341c0618f99231af2f ] If we unmap BOs before releasing them them the intervall tree locks up because we try to remove an entry not inside the tree. Based on a patch from Michel Dänzer. Signed-off-by: Christian König <christian.koenig@amd.com> CC: stable@vger.kernel.org Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-07-01drm/radeon: Add RADEON_INFO_VA_UNMAP_WORKING queryMichel Dänzer
[ Upstream commit 3bc980bf19bb62007e923691fa2869ba113be895 ] This tells userspace that it's safe to use the RADEON_VA_UNMAP operation of the DRM_RADEON_GEM_VA ioctl. Cc: stable@vger.kernel.org (NOTE: Backporting this commit requires at least backports of commits 26d4d129b6042197b4cbc8341c0618f99231af2f, 48afbd70ac7b6aa62e8d452091023941d8085f8a and c29c0876ec05d51a93508a39b90b92c29ba6423d as well, otherwise using RADEON_VA_UNMAP runs into trouble) Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Christian König <christian.koenig@amd.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-07-01drm/mgag200: Reject non-character-cell-aligned mode widthsAdam Jackson
[ Upstream commit 25161084b1c1b0c29948f6f77266a35f302196b7 ] Turns out 1366x768 does not in fact work on this hardware. Signed-off-by: Adam Jackson <ajax@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-06-28drm/i915: Make sample_c messages go faster on Haswell.Kenneth Graunke
[ Upstream commit 944115934436b1ff6cf773a9e9123858ea9ef3da ] Haswell significantly improved the performance of sampler_c messages, but the optimization appears to be off by default. Later platforms remove this bit, and apparently always enable the optimization. Improves performance in "Counter Strike: Global Offensive" by 18% at default settings on Iris Pro. This may break sampling of paletted formats (P8/A8P8/P8A8). It's unclear whether it affects sampling of paletted formats in general, or just the sample_c message (which is never used). While libva does have support for using paletted formats (primarily for OSDs), that support appears to have been broken for at least a year, so I couldn't observe a regression from this: I tried to get libva-intel to use paletted formats, and observe a regression...but the only thing I found that used it was mplayer's OSD (on screen display). Even without my patch, the colors were totally wrong with that, and it's according to a few distro wikis, that's been the case for over a year. If libva's code for paletted formats /is/ broken, they could always add code to disable this bit using the command validator when fixing it. Further investigation from Haihao shows that libva mplayer OSD seems to work at least on his setup (still unclear what's wron with Ken's), and that it's not affected by this patch. Quoting the discussion between Haihao and Ken: > > > If you use "-vo gl" or "-vo xv", the OSD is solid white text with a black > > > border around it. I presume that it's supposed to be white with vaapi as > > > well, but I guess I'm not entirely sure. > > > > > > It's possible that the optimization doesn't affect the palette as long as > > > you never use sample_c with the paletted textures. > > > > I verified the palette takes effect in the following way: > > > > 1. Only support P8A8 format in the driver > > > > 2. ran the above command and I saw white OSD text > > > > 3. Only support P4A4 format in the driver and don't use > > 3DSTATE_SAMPLER_PALETTE_LOAD0 to load the value to the texture palette, > > so the palette keeps unchanged. > > > > 4. ran the above command and I saw black OSD text. > > > > 5. Load the right value to the texture palette and ran the above command > > again, I saw white OSD text. > > > > Hence I think sample_c with the paletted textures is used in the driver. > > That sounds like the palette is actually working, then. Great :) > > I doubt that libva would use sample_c - sampling with a shadow comparison? > It looks like it just uses sample and sample+killpix. You are right, libva driver doesn't use sample_c message. > I'm pretty sure the sample_c optimization just uses the palette memory as > storage for some stuff, so it's quite possible it just works if you're > only using sample and sample+killpix. Thanks for the explanation, it makes sense to me. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> [danvet: Add wa name from Ville's review to the comment and copypaste the explanation why we don't care about libva (already broken) from Ken. Also add conclusion from libva devs that&why this is all fine.] Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: "Xiang, Haihao" <haihao.xiang@intel.com> Cc: libva@lists.freedesktop.org Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-06-15Merge branch 'v3.18/topic/thermal' into linux-linaro-lsk-v3.18Kevin Hilman
* v3.18/topic/thermal: (66 commits) thermal: exynos: fix compile error in _zone_bind_cooling_device() thermal: of-thermal: add support for reading coefficients property thermal: support slope and offset coefficients thermal: power_allocator: round the division when divvying up power kernel.h: implement DIV_ROUND_CLOSEST_ULL thermal: cpu_cooling: Fix power calculation when CPUs are offline thermal: cpu_cooling: Remove cpu_dev update on policy CPU update thermal: Default OF created trip points to writable thermal: export thermal_zone_parameters to sysfs thermal: core: Add Kconfig option to enable writable trips of: thermal: Introduce sustainable power for a thermal zone thermal: add trace events to the power allocator governor thermal: introduce the Power Allocator governor thermal: cpu_cooling: implement the power cooling device API thermal: extend the cooling device API to include power information thermal: let governors have private data for each thermal zone thermal: fair_share: generalize the weight concept thermal: export weight to sysfs thermal: fair_share: use the weight from the thermal instance thermal: of: fix cooling device weights in device tree ...
2015-06-10drm/radeon: partially revert "fix VM_CONTEXT*_PAGE_TABLE_END_ADDR handling"Christian König
[ Upstream commit 7c0411d2fabc2e2702c9871ffb603e251158b317 ] We have that bug for years and some users report side effects when fixing it on older hardware. So revert it for VM_CONTEXT0_PAGE_TABLE_END_ADDR, but keep it for VM 1-15. Signed-off-by: Christian König <christian.koenig@amd.com> CC: stable@vger.kernel.org Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-06-10drm/radeon: don't share plls if monitors differ in audio supportAlex Deucher
[ Upstream commit a10f0df0615abb194968fc08147f3cdd70fd5aa5 ] Enabling audio may enable different pll dividers. Don't share plls if the monitors differ in audio support. bug: https://bugzilla.kernel.org/show_bug.cgi?id=98751 Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-06-10drm/radeon: retry dcpd fetchAlex Deucher
[ Upstream commit 0f28d1281b6c54cc98746ae61e44e7f540758ed4 ] Retry the dpcd fetch several times. Some eDP panels fail several times before the fetch is successful. bug: https://bugs.freedesktop.org/show_bug.cgi?id=73530 Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-06-10drm/radeon: fix VM_CONTEXT*_PAGE_TABLE_END_ADDR handlingChristian König
[ Upstream commit 607d48063512707a414e346972e2210dc71ab491 ] The mapping range is inclusive between starting and ending addresses. Signed-off-by: Christian König <christian.koenig@amd.com> CC: stable@vger.kernel.org Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-06-09drm/radeon: more strictly validate the UVD codecChristian König
[ Upstream commit d52cdfa4a0c6406bbfb33206341eaf1fb1555994 ] MPEG 2/4 are only supported since UVD3. Signed-off-by: Christian König <christian.koenig@amd.com> CC: stable@vger.kernel.org Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>