summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-06-03Properly cleanup fb for reverse-prime-offloadHEADmasterHans de Goede1-1/+7
drmmode_set_scanout_pixmap(pix) adds drmmod->fb_id through a call to drmmode_xf86crtc_resize(), but on a subsequent drmmode_set_scanout_pixmap(NULL) it would not remove the fb. This keeps the crtc marked as busy, which causes the dgpu to not being able to runtime suspend, after an output attached to the dgpu has been used once. Which causes burning through an additional 10W of power and the laptop to run quite hot. This commit adds the missing remove fb call, allowing the dgpu to runtime suspend after an external monitor has been plugged into the laptop. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-06-02exa/nv50-: fix some potential incomplete pushesBen Skeggs2-46/+50
I don't think these should actually be able to happen, given that we already reject the unknown formats in the Check() functions. But, just in case... Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-06-02fix use of out-of-scope dataBen Skeggs1-17/+21
Reported by Coverity. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-01-13HAS_DIRTYTRACKING_ROTATION also supports multiple CRTCsIlia Mirkin1-1/+1
A port of commit ff9a6b6f from xf86-video-ati. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93670 Reported-by: Thomas D. <thfrdue@gmx.de> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-12-08Bump version to 1.0.12Ben Skeggs1-1/+1
Various random fixes have been pending for a long while now... Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-11-17Take shift in crtc positions for ZaphodHeads configs into account.Mario Kleiner1-4/+6
In multi-x-screen ZaphodHeads configurations, there isn't a one-to-one mapping of kernel provided drmmode crtc index to the index of the corresponding xf86Crtc inside the xf86CrtcConfig crtc array anymore, ie. for kernel provided drmmode->mode_res->crtcs[i], the i'th crtc won't correspond to the xf86Crtc in the i'th slot of the x-screens xf86CrtcConfig anymore, once ZaphodHeads has only selected a subset of all crtcs of a graphics card for a given x-screen, instead of all crtcs. This breaks the mapping of bit positions in the bit masks returned in kencoder->possible_crtcs and kencoder->possible_clones. A 1 bit in position i of those masks allows use of the kernels i'th crtc for the given kencoder. The X-Servers dix code checks those bit masks for valid xf86Output -> xf86Crtc assignments, assuming that the i'th slot xf86CrtcConfigPtr config->crtc[i] corresponds to bit i in the xf86Output->possibe_crtcs bitmask, and bails if the bitmask doesn't allow the specified assignment of crtc to output. If ZaphodHeads breaks the assumption of bit i <-> crtc slot i this ends in failure. Take this shift of crtc index positions wrt. encoder bitmask bit positions into account by bit-shifting positions accordingly when assigning encoder->possible_crtcs to output->possible_crtcs, so the proper indices match up again for validation by the dix. This problem wasn't apparent last year when testing the ZaphodHeads support on some Kepler cards, as apparently the encoder->possible_crtcs bitmasks returned for those cards by the kernel just had all 4 lsb bits set for all tested encoders/output, so each of the cards 4 crtcs could go with each output and things worked by chance. The current code breaks, e.g., on 2010 MacBookPro with nv50, where one crtc is hardwired to the internal lvds panel, and one crtc is hardwired to the external DP connector, resulting in a failure where dual-display on single-x-screen works fine, but assigning each output to a separate x-screen via ZaphodHeads fails due to the mismatched encoder->possible_crtcs bitmasks. This patch fixes the problem. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-09-13fix build after glamor removalIlia Mirkin2-10/+3
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-09-13xv: use correct max width/height settingsIlia Mirkin3-5/+8
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70931 Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-09-13remove maxwell GM10x support for nowIlia Mirkin1-2/+1
There is no EXA acceleration, and now no GLAMOR either. User is better off with modesetting until EXA makes an appearance. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-09-13glamor: removeIlia Mirkin11-364/+3
If you want glamor, just use modesetting instead. It's hooked up incorrectly in nouveau, and there doesn't seem to be any point in fixing it when the modesetting driver does it all properly. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-08-03Add Option "DRI" to allow selection of maximum DRI level. (v2)Mario Kleiner6-4/+48
Allow user to select the maximum level of DRI implementation to use, DRI2 or DRI3. exa accel supports both DRI2 and, if the kernel supports rendernodes, also DRI3. However, DRI3 still seems to have some bugs on current implementations, and additionally it doesn't work well at all for X-Servers older than 1.16.3 due to X-Server bugs. Therefore we default to DRI2 on exa, but allow the user to enable DRI3 with this new option. nouveau's glamor accel backend currently doesn't work under DRI2 at all, so we continue to use DRI3 whenever it is supported and ignore this new option for now. Also add a bit more output about status of Present and DRI3 to aid debugging. Note: This was originally meant to be a boolean parameter, to just select between DRI3 on and off, but changed here to a DRI level to make it consistent with the same option in the released Intel-ddx. v2: Use fixed up Bool return type of nouveau_present_init(). Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Cc: Ilia Mirkin <imirkin@alum.mit.edu> Cc: Emil Velikov <emil.l.velikov@gmail.com> Cc: Martin Peres <martin.peres@free.fr> Cc: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-08-03present: Fixup return type of nouveau_present_init()Mario Kleiner1-2/+2
Make it a Bool consistently, as declared in header. Reported-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-07-14Avoid build fail without COMPOSITEIlia Mirkin1-2/+6
Reviewed-by: Dave Airlie <airlied@redhat.com>
2015-07-11Adapt to new dirty tracking apiVadim Rutkovsky2-1/+7
Mirrors commit b6d871bf2 (radeon: adopt for new X server dirty tracking APIs.) in xf86-video-ati. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91284
2015-06-10fix a wrong use of a logical operator in drmmode_output_dpms()Samuel Pitoiset1-1/+1
This is probably a typo error which has been introduced in 2009... This fixes the following warning detected by Clang : drmmode_display.c:907:30: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand] if (props && (props->flags && DRM_MODE_PROP_ENUM)) { Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2015-05-27nv50/exa: add comments showing the code that makes up the programsIlia Mirkin1-110/+109
As decoded by envydis. Perhaps these should move into separate files similar to nvc0, but this seems like a simple intermediate solution. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-05-20older hardware prefers copy to clear, so use thatIlia Mirkin1-1/+1
Doing a solid copy of 0, or a clear, has the same effect. This is a partial revert of commit 5439a9905eab8c. Pre-nv50 hardware succeeds with copies more often. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-05-20nv04-nv40: don't attempt to do 32-bit shiftsIlia Mirkin1-1/+2
A 32-bit shift is a no-op, which will also make the new planemask get or'd with ~0, thus negating the usefulness of the subsequent planemask != ~0 check. Only do this if it's a less-than-32-bit per pixel format, in which case it will have the desired effect of setting the high bits. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Martin Peres <martin.peres@free.fr>
2015-05-20Check before trying a solid fillIlia Mirkin1-5/+8
Pre-nv50 has all sorts of funny requirements for non-copy alu operations, and will bail out of solid fills left and right. Account for that case and fall back to the memset. Reported-by: Andrew Randrianasulu <randrianasulu@gmail.com> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Martin Peres <martin.peres@free.fr>
2015-03-23nv50: explicitly disable ZETA bufferIlia Mirkin1-0/+2
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-03-23use defined method names where availableIlia Mirkin10-32/+33
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-03-23Actually do a clear instead of doing a bogus copy.Maarten Lankhorst1-2/+2
Oops!
2015-03-21Try using EXA ops harder in drmmode_fbcon_copy fallbackMaarten Lankhorst1-13/+20
The memcpy in the fallback path fails with SIGBUS on GK20A because this memory is not coherent, try to use a solid fill instead.
2015-03-20Simplify nouveau_allocate_surface's pitch calculation.Maarten Lankhorst1-14/+7
Judging from previous commits all linear buffers should have a 256 byte alignment.
2015-03-20Use drmGetRenderDeviceNameFromFd to obtain the dri3 node.Maarten Lankhorst2-10/+8
2015-03-14Use the correct class and shader ops for GK20A.Maarten Lankhorst1-3/+5
Signed-off-by: Maarten Lankhorst <dev@mblankhorst.nl>
2015-03-14Make the ddx load with platform devicesMaarten Lankhorst1-15/+26
Signed-off-by: Maarten Lankhorst <dev@mblankhorst.nl>
2014-10-23fix null pointer derefMaarten Lankhorst1-2/+2
2014-10-23check memory allocation in nouveau_glamor_set_shared_pixmap_backingMaarten Lankhorst1-0/+2
As reported by Roy Spliet.
2014-10-23rework initialization to prevent some crashesMaarten Lankhorst1-4/+4
2014-10-22fix !DRI3 caseMaarten Lankhorst1-4/+6
2014-10-22fix crash in nouveau_glamor_set_shared_pixmap_backingMaarten Lankhorst1-0/+5
2014-10-22move down call to nouveau_present_init until after fb init.Maarten Lankhorst1-1/+1
2014-10-22enable dri3 support without glamorMaarten Lankhorst6-10/+143
2014-10-04kepler: remove unnecessary texbars, add live-only tex for nvf0Ilia Mirkin20-42/+24
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-10-04allow path to envyas binary to be specifiedIlia Mirkin1-6/+7
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-10-04copy: don't bother trying to create copy on pre-nva3Ilia Mirkin1-1/+5
Only the NVA3/5/8/F tesla chips have a copy engine. Don't bother trying to create one on earlier tesla chips (and thus printing an error on failure). Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-09-01Bump version to 1.0.11 for release.Mario Kleiner1-1/+1
Highlights: - Support for server managed fd's. - Glamor support. - Maxwell support. - DRI3 and initial Present support. - vsync'ed kms pageflip performance fixes when running on Linux 3.13+ - Multi-display vsync, vblank, swap scheduling, timestamping fixes. - Multi x-screen support fixes. - ZaphodHead support on for multiple outputs per x-screen. - EXA nv-10 fixes. - Enable sync of swaps to vblank by default (Option GLXVblank "on"). - Disable pseudo-triplebuffering by default (Option SwapLimit "1"). Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-09-01dri2: Set default SwapLimit to 1 for double-buffering.Mario Kleiner2-4/+4
This used to be 2 for pseudo-triplebuffering on XOrg 1.12+. However, it caused problems like unthrottled swapping at up to twice the video refresh rate for redirected windows under desktop composition, which can't be easily fixed under dri2. Default to double-buffering. Users can override this, but dri3 provides better solutions for this. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-09-01xv/dri2/dri3: Switch to optimized crtc selection for drawables.Mario Kleiner7-57/+138
Make crtc selection consistent with ati and intel ddx. Pick the crtc to use for vblank events, swap scheduling and kms-pageflip completion events as the one with maximum pixel area intersection between its viewport and the drawable. If multiple crtc's viewports display the same amount of area of a drawable, select the crtc whose output is the designated "primary output" for the x-screen. The latter allows, e.g., in a clone display setup, to select the important output on which tearing should be minimized. The former makes sure to minimize or avoid tearing on the display which shows the largest part of the drawable. This method is transplanted from the ati ddx. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-09-01Add file "compile" to .gitignoreMario Kleiner1-0/+1
Some auto-generated file by new make systems to deal with some old compilers. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-17Fix event handling on multi-x-screen configs.Mario Kleiner2-8/+24
Only register the wakeup handler and event socket once per card fd and server generation, as the fd and device file is shared between all x-screens for a given card during a given server generation. Without this fix, vblank and kms-pageflip completion event processing don't work properly, as the server doesn't kick the wakeup handler for gpu events, and therefore the desktop will freeze, unless the user manually kicks the wakeup handler by moving the mouse or hitting the keyboard. Add proper reference counting and checks to make it so. This fix is derived from a similar and proven fix in the ati ddx for the same problem. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-17Make new ZaphodHeads work across server regenerations.Mario Kleiner2-0/+9
Reset the mask of already assigned crtc's at start of each new server generation. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-17dri2 and xv: Fix NVxxSyncToVBlank() for multi-x-screen's.Mario Kleiner3-3/+15
Use helper function drmmode_head() to choose proper hw-crtc to sync to. Fixes xv blits, and dri2 Copy-Swaps. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-11fix glamor header checkBen Skeggs1-7/+3
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-11present: use drmmode_head() where it's appropriateBen Skeggs1-22/+4
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-11Allow/Fix use of multiple ZaphodHead outputs per x-screen.Mario Kleiner3-15/+37
Defining multiple ZaphodHead outputs per x-screen in a multiple x-screen's per gpu configuration caused all outputs except one per x-screen to go dark, because there was a fixed mapping x-screen number -> crtc number, limiting the number of crtc's per x-screen to one. On a ZaphodHead's setup, be more clever and assign as many crtc's to a given x-screen as there are ZaphodHeads defined for that screen, assuming there are enough unused crtc's available. Tested on a triple display setup with different combos of one, two or three ZaphodHeads per one, two or three x-screens. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-11dri2: Fix drmWaitVblank on multi-x-screen configs.Mario Kleiner4-12/+33
Old mapping of xf86Crtc -> display head index was too simple and only worked on a single x-screen config. Introduce a new helper function drmmode_hw_head_index() which returns proper mapping also for multi x-screens per gpu and ZaphodHeads setups and other non-standard multi- display configurations. Tested on triple-head setup with various ZaphodHead and server layout combos. This helper will be also needed for dri3/present code. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
2014-08-11exa/nv10: src ops should use the SF macroIlia Mirkin1-1/+1
Doesn't actually end up mattering. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-11exa/nv10: fix blend function setup to check the correct maskIlia Mirkin1-3/+3
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>