summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_crtc_helper.c
Commit message (Collapse)AuthorAgeFilesLines
* drm: change drm set mode messages as DRM_DEBUGDave Young2010-01-131-1/+1
| | | | | | | | | | Following drm info repeat 207 times during one hour, it's quite annoying [ 1266.286747] [drm] TV-19: set mode NTSC 480i 0 Change from DRM_INFO to DRM_DEBUG Signed-off-by: Dave Young <hidave.darkstar@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: fix crtc no modes printf + typoDave Airlie2010-01-131-1/+2
| | | | | | | Toralf Förster pointed out the typo, the fact I forget the if statement is purely personal fail. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: reduce WARN_ON to a printk.Dave Airlie2010-01-111-1/+1
| | | | | | | Lots of ppl keep thinking this is an oops, it was just a warning for me to see, just make it a printk now. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: Keep disabled outputs disabled after suspend / resumeDavid John2010-01-111-1/+23
| | | | | | | | | | | | | With the current DRM code, an output that has been powered off from userspace will automatically power back on when resuming from suspend. This patch fixes this behaviour. Tested only with the Intel i915 driver on an Intel GM45 Express chipset. Signed-off-by: David John <davidjon@xenontk.org> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: disable all the possible outputs/crtcs before entering KMS modeZhao Yakui2009-12-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | Sometimes we will use a crtc for integerated LVDS, which is different with that assigned by BIOS. If we want to get flicker-free transitions, then we could read out the current state for it and set our current state accordingly. But it is true that if we aren't reading current state out, we do need to turn everything off before modesetting. Otherwise the clocks can get very angry and we get things worse than a flicker at boot. In fact we also do the similar thing in UMS mode. We will disable all the possible outputs/crtcs for the first modesetting. So we disable all the possible outputs/crtcs before entering the KMS mode. Before we configure connector/encoder/crtc, the function of drm_helper_disable_unused_function can disable all the possible outputs/crtcs. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Rafal Milecki <zajec5@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* Merge branch 'drm-core-next' into drm-linusDave Airlie2009-12-081-1/+1
|\ | | | | | | | | | | | | | | Bring all core drm changes into 2.6.32 tree and resolve the conflict that occurs. Conflicts: drivers/gpu/drm/drm_fb_helper.c
| * drm/modes: Fall back to 1024x768 instead of 800x600Adam Jackson2009-11-241-1/+1
| | | | | | | | | | | | | | | | | | This matches the X server's fallback modes when using RANDR 1.2. See also: http://bugzilla.redhat.com/538761 Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* | drm/kms: Init the CRTC info fields for modes forced from the command line.Francisco Jerez2009-11-101-0/+1
|/ | | | | | | Fixes fdo bug 24710. Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/kms: protect against fb helper not being created.Dave Airlie2009-09-261-2/+11
| | | | | | | If drivers don't init the fb helper on the connector, the cmdline code won't work, but it shouldn't crash either. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/kms: start adding command line interface using fb.Dave Airlie2009-09-251-5/+74
| | | | | | | | | | | | | | | | | | | | | | | | [note this requires an fb patch posted to linux-fbdev-devel already] This uses the normal video= command line option to control the kms output setup at boot time. It is used to override the autodetection done by kms. video= normally takes a framebuffer as the first parameter, in kms it will take a connector name, DVI-I-1, or LVDS-1 etc. If no output connector is specified the mode string will apply to all connectors. The mode specification used will match down the probed modes, and if no mode is found it will add a CVT mode that matches. video=1024x768 - all connectors match a 1024x768 mode or add a CVT on video=VGA-1:1024x768, VGA-1 connector gets mode only. The same strings as used in current fb modedb.c are used, except I've added three more letters, e, D, d, e = enable, D = enable Digital, d = disable, which allow a connector to be forced into a certain state. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: update crtc x/y when only fb changesBen Skeggs2009-09-181-0/+3
| | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: prune modes when output is disconnected.Adam Jackson2009-09-081-2/+2
| | | | | | | | | | When an output was disconnected, its mode list would remain. If you later plugged into a sink with no EDID (projector, etc), you'd inherit the mode list from the old sink, which is not what you want. taken from Fedora kernel Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/kms: remove old std mode fallback code.Dave Airlie2009-09-071-54/+2
| | | | | | | The new code adds modes in the helper, which makes more sense I disliked the non-driver code adding modes. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/kms/i915: Add the default mode for CRT output without EDIDykzhao2009-09-071-2/+5
| | | | | | | | Add the default mode for every output device when there is no mode for it. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/crtc_helper: avoid NULL-pointer dereference when encoder is NULLMaarten Maathuis2009-09-021-1/+2
| | | | | Signed-off-by: Maarten Maathuis <madman2003@gmail.com> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/crtc: fix mismerge of last patch.Dave Airlie2009-09-021-2/+2
| | | | | | We only want to NULL encoder->crtc when it is off. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/kms: add explicit encoder disable function and detach harder.Dave Airlie2009-09-021-4/+20
| | | | | | | | | | | | | For shared tv-out and VGA encoders, we really need to know if the encoder is just being switched off temporarily in blanking or if we are really disabling it hard. Also we need to try harder to disconnect encoders from unused connectors so we can share more efficently. (shared encoders stuff is coming in radeon tv-out support) Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/crtc_helper: NULL encoder->crtc when switching encodersMaarten Maathuis2009-08-311-0/+4
| | | | | | | - Previously the old encoder would be called during modeset and without a connector bad things happened. Signed-off-by: Maarten Maathuis <madman2003@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/crtc_helper: replace modeset fail path with something simplerMaarten Maathuis2009-08-311-32/+54
| | | | | | | | - The previous system was not very transparent, nor flexible. - This is needed to be able to fix a few bugs in the mechanism. Signed-off-by: Maarten Maathuis <madman2003@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* Merge Linus master to drm-nextDave Airlie2009-08-201-2/+4
|\ | | | | | | | | | | | | | | | | | | | | linux-next conflict reported needed resolution. Conflicts: drivers/gpu/drm/drm_crtc.c drivers/gpu/drm/drm_edid.c drivers/gpu/drm/i915/intel_sdvo.c drivers/gpu/drm/radeon/radeon_ttm.c drivers/gpu/drm/ttm/ttm_bo.c
| * drm: Catch stop possible NULL pointer referenceJakob Bornecrantz2009-08-041-2/+4
| | | | | | | | | | | | | | | | | | This was caught by Weiss. Also added some comments to the fb_changed and mode_changed variables to explain what they do. Signed-off-by: Jakob Bornecrantz <jakob@vmware.com> Tested-by: Thomas White <taw@bitwiz.org.uk> Signed-off-by: Dave Airlie <airlied@redhat.com>
* | drm: Add the debug info in generic drm mode by using DRM_DEBUG_KMSZhao Yakui2009-08-041-20/+24
|/ | | | | | | Add the debug info in generic drm mode by using DRM_DEBUG_KMS Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: Disable the unused connectors explicitly when resuming with KMS.Zhao Yakui2009-07-101-0/+2
| | | | | | | Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org> Acked-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Eric Anholt <eric@anholt.net>
* drm: Hook up DPMS property handling in drm_crtc.c. Add ↵Keith Packard2009-06-041-2/+107
| | | | | | | | | | | | | | | | | | | | drm_helper_connector_dpms. Making the drm_crtc.c code recognize the DPMS property and invoke the connector->dpms function doesn't remove any capability from the driver while reducing code duplication. That just highlighted the problem with the existing DPMS functions which could turn off the connector, but failed to turn off any relevant crtcs. The new drm_helper_connector_dpms function manages all of that, using the drm_helper-specific crtc and encoder dpms functions, automatically computing the appropriate DPMS level for each object in the system. This fixes the current troubles in the i915 driver which left PLLs, pipes and planes running while in DPMS_OFF mode or even while they were unused. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/kms: don't try to shortcut drm mode set functionDave Airlie2009-04-241-19/+0
| | | | | | | | We have a drm_set_config which takes a crtc/encoder/mode setup, and checks it to see if it can shortcut and just do a base setup, or whether a complete mode setting is required. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: remove unused "can_grow" parameter from drm_crtc_helper_initial_configJesse Barnes2009-04-031-2/+1
| | | | | | | Cleanup some leftovers from the X port. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: sync the mode validation for INTERLACE/DBLSCANyakui_zhao2009-04-031-0/+28
| | | | | | | | | Check whether the INTERLACE/DBLSCAN is supported by output device. If not, the mode containing the flag of INTERLACE/DBLSCAN will be marked as unsupported. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: disable encoders before re-routing themJesse Barnes2009-02-251-4/+72
| | | | | | | | | | | | In some cases we may receive a mode config that has a different CRTC<->encoder map that the current configuration. In that case, we need to disable any re-routed encoders before setting the mode, otherwise they may not pick up the new CRTC (if the output types are incompatible for example). Tested-by: Kristian Høgsberg <krh@bitplanet.net> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm: Propagate failure from setting crtc base.Chris Wilson2009-02-201-4/+11
| | | | | | | | | Check the error paths within intel_pipe_set_base() to first cleanup and then report back the error. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm: Check for a NULL encoder when reverting on error pathChris Wilson2009-02-201-1/+5
| | | | | | | | | We need to skip the connectors with a NULL encoder to match the success path and avoid an OOPS. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm: handle depth & bpp changes correctlyJesse Barnes2009-01-161-15/+33
| | | | | | Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm: initial KMS config fixesJesse Barnes2009-01-161-34/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When mode setting is first initialized, the driver will call into drm_helper_initial_config() to set up an initial output and framebuffer configuration. This routine is responsible for probing the available connectors, encoders, and crtcs, looking for modes and putting together something reasonable (where reasonable is defined as "allows kernel messages to be visible on as many displays as possible"). However, the code was a bit too aggressive in setting default modes when none were found on a given connector. Even if some connectors had modes, any connectors found lacking modes would have the default 800x600 mode added to their mode list, which in some cases could cause problems later down the line. In my case, the LVDS was perfectly available, but the initial config code added 800x600 modes to both of the detected but unavailable HDMI connectors (which are on my non-existent docking station). This ended up preventing later code from setting a mode on my LVDS, which is bad. This patch fixes that behavior by making the initial config code walk through the connectors first, counting the available modes, before it decides to add any default modes to a possibly connected output. It also fixes the logic in drm_target_preferred() that was causing zeroed out modes to be set as the preferred mode for a given connector, even if no modes were available. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm: pin new and unpin old buffer when setting a mode.Kristian Høgsberg2008-12-291-7/+13
| | | | | | | | | This removes the requirement for user space to pin a buffer before setting a mode that is backed by the pixels from that buffer. Signed-off-by: Kristian Høgsberg <krh@redhat.com> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm: sanitise drm modesetting API + remove unused hotplugJakob Bornecrantz2008-12-291-2/+0
| | | | | | | | | | | The initially merged modesetting API has some uglies in it, this cleans up the struct members and ioctl ordering for initial submission. It also removes the unneeded hotplug infrastructure. airlied:- I've pulled this patch in from git modesetting-gem tree. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: pick an 800x600@60HZ mode by default for unknown CRT.Dave Airlie2008-12-291-4/+4
| | | | | | This is what X picks now, so we should do the same. Signed-off-by: Dave Airlie <airlied@redhat.com>
* DRM: add mode setting supportDave Airlie2008-12-291-0/+822
Add mode setting support to the DRM layer. This is a fairly big chunk of work that allows DRM drivers to provide full output control and configuration capabilities to userspace. It was motivated by several factors: - the fb layer's APIs aren't suited for anything but simple configurations - coordination between the fb layer, DRM layer, and various userspace drivers is poor to non-existent (radeonfb excepted) - user level mode setting drivers makes displaying panic & oops messages more difficult - suspend/resume of graphics state is possible in many more configurations with kernel level support This commit just adds the core DRM part of the mode setting APIs. Driver specific commits using these new structure and APIs will follow. Co-authors: Jesse Barnes <jbarnes@virtuousgeek.org>, Jakob Bornecrantz <jakob@tungstengraphics.com> Contributors: Alan Hourihane <alanh@tungstengraphics.com>, Maarten Maathuis <madman2003@gmail.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
OpenPOWER on IntegriCloud