summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nv50_crtc.c
Commit message (Collapse)AuthorAgeFilesLines
* drm: Make the .mode_fixup() operations mode argument a const pointerLaurent Pinchart2012-07-201-1/+1
| | | | | | | | The passed mode must not be modified by the operation, make it const. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/nv50/disp: fixup error paths in crtc object creationBen Skeggs2012-05-241-31/+21Star
| | | | | Reported-by: Marcin Slusarz <marcin.slusarz@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: use the same packet header macros as userspaceBen Skeggs2012-05-241-23/+23
| | | | | | Cosmetic cleanup only. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* nouveau: add PRIME supportDave Airlie2012-05-231-2/+2
| | | | | | | | | | | | This adds prime->fd and fd->prime support to nouveau, it passes the SG object to TTM, and then populates the GART entries using it. v2: add stubbed kmap + use new function to fill out pages array for faulting + add reimport test. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/nv50/display: expose color vibrance controlChristoph Bumiller2012-03-131-2/+40
| | | | | Signed-off-by: Christoph Bumiller <e0425955@student.tuwien.ac.at> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv50/disp: fix scaling of doublescan modesBen Skeggs2011-12-211-15/+18
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv50/disp: rewrite crtc timing calculation, with proper names and fixesBen Skeggs2011-12-211-71/+56Star
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/disp: kill off nouveau_crtc.modeBen Skeggs2011-12-211-10/+0Star
| | | | | | This hasn't been necessary for a long time now.. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: improve dithering properties, and implement proper auto modeBen Skeggs2011-12-211-21/+28
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: no need to pass parameters into set_scale/ditherBen Skeggs2011-12-211-6/+10
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv50/disp: synchronise display right after initBen Skeggs2011-12-211-2/+5
| | | | | | | | | This has the effect of ensuring the encoders which were active before we loaded get disconnected properly before we start reprogramming them. Also removing a bit of cargo-cult from the initial evo pushbuf. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv50/disp: move sync routine to where it can be used by other modulesBen Skeggs2011-12-211-37/+4Star
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: add overscan compensation connector propertiesBen Skeggs2011-12-211-41/+58
| | | | | | | | | | | | Exposes the same connector properties as the Radeon implementation, however their behaviour isn't exactly the same. The primary difference being that unless both hborder/vborder have been defined by the user, the driver will keep the aspect ratio of the overscanned area the same as the mode the display is programmed for. Enabled for digital outputs on GeForce 8 and up, excluding GF119. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv50/crtc: disable flip overlay around scaling mode changesBen Skeggs2011-12-211-39/+40
| | | | | | Prevents EVO getting all angry at us. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: make general drm modesetting init commonBen Skeggs2011-09-201-2/+0Star
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv50/crtc: Bail out if FB is not bound to crtcEmil Velikov2011-09-091-2/+10
| | | | | | | | | Fixes possbile NULL pointer dereference Resolves 'kernel crash in nv50_crtc_do_mode_set_base during shutdown' https://bugs.freedesktop.org/show_bug.cgi?id=40005 Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: remove 'chan' argument from nouveau_bo_newBen Skeggs2011-06-231-2/+2
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: convert bo.mem.start usage to bo.offsetBen Skeggs2011-06-231-3/+3
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: make cursor_set implementation consistent with other driversMarcin Slusarz2011-05-161-3/+3
| | | | | | | | | | | When xorg state tracker wants to hide the cursor it calls set_cursor with NULL buffer_handle and size=0x0, but nouveau refuses to hide it because size is not 64x64... which is a bit odd. Both radeon and intel check buffer_handle before validating size of cursor, so make nouveau implementation consistent with them. Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nva3/clk: better pll calculation when no fractional fb div availableBen Skeggs2011-05-161-2/+2
| | | | | | | | | | | | The core/mem/shader clocks don't support the fractional feedback divider, causing our calculated clocks to be off by quite a lot in some cases. To solve this we will switch to a search-based algorithm when fN is NULL. For my NVA8 at PL3, this actually generates identical cooefficients to the binary driver. Hopefully that's a good sign, and that does not break VPLL calculation for someone.. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: Fix brace placement checkpatch.pl errors.Emil Velikov2011-05-161-2/+1Star
| | | | | | | | Fix 'ERROR: that open brace { should be on the previous line' Fix 'ERROR: else should follow close brace }' Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Francisco Jerez <currojerez@riseup.net>
* drm/nv50-nvc0: remove some code that doesn't belong hereBen Skeggs2011-04-051-3/+0Star
| | | | | | Not sure how this snuck in... Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: remove no_vm/mappable flags from nouveau_boBen Skeggs2011-02-241-2/+2
| | | | | | | | | | 'mappable' isn't really used at all, nor is it necessary anymore as the bo code is capable of moving buffers to mappable vram as required. 'no_vm' isn't necessary anymore either, any places that don't want to be mapped into a GPU address space should allocate the VRAM directly instead. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv50-nvc0: activate/update ds channel's framebuffer on modesetsBen Skeggs2011-02-241-1/+9
| | | | | | | | The hw doesn't really appear to be designed to be used the way we have to use it due to DRI2's design. This leads us to having to keep the flipped fb support active at all times. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv50-nvc0: precalculate some fb state when creating themBen Skeggs2011-02-241-50/+11Star
| | | | | | | Just a cleanup, to avoid duplicating parts of nv50_crtc.c's code in the page flipping routines. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv50-nvc0: request and wait on notification of modeset completionBen Skeggs2011-02-241-24/+53
| | | | | | | | | This should prevent a number of races from occuring, the most obvious of which will be exposed when we start making use of the "display sync" evo channel for page flipping. The DS channel will reject any command stream that doesn't completely agree with the current "master" state. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv50-nvc0: rename disp->evo to disp->masterBen Skeggs2011-02-241-6/+6
| | | | | | | More appropriate, and we're about to be using more than just the master EVO channel. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv50-nvc0: move non-sharable display state into private structureBen Skeggs2011-02-241-10/+6Star
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nvc0: initial support for tiled buffer objectsBen Skeggs2010-12-211-7/+11
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv50: implement global channel address space on new VM codeBen Skeggs2010-12-081-4/+2Star
| | | | | | | As of this commit, it's guaranteed that if an object is in VRAM that its GPU virtual address will be constant. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: Call drm_vblank_pre/post_modeset() around mode setting.Francisco Jerez2010-12-031-0/+2
| | | | | Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: Implement the pageflip ioctl.Francisco Jerez2010-12-031-0/+1
| | | | | | | nv0x-nv4x should be mostly fine, nv50 doesn't work yet. Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: Expose some BO usage flags to userspace.Francisco Jerez2010-11-181-2/+2
| | | | | | | | | This will be needed for Z compression and to take smarter placement decisions. Signed-off-by: Francisco Jerez <currojerez@riseup.net> Acked-by: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm, kdb, kms: Change mode_set_base_atomic() enter argument to be an enumJason Wessel2010-10-191-1/+1
| | | | | | | | | | | | | | The enter argument as implemented by commit 413d45d3627 (drm, kdb, kms: Add an enter argument to mode_set_base_atomic() API) should be more descriptive as to what it does vs just passing 1 and 0 around. There is no runtime behavior change as a result of this patch. Reported-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Jason Wessel <jason.wessel@windriver.com> CC: David Airlie <airlied@linux.ie> CC: dri-devel@lists.freedesktop.org Signed-off-by: Dave Airlie <airlied@redhat.com>
* Merge branch 'drm-kdb-next' into drm-core-nextDave Airlie2010-10-061-13/+36
|\ | | | | | | | | | | | | | | | | * drm-kdb-next: drm/nouveau/kms: Avoid a hang entering KDB with VT accel on. radeon, kdb, kms: Save and restore the LUT on atomic KMS enter/exit drm, kdb, kms: Add an enter argument to mode_set_base_atomic() API drm/nouveau/kms: Implement KDB debug hooks for nouveau KMS. drm/radeon/kms: Implement KDB debug hooks for radeon KMS.
| * drm, kdb, kms: Add an enter argument to mode_set_base_atomic() APIJason Wessel2010-10-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some devices such as the radeon chips receive information from user space which needs to be saved when executing an atomic mode set operation, else the user space would have to be queried again for the information. This patch extends the mode_set_base_atomic() call to pass an argument to indicate if this is an entry or an exit from an atomic kernel mode set change. Individual drm drivers can properly save and restore state accordingly. Signed-off-by: Jason Wessel <jason.wessel@windriver.com> CC: Jesse Barnes <jbarnes@virtuousgeek.org> CC: David Airlie <airlied@linux.ie> CC: dri-devel@lists.freedesktop.org Signed-off-by: Dave Airlie <airlied@redhat.com>
| * drm/nouveau/kms: Implement KDB debug hooks for nouveau KMS.Chris Ball2010-10-061-13/+36
| | | | | | | | | | | | | | | | | | | | Tested on nv50 and nv04 HW. Signed-off-by: Chris Ball <cjb@laptop.org> Signed-off-by: Jason Wessel <jason.wessel@windriver.com> CC: Jesse Barnes <jbarnes@virtuousgeek.org> CC: dri-devel@lists.freedesktop.org Signed-off-by: Dave Airlie <airlied@redhat.com>
* | drm/ttm: restructure to allow driver to plug in alternate memory managerBen Skeggs2010-10-051-2/+1Star
| | | | | | | | | | | | | | | | | | Nouveau will need this on GeForce 8 and up to account for the GPU reordering physical VRAM for some memory types. Reviewed-by: Jerome Glisse <jglisse@redhat.com> Acked-by: Thomas Hellström <thellstrom@vmware.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nv50: use pll type rather than register for CRTC PLLBen Skeggs2010-09-241-19/+14Star
| | | | | | | | | | | | | | Just in case someone, somewhere, does something difficult. This also removes one path that was different between fermi and non-fermi. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau: require explicit unmap of kmapped bosBen Skeggs2010-09-241-0/+2
|/ | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm: expand gamma_setJames Simmons2010-08-101-6/+3Star
| | | | | | | | | | Expand the crtc_gamma_set function to accept a starting offset. The reason for this is to eventually use this function for setcolreg from drm_fb_helper.c. The fbdev colormap function can start at any offset in the color map. Signed-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: Use ENOENT consistently for the error return for an unmatched handle.Chris Wilson2010-08-101-1/+1
| | | | | | | | | | | This is consistent with trying to access a filename that not exist within a directory which is a good analogy here. The main reason for the change is that it is easy to confuse the error code of EBADF as an performing an ioctl on an invalid file descriptor (rather than an unknown object). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/nvc0: implement crtc pll settingBen Skeggs2010-08-061-3/+20
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv50: send evo "update" command after each disconnectBen Skeggs2010-07-131-9/+2Star
| | | | | | | | | It turns out that the display engine signals an interrupt for disconnects too. In order to make it easier to process the display interrupts correctly, we want to ensure we only get one operation per interrupt sequence - this is what this commit achieves. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv50: supply encoder disable() hook for SOR outputsBen Skeggs2010-07-131-31/+0Star
| | | | | | | | | | Allows us to remove a driver hack that used to be necessary to disable encoders in certain situations before setting up a mode. The DRM has better knowledge of when this is needed than the driver does. This fixes a number of display switching issues. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv50: support fractional feedback divider on newer chipsBen Skeggs2010-05-191-23/+25
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv50: output calculated crtc pll when debugging onBen Skeggs2010-05-191-0/+6
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* Use drm_gem_object_[handle_]unreference_unlocked where possibleLuca Barbieri2010-02-111-3/+1Star
| | | | | | | | | | | Mostly obvious simplifications. The i915 pread/pwrite ioctls, intel_overlay_put_image and nouveau_gem_new were incorrectly using the locked versions without locking: this is also fixed in this patch. Signed-off-by: Luca Barbieri <luca@luca-barbieri.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/nouveau: move dereferences after null checksMarcin Slusarz2010-02-111-4/+7
| | | | | | | Reported-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Signed-off-by: Maarten Maathuis <madman2003@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv50: prevent accidently turning off encoders we're actually usingBen Skeggs2010-01-181-1/+21
| | | | | | | | | | | | | On most cards the DisplayPort connector is created with 2 encoders sharing a single SOR (for native DP, and for DVI-over-DP). The previous logic for turning off unused encoders didn't take into account that we could have multiple drm_encoders on a single hw encoder and ended up turning off encoders that were actually being used still. This patch fixes that issue. We probably want to look at something a bit better later on, and only expose one drm_encoder per hw encoder block. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>