summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-01-13drm/i915/fbc: make sure we cancel the work function at fbc_disablefbc-2016-01-13Paulo Zanoni1-0/+4
Just to be sure nothing will survive a module unload. We need to do this after the unlock in order to make sure the function won't get stuck trying to grab the lock we already own while we wait for it to finish. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-01-13drm/i915/fbc: rename the FBC disable functionsPaulo Zanoni4-11/+11
Instead of: - intel_fbc_disable_crtc(crtc) - intel_fbc_disable(dev_priv) we now have: - intel_fbc_disable(crtc) - intel_fbc_global_disable(dev_priv) This is because all the other functions that take a CRTC are called - intel_fbc_something(crtc) Instead of: - intel_fbc_something_crtc(crtc) And I also hope that the word "global" is going to help make it more explicit that "global" is the unusual case, not the opposite. Reported-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-01-13drm/i915/fbc: unexport intel_fbc_deactivatePaulo Zanoni2-25/+4
With the addition and usage of intel_fbc_pre_update, intel_fbc_deactivate is not used anymore outside intel_fbc.c, so kill the exported function and rename __intel_fbc_deactivate. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-01-13drm/i915/fbc: fix the FBC state checking codePaulo Zanoni3-24/+28
We'll now call intel_fbc_pre_update instead of intel_fbc_deactivate during atomic commits. This will continue to guarantee that we deactivate FBC and it will also update the state checking structures at the correct time. Then, later, at the point where we were calling intel_fbc_update, we'll only need to call intel_fbc_post_update. Also add the proper warnings in case we don't have the appropriate locks. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-01-13drm/i915/fbc: split intel_fbc_update into pre and post updatePaulo Zanoni1-51/+26
So now pre_update will be responsible for unconditonally deactivating FBC and updating the state cache, while post_update will be responsible for checking if it can be enabled, then enabling it. This is one more step into proper locking. Notice that intel_fbc_flush now calls post_update directly. The FBC flush can only happen for drawing operations - since we explicitly ignore the flips -, so the FBC state is not expected to have changed at this point. So we can just run post_update, which will make sure we won't deactivate+reactivate FBC as would be the case now if we called pre_update + post_update. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-01-13drm/i915/fbc: introduce struct intel_fbc_state_cachePaulo Zanoni2-58/+98
Per the new atomic locking rules, we need to cache the CRTC, plane and FB state structures we use so we can access them later without needing more locks. So do this. Notice that there are some pieces of the FBC code that looks at things that are only computed during the modeset, so we can't just can't precompute whether FBC can be activated during the update_state_cache stage. We may be able to do this later. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-01-13drm/i915/fbc: unconditionally update FBC during atomic commitsPaulo Zanoni1-20/+2
We unconditionally disable/update FBC even during the page flip IOCTls, and an uncoditional disable/update at every atomic commit touching the primary plane shouldn't impact pC state residency noticeably. Besides, the code that checks for rotation is a good hint that we may be forgetting something else, so let's leave all the decisions to intel_fbc.c, making the code much safer. Once we have the code to properly make FBC enable/update decisions based on atomic states, with proper locking, then we'll be able to evaluate whether it will be worth trying to optimize the cases where a disable isn't needed. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-01-13drm/i915/fbc: don't flush for operations on the wrong frontbufferPaulo Zanoni1-8/+11
If frontbuffer_bits doesn't match the current frontbuffer, there's no reason to recompress or update FBC. There was a plan to make the FBC test suite catch this type of problem, but it never got implemented due to being low priority. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-01-13drm/i915/fbc: don't use the frontbuffer tracking subsystem for flipsPaulo Zanoni2-6/+5
Before this patch, page flips would call intel_frontbuffer_flip() and intel_frontbuffer_flip_complete(), which would call intel_fbc_flush(), which would call intel_fbc_update(). The problem is that drawing operations also trigger intel_fbc_flush() calls, so it's not guaranteed that we have the CRTC and FB locks grabbed when intel_fbc_flush() happens, since the call trace may come from the rendering path. We're trying to make the FBC code grab the appropriate CRTC/FB locks, so split the drawing and the flipping logic in order to achieve that in later patches. So now the frontbuffer tracking code is just going to be used for frontbuffer drawing, and intel_fbc_update() is going to be used directly for actual page flips. As a note, we don't need to call intel_fbc_flip() during the two places where we call intel_frontbuffer_flip() since in one of them we already have an intel_fbc_update() call, and in the other we have the planes disabled. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-01-13drm/i915/fbc: replace frequent dev_priv->fbc.x with fbc->xPaulo Zanoni2-109/+132
We say "dev_priv->fbc.something" way too many times in our code while we could be saying just "fbc->something" with a previous declaration of fbc. This has been bothering me for a while but I didn't want to patch it since I wanted to fix the real problems first. But as I add more code I keep thinking about it, especially since it makes the code easier to read and it can make us fit 80 columns easier, so let's just do the change now. While at it, also rename from i915_fbc to intel_fbc because the whole FBC code uses intel_fbc. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-01-11drm/i915/fbc: introduce struct intel_fbc_reg_paramsPaulo Zanoni2-60/+93
The early return inside __intel_fbc_update does not completely check all the parameters that affect the FBC register values. For example, we currently lack looking at crtc->adjusted_y (for the fence Y offset) and all the parameters that affect the CFB size (for i8xx). Instead of just adding the missing parameters to the check and hoping that any changes to the fbc_activate functions also come with a matching change to the __intel_fbc_update check, introduce a new structure where we store these parameters and use the structure at the fbc_activate function. Of course, it's still possible to access everything from dev_priv in those functions, but IMHO the new code will be harder to break. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-01-11drm/i915/fbc: extract intel_fbc_can_enable()Paulo Zanoni1-18/+28
Make our enable/activate checking model more explicit, especially since we now have intel_fbc_can_activate(). Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-01-11drm/i915/fbc: extract intel_fbc_can_activate()Paulo Zanoni1-42/+50
Extract all the code that checks if the FBC configuration is valid to its own function, making __intel_fbc_update() much simpler. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-01-11drm/i915/fbc: wait for a vblank instead of 50ms when enablingPaulo Zanoni2-14/+31
Instead of waiting for 50ms, just wait until the next vblank, since it's the minimum requirement. The whole infrastructure of FBC is based on vblanks, so waiting for X vblanks instead of X milliseconds sounds like the correct way to go. Besides, 50ms may be less than a vblank on super slow modes that may or may not exist. There are some small improvements in PC state residency (due to the fact that we're now using 16ms for the common modes instead of 50ms), but the biggest advantage is still the correctness of being vblank-based instead of time-based. v2: - Rebase after changing the patch order. - Update the commit message. v3: - Fix bogus vblank_get() instead of vblank_count() (Ville). - Don't forget to call drm_crtc_vblank_{get,put} (Chris, Ville) - Adjust the performance details on the commit message. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-01-11drm-intel-nightly: 2016y-01m-11d-07h-30m-16s UTC integration manifestMaarten Lankhorst1-0/+26
2016-01-11Merge remote-tracking branch 'origin/topic/kerneldoc' into drm-intel-nightlyMaarten Lankhorst3-38/+164
2016-01-11Merge remote-tracking branch 'origin/topic/drm-misc' into drm-intel-nightlyMaarten Lankhorst20-373/+279
2016-01-11Merge remote-tracking branch 'sound-upstream/for-next' into drm-intel-nightlyMaarten Lankhorst246-5268/+31974
Conflicts: drivers/gpu/drm/i915/intel_display.c drivers/gpu/drm/i915/intel_pm.c
2016-01-11Merge remote-tracking branch 'drm-upstream/drm-next' into drm-intel-nightlyMaarten Lankhorst637-25061/+78899
Conflicts: drivers/gpu/drm/i915/intel_display.c drivers/gpu/drm/i915/intel_pm.c
2016-01-11Merge remote-tracking branch 'origin/drm-intel-next-queued' into ↵Maarten Lankhorst41-923/+1754
drm-intel-nightly
2016-01-11Merge remote-tracking branch 'origin/drm-intel-next-fixes' into ↵Maarten Lankhorst166-6026/+8186
drm-intel-nightly Conflicts: drivers/gpu/drm/i915/intel_display.c drivers/gpu/drm/i915/intel_hdmi.c drivers/gpu/drm/i915/intel_pm.c
2016-01-11drm/i915: Widen return value for reservation_object_wait_timeout_rcu to long.Maarten Lankhorst1-6/+8
This fixes a spurious warning from an integer overflow on 64-bits systems. The function may return MAX_SCHEDULE_TIMEOUT which gets truncated to -1. Explicitly handling this by casting to lret fixes it. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reported-and-tested-by: Joseph Yasi <joe.yasi@gmail.com> Tested-by: Andreas Reis <andreas.reis@gmail.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: drm-intel-fixes@lists.freedesktop.org Fixes: 3c28ff22f6e20c ("i915: wait for fence in prepare_plane_fb") Link: http://patchwork.freedesktop.org/patch/msgid/5666EEC8.2000403@linux.intel.com
2016-01-11Merge branch 'linux-4.5' of git://github.com/skeggsb/linux into drm-nextDave Airlie141-3704/+4879
- gk20a instmem fixes / improvements - more gm10x vs gm20x differences deal with - better support for high-frequency hdmi modes - pstate control interfaces moved to debugfs - support for pcie link speed changes - misc other fixes across the board * 'linux-4.5' of git://github.com/skeggsb/linux: (50 commits) drm/nouveau/pmu: prevent falcon from acking interrupts routed to the host drm/nouveau/perf: change pcie speed on pstate change drm/nouveau/perf: add fields for pci speed and width and use it for the pstates drm/nouveau/bios/perf: parse the pci speed from the bios for tesla and newer cards drm/nouveau/pci: implement pcie speed change for kepler+ drm/nouveau/pci: implement pcie speed change for Fermi drm/nouveau/pci: implement pcie speed change for tesla drm/nouveau/pci: implement generic code for pcie speed change drm/nouveau/pci: add gk104 variant drm/nouveau/pci: add gf106 variant drm/nouveau/kms: take mode_config mutex in connector hotplug path drm/nouveau/nouveau/perfmon: add interface files for current core voltage drm/nouveau/sysfs: remove pstate interface drm/nouveau/debugfs: add copy of sysfs pstate interface ported to debugfs drm/nouveau/debugfs: we need a ctrl object for debugfs drm/nouveau/debugfs: rename functions to indicate they are used inside drm drm/nouveau/debugfs: add infrastructure to add files with other fops than only read drm/nouveau/fifo/gf100: remove references to "daemon" drm/nouveau/fb/nv50: remove references to "daemon" drm/nouveau/clk: remove references to "daemon" ...
2016-01-11drm/nouveau/pmu: prevent falcon from acking interrupts routed to the hostBen Skeggs5-2266/+2252
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-01-11drm/nouveau/perf: change pcie speed on pstate changeKarol Herbst1-0/+3
v2: remove error and only set link for pcie devices v6: remove check for pcie device Signed-off-by: Karol Herbst <nouveau@karolherbst.de>
2016-01-11drm/nouveau/perf: add fields for pci speed and width and use it for the pstatesKarol Herbst2-0/+5
Signed-off-by: Karol Herbst <nouveau@karolherbst.de>
2016-01-11drm/nouveau/bios/perf: parse the pci speed from the bios for tesla and newer ↵Karol Herbst2-0/+18
cards Signed-off-by: Karol Herbst <nouveau@karolherbst.de>
2016-01-11drm/nouveau/pci: implement pcie speed change for kepler+Karol Herbst1-0/+189
v2: rename functions v3: remove pcie2 accessors v6: fix alignement and line width, also remove useless code Signed-off-by: Karol Herbst <nouveau@karolherbst.de>
2016-01-11drm/nouveau/pci: implement pcie speed change for FermiKarol Herbst3-0/+74
v5: don't set kepler func pointers v6: fix alignment and line length
2016-01-11drm/nouveau/pci: implement pcie speed change for teslaKarol Herbst3-0/+120
v5: don't set fermi or kepler func pointers v6: fix alignment
2016-01-11drm/nouveau/pci: implement generic code for pcie speed changeKarol Herbst5-0/+210
v2: rename and group functions v4: change copyright information move printing of pcie speeds into oneinit, rename all pcie functions to nvkm_pcie_* don't try to raise the pcie version when no higher one is supported v5: revert Copyright changes and rename nvkm_pcie_raise_version to nvkm_pcie_set_version v6: remove some useless pci_is_pcie checks and rework messages Signed-off-by: Karol Herbst <nouveau@karolherbst.de>
2016-01-11drm/nouveau/pci: add gk104 variantKarol Herbst4-10/+51
v2: change email used in header v4: change Copyright information v5: revert Copyright changes Signed-off-by: Karol Herbst <nouveau@karolherbst.de>
2016-01-11drm/nouveau/pci: add gf106 variantKarol Herbst4-5/+46
v2: change email used in header v4: change Copyright information v5: revert Copyright changes Signed-off-by: Karol Herbst <nouveau@karolherbst.de>
2016-01-11drm/nouveau/kms: take mode_config mutex in connector hotplug pathBen Skeggs1-0/+3
fdo#93634 Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Cc: stable@vger.kernel.org
2016-01-11drm/nouveau/nouveau/perfmon: add interface files for current core voltageKarol Herbst2-0/+51
Signed-off-by: Karol Herbst <nouveau@karolherbst.de> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-01-11drm/nouveau/sysfs: remove pstate interfaceKarol Herbst5-225/+0
Signed-off-by: Karol Herbst <nouveau@karolherbst.de> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-01-11drm/nouveau/debugfs: add copy of sysfs pstate interface ported to debugfsKarol Herbst1-2/+138
Signed-off-by: Karol Herbst <nouveau@karolherbst.de> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-01-11drm/nouveau/debugfs: we need a ctrl object for debugfsKarol Herbst4-0/+57
Signed-off-by: Karol Herbst <nouveau@karolherbst.de> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-01-11drm/nouveau/debugfs: rename functions to indicate they are used inside drmKarol Herbst3-8/+9
We will need our own debugfs_init and cleanup functions, because nouveau_drm isn't ready while the DRM ones are called by DRM. Signed-off-by: Karol Herbst <nouveau@karolherbst.de> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-01-11drm/nouveau/debugfs: add infrastructure to add files with other fops than ↵Karol Herbst1-3/+53
only read v2: use the same object for private data as with the drm debugfs functions Signed-off-by: Karol Herbst <nouveau@karolherbst.de> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-01-11drm/nouveau/fifo/gf100: remove references to "daemon"Ben Skeggs1-2/+2
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-01-11drm/nouveau/fb/nv50: remove references to "daemon"Ben Skeggs1-1/+1
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-01-11drm/nouveau/clk: remove references to "daemon"Ben Skeggs4-8/+8
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-01-11drm/nouveau/gr/gf100: provide a bit more info for various errorsIlia Mirkin1-9/+69
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-01-11drm/nouveau/bios: parse 8.1 Gbps DP link rateBen Skeggs1-4/+7
From DCB 4.1 spec. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-01-11drm/nouveau/ltc/gm204: split implementation from gm107Ben Skeggs6-8/+79
Differences from GM10x: - GM20x LTC count detection differs from GM10x - GM20x init doesn't require large page size setting Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-01-11drm/nouveau/ltc/gm107: use nvkm_mask to set cbc_ctrl1Ben Skeggs1-1/+1
resman and nvgpu both do this, presumably for good reason. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-01-11drm/nouveau/ibus/gm204: split implementation from gk104Ben Skeggs6-4/+47
GM20x doesn't require the priv ring timeout bumps that GK/GM10x have. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-01-11drm/nouveau/gr/gf100-: subclass nvkm_object to store channel pointerBen Skeggs1-0/+28
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-01-11drm/nouveau/nvif: modify nvif_unvers/nvif_unpack macros to be more obviousBen Skeggs45-171/+186
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>