summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_modes.c
AgeCommit message (Collapse)AuthorFilesLines
2016-02-09drm: modes: add missing [drm] to message printingLABBE Corentin1-2/+1
The warning message in drm_mode_parse_command_line_for_connector miss the [drm] at beginning. This patch add it and take the opportunity to convert printk(KERN_WARNING to pr_warn() Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1454594633-15100-1-git-send-email-clabbe.montjoie@gmail.com
2015-12-15drm/doc: Convert to markdownDanilo Cesar Lemes de Paula1-6/+6
DRM Docbook is now Markdown ready. This means its doc is able to use markdown text on it. * Documentation/DocBook/drm.tmpl: Contains a table duplicated from drivers/gpu/drm/i915/i915_reg.h. This is not needed anymore * drivers/gpu/drm/drm_modeset_lock.c: had a code example that used to look pretty bad on html. Fixed by using proper code markup. * drivers/gpu/drm/drm_prime.c: Remove spaces between lines to make a proper markup list. * drivers/gpu/drm/i915/i915_reg.h: Altought pandoc supports tables, it doesn't support table cell spanning. But we can use fixed-width for those special cases. * include/drm/drm_vma_manager.h: Another code example that should be proper indented with four spaces. v2 (Daniel): Adjust name to gpu.xml due to rename. v3 (Daniel): Split out the actual enabling in the Makefile - this way we can merge the conversion, while just keeping the enabling in a drm-private tree. Signed-off-by: Danilo Cesar Lemes de Paula <danilo.cesar@collabora.co.uk> (v1) Cc: Randy Dunlap <rdunlap@infradead.org> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Herbert Xu <herbert@gondor.apana.org.au> Cc: Stephan Mueller <smueller@chronox.de> Cc: Michal Marek <mmarek@suse.cz> Cc: linux-kernel@vger.kernel.org Cc: linux-doc@vger.kernel.org Cc: intel-gfx <intel-gfx@lists.freedesktop.org> Cc: dri-devel <dri-devel@lists.freedesktop.org> Acked-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1448471279-19748-2-git-send-email-daniel.vetter@ffwll.ch
2015-12-11drm: modes: Revert cc344980c767 "replace simple_strtoul by kstrtouint"LABBE Corentin1-11/+5
My latest commit introduce some case where a valid mode, could be rejected. simple_strtox functions stop at first non-digit character, but kstrtox not. So args like "video=HDMI-A-1:720x480-16@60" will be reject when checking 16@. Discussions about this change comes to the conclusion that the best solution is to revert my commit cc344980c76748e57c9c03100c2a14d36ab00334. Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1449838739-29969-1-git-send-email-clabbe.montjoie@gmail.com
2015-12-11drm: Drop drm_helper_probe_single_connector_modes_nomerge()Ville Syrjälä1-9/+3
Now that the mode type bit merge logic is fixed to only merge between new probed modes, hopefully we can eliminat the special case for qxl and virtio. That is make the merge the mode type bits from all matching new probed modes, just like every other driver. qxl and virtio got excluded from the merging in commit 3fbd6439e463 ("drm: copy mode type in drm_mode_connector_list_update()") commit abce1ec9b08a ("Revert "drm: copy mode type in drm_mode_connector_list_update()"") commit b87577b7c768 ("drm: try harder to avoid regression when merging mode bits") Cc: Marc-André Lureau <marcandre.lureau@redhat.com> Cc: Dave Airlie <airlied@redhat.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Adam Jackson <ajax@redhat.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> [danvet: Resolve conflicts with doc updates.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-12-11drm: Only merge mode type bits between new probed modesVille Syrjälä1-7/+27
Currently most drivers request that any mode appearing on both the old mode list and the new probed_modes list get their type bits ORed together if the modes are deemed to otherwise match each other. I don't know why anyone would want to merge in the mode type bits from any mode left over from a previous probe. For instance, you could never get rid of ther preferred bit if a matching non-preferred mode is returned by the new probe. So let's not merge anything from the stale old modes, and just replace them outright with matching new modes. If multiple matching modes are produced by the same probe, merging the type bits between them would seem like a sensible thing to do. For a bit of extra finesse if two modes are considered equal we can pick the actual timings from the one marked as preferrred. And if multiple preferred modes are produced by the same probe somehow, we can just favor the first one added to the probed_modes list. You may be asking yourself why we bother with the merging at all if nothing from the old list survives in practice. The only answer I have is "debug output". That is we want to print out a list of pruned modes, which is why we still want to look for duplicates with the old modes. There was a previous attempt to get rid of the mode type merging entirely, but it caused some kind of regression on Daniels's G33 machine. Apparently the sdvo transcoder on said machine started to die at around the same time and has since rotted away totally, so it may have been a red herring. So we don't have to worry about it anymore. The relevant commits are: commit 3fbd6439e463 ("drm: copy mode type in drm_mode_connector_list_update()") commit abce1ec9b08a ("Revert "drm: copy mode type in drm_mode_connector_list_update()"") It was then decided in commit b87577b7c768 ("drm: try harder to avoid regression when merging mode bits") that just qxl virtio are excluded from the merging, while everyone else does it. That is not changed, although now even qxl and virtio will be subject to the previously mentioned logic to choose which actual timings are picked for the new mode. v2: Fix typos in commit message, and clarify the details on the G33 regression from the previous attempt (Daniel) Cc: Marc-André Lureau <marcandre.lureau@redhat.com> Cc: Dave Airlie <airlied@redhat.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Adam Jackson <ajax@redhat.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1449234781-22332-1-git-send-email-ville.syrjala@linux.intel.com
2015-12-11drm: Flatten drm_mode_connector_list_update() a bitVille Syrjälä1-18/+18
Use 'continue' to eliminate one indent level from drm_mode_connector_list_update(). And while at it, make 'found_it' bool. Cc: Adam Jackson <ajax@redhat.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1449177255-9515-5-git-send-email-ville.syrjala@linux.intel.com
2015-12-11drm: Rename MODE_UNVERIFIED to MODE_STALEVille Syrjälä1-1/+1
MODE_UNVERIFIED actually means that the mode came from a previous probe, and if the new probe doesn't produce a matching mode it will get pruned from the list. Rename the flag to MODE_STALE to better convey the meaning. v2: Rebased due to conflicts with Daniel's doc stuff Cc: Adam Jackson <ajax@redhat.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1449779948-10906-1-git-send-email-ville.syrjala@linux.intel.com
2015-12-09drm: Move drm_display_mode an related docs into kerneldocDaniel Vetter1-1/+2
This was in the documentation for modeset helper hooks, where it is a bit misplaced. v2: Reindent the drm_mode_status enum, inspired by Ville. v3: Suggestions from Ville and Thierry. v4: Small fixup that 0day spotted. v5: Slight change to avoid accidental headings in kerneldoc output. Cc: ville.syrjala@linux.intel.com Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1449218769-16577-27-git-send-email-daniel.vetter@ffwll.ch Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> (v3) Reviewed-by: Thierry Reding <treding@nvidia.com> (v3)
2015-12-01drm/edid: Make the detailed timing CEA/HDMI mode fixup accept up to 5kHz ↵Ville Syrjälä1-1/+18
clock difference Rather than using drm_match_cea_mode() to see if the EDID detailed timings are supposed to represent one of the CEA/HDMI modes, add a special version of that function that takes in an explicit clock tolerance value (in kHz). When looking at the detailed timings specify the tolerance as 5kHz due to the 10kHz clock resolution limit inherent in detailed timings. drm_match_cea_mode() uses the normal KHZ2PICOS() matching of clocks, which only allows smaller errors for lower clocks (eg. for 25200 it won't allow any error) and a bigger error for higher clocks (eg. for 297000 it actually matches 296913-297000). So it doesn't really match what we want for the fixup. Using the explicit +-5kHz is much better for this use case. Not sure if we should change the normal mode matching to also use something else besides KHZ2PICOS() since it allows a different proportion of error depending on the clock. I believe VESA CVT allows a maximum deviation of .5%, so using that for normal mode matching might be a good idea? Cc: Adam Jackson <ajax@redhat.com> Tested-by: nathan.d.ciobanu@linux.intel.com Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92217 Fixes: fa3a7340eaa1 ("drm/edid: Fix up clock for CEA/HDMI modes specified via detailed timings") Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-11-24drm: modes: replace simple_strtoul by kstrtouintLABBE Corentin1-5/+11
The simple_strtoul function is marked as obsolete. This patch replace it by kstrtouint. Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-05-22drm/mode: Unstatic kernel-userspace mode conversionDaniel Stone1-0/+87
Move the drm_display_mode <-> drm_mode_modeinfo conversion functions from drm_crtc.c to drm_modes.c, and make them non-static so that others can use them. Signed-off-by: Daniel Stone <daniels@collabora.com> Tested-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-03-23drm: mode: Allow NULL modes for equality checkDaniel Stone1-0/+6
Since we're now using mode == NULL to represent disabled, it's not wholly surprising that we'd want to compare NULL modes. Signed-off-by: Daniel Stone <daniels@collabora.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-03-23drm: mode: Fix typo in kerneldocDaniel Stone1-1/+1
Signed-off-by: Daniel Stone <daniels@collabora.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-03-10drm: Fix trivial typos in commentsYannick Guerrini1-2/+2
Change 'pixes' to 'pixels' Change 'enabel' to 'enable' Change 'enabeling' to 'enabling' Signed-off-by: Yannick Guerrini <yguerrini@tomshardware.fr> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-02-03drm/modes: Print the mode status in human readable formVille Syrjälä1-2/+59
Currently when a mode is rejected the reason is printed as a raw number. Having to manually decode that to a enum drm_mode_status value is tiresome. Have the code do the decoding instead and print the result in a human readable format. Just having an array of strings indexed with the mode status doesn't work since the enum includes negative values. So we offset the status by +3 which makes all the indexes non-negative. Also add a bit of paranoia into the code to catch out of bounds accesses in case someone adds more enum values but forgets to update the code. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-01-21Merge tag 'imx-drm-next-2015-01-09' of ↵Dave Airlie1-0/+40
git://git.pengutronix.de/git/pza/linux into drm-next imx-drm mode fixup support, imx-hdmi bridge conversion and imx-drm cleanup - Implement mode_fixup for a DI vertical timing limitation - Use generic DRM OF helpers in DRM core - Convert imx-hdmi to dw_hdmi drm_bridge and add rockchip driver - Add DC use counter to fix multi-display support - Simplify handling of DI clock flags - A few small fixes and cleanup * tag 'imx-drm-next-2015-01-09' of git://git.pengutronix.de/git/pza/linux: (26 commits) imx-drm: core: handling of DI clock flags to ipu_crtc_mode_set() gpu: ipu-di: Switch to DIV_ROUND_CLOSEST for DI clock divider calc gpu: ipu-v3: Use videomode in struct ipu_di_signal_cfg imx-drm: encoder prepare/mode_set must use adjusted mode imx-drm: ipuv3-crtc: Implement mode_fixup drm_modes: add drm_display_mode_to_videomode gpu: ipu-di: remove some non-functional code gpu: ipu-di: Add ipu_di_adjust_videomode() drm: rockchip: export functions needed by rockchip dw_hdmi bridge driver drm: bridge/dw_hdmi: request interrupt only after initializing the mutes drm: bridge/dw_hdmi: add rockchip rk3288 support dt-bindings: Add documentation for rockchip dw hdmi drm: bridge/dw_hdmi: add function dw_hdmi_phy_enable_spare drm: bridge/dw_hdmi: clear i2cmphy_stat0 reg in hdmi_phy_wait_i2c_done drm: bridge/dw_hdmi: add mode_valid support drm: bridge/dw_hdmi: add support for multi-byte register width access dt-bindings: add document for dw_hdmi drm: imx: imx-hdmi: move imx-hdmi to bridge/dw_hdmi drm: imx: imx-hdmi: split phy configuration to platform driver drm: imx: imx-hdmi: convert imx-hdmi to drm_bridge mode ...
2015-01-10Merge tag 'drm-intel-next-2014-12-19' of ↵Dave Airlie1-10/+16
git://anongit.freedesktop.org/drm-intel into drm-next - plane handling refactoring from Matt Roper and Gustavo Padovan in prep for atomic updates - fixes and more patches for the seqno to request transformation from John - docbook for fbc from Rodrigo - prep work for dual-link dsi from Gaurav Signh - crc fixes from Ville - special ggtt views infrastructure from Tvrtko Ursulin - shadow patch copying for the cmd parser from Brad Volkin - execlist and full ppgtt by default on gen8, for testing for now * tag 'drm-intel-next-2014-12-19' of git://anongit.freedesktop.org/drm-intel: (131 commits) drm/i915: Update DRIVER_DATE to 20141219 drm/i915: Hold runtime PM during plane commit drm/i915: Organize bind_vma funcs drm/i915: Organize INSTDONE report for future. drm/i915: Organize PDP regs report for future. drm/i915: Organize PPGTT init drm/i915: Organize Fence registers for future enablement. drm/i915: tame the chattermouth (v2) drm/i915: Warn about missing context state workarounds only once drm/i915: Use true PPGTT in Gen8+ when execlists are enabled drm/i915: Skip gunit save/restore for cherryview drm/i915/chv: Use timeout mode for RC6 on chv drm/i915: Add GPGPU_THREADS_DISPATCHED to the register whitelist drm/i915: Tidy up execbuffer command parsing code drm/i915: Mark shadow batch buffers as purgeable drm/i915: Use batch length instead of object size in command parser drm/i915: Use batch pools with the command parser drm/i915: Implement a framework for batch buffer pools drm/i915: fix use after free during eDP encoder destroying drm/i915/skl: Skylake also supports DP MST ...
2015-01-07drm_modes: add drm_display_mode_to_videomodeSteve Longerbeam1-0/+40
Add conversion from drm_display_mode to videomode. Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2014-12-17drm: Perform basic sanity checks on probed modesVille Syrjälä1-0/+32
Make sure the timings of probed modes at least pass some very basic sanity checks. The checks include: - clock,hdisplay,vdisplay are non zero - sync pulse fits within the blanking period - htotal,vtotal are big enough I have not checked all the drivers to see if the modes the generate might violate these constraints. I'm hoping not, because that would mean either abandoning the idea of doing this from the core code, or fixing the drivers. I'm not entirely sure about limiting the sync pulse to the blanking period. Intel hardware doesn't support such things, but some other hardware might. However at least HDMI doesn't allow having sync pulse edges within the active period, so I'm thinking the check is probably OK to have in the common code. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-12-17drm: Reorganize probed mode validationVille Syrjälä1-12/+12
Make drm_mode_validate_size() and drm_mode_validate_flag() deal with a single mode instead of having each iterate through the mode list. The hope is that in the future we might be able to share various mode validation functions between modeset and get_modes. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-12-05drm: add helper to get crtc timings (v5)Gustavo Padovan1-10/+16
We need to get hdisplay and vdisplay in a few places so create a helper to make our job easier. Note that drm_crtc_check_viewport() and intel_modeset_pipe_config() were previously making adjustments for doublescan modes and vscan > 1 modes, which was incorrect. Using our new helper fixes this mistake. v2 (by Matt): Use new stereo doubling function (suggested by Ville) v3 (by Matt): - Add missing kerneldoc (Daniel) - Use drm_mode_copy() (Jani) v4 (by Matt): - Drop stereo doubling function again; add 'stereo only' flag to drm_mode_set_crtcinfo() instead (Ville) v5 (by Matt): - Note behavioral change in drm_crtc_check_viewport() and intel_modeset_pipe_config(). (Ander) - Describe new adjustment flags in drm_mode_set_crtcinfo()'s kerneldoc. (Ander) Cc: dri-devel@lists.freedesktop.org Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Acked-by: Dave Airlie <airlied@gmail.com> Reviewed-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-10-21gpu:drm: Fix typo in Documentation/DocBook/drm.xmlMasanari Iida1-1/+1
This patch fix spelling typos found in drm.xml. It is because the file is generated from comments in source codes, I have to fix the typos within source files. Signed-off-by: Masanari Iida <standby24x7@gmail.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-08-06drm: Perform cmdline mode parsing during connector initialisationChris Wilson1-0/+1
i915.ko has a custom fbdev initialisation routine that aims to preserve the current mode set by the BIOS, unless overruled by the user. The user's wishes are determined by what, if any, mode is specified on the command line (via the video= parameter). However, that command line mode is first parsed by drm_fb_helper_initial_config() which is called after i915.ko's custom initial_config() as a fallback method. So in order for us to honour it, we need to move the cmdline parser earlier. If we perform the connector cmdline parsing as soon as we initialise the connector, that cmdline mode and forced status is then available even if the fbdev helper is not compiled in or never called. We also then expose the cmdline user mode in the connector mode lists. v2: Rebase after connector->name upheaval. v3: Adapt mga200 to look for the cmdline mode in the new place. Nicely simplifies things while at that. v4: Fix checkpatch. v5: Select FB_CMDLINE to adapt to the changed fbdev patch. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73154 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> (v2) Cc: Jesse Barnes <jbarnes@virtuousgeek.org> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> (v2) Cc: dri-devel@lists.freedesktop.org Cc: Julia Lemire <jlemire@matrox.com> Cc: Dave Airlie <airlied@redhat.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-01drm: try harder to avoid regression when merging mode bitsDave Airlie1-2/+7
For QXL hw we really want the bits to be replaced as we change the preferred mode on the fly, and the same goes for virgl when I get to it, however the original fix for this seems to have caused a wierd regression on Intel G33 that in a stunning display of failure at opposition to his normal self, Daniel failed to diagnose. So we are left doing this, ugly ugly ugly ugly, Daniel you fixed that G33 yet?, ugly, ugly. Tested-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-03-13drm: polish function kerneldoc for drm_modes.[hc]Daniel Vetter1-65/+106
- Tune down yelling RETURNS. - OCD align all the parameters the same. - Add missing kerneldoc, which also means that we need to include the kerneldoc from the drm_modes.h header now. - Add missing Returns: sections. - General polish and clarification - especially the kerneldoc for the mode creation helpers seems to have been some good specimen of copypasta gone wrong. All actual code changes have all been extracted into prep patches since there was simply too much to polish. v2: More polish for the command line modeline functions. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-13drm/modes: drop maxPitch from drm_mode_validate_sizeDaniel Vetter1-5/+1
Totally unused and actually redundant with maxX for display mode validation. The fb helper otoh needs to check pitch limits, but that is delegated into drivers instead. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-13drm/modes: drop return value from drm_display_mode_from_videomodeDaniel Vetter1-4/+2
It never fails and no one ever checked anyway. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-13drm/modes: remove drm_mode_height/widthDaniel Vetter1-35/+0
There's a neat FIXME asking whether this is really need. I'd say really no. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-13drm: extract drm_modes.h for drm_crtc.h functionsDaniel Vetter1-0/+1
I want to also include kerneldoc from the header (for static inline functions and structs), but fishing the right pieces out of a giant header is a real pain. So split things out. Note that it's not a really clean header with sane include orders, but given's drm historical knack for giant headers detangling this is a major task. v2: Also extract struct drm_cmdline_mode. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-13drm: move drm_mode related functions into drm_modes.cDaniel Vetter1-0/+62
Makes more sense and gives better grouping in the DocBook function reference sections. To make this possible we need to expose two functions from drm_crtc.c though. To avoid further namespace pollution in the system wide headers create a new internal header for such drm internal symbols. I expect that longer-term we'll add tons more, but since my goal here is to polish the kerneldoc that's for another day. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-13drm/doc: Repleace LOCKING kerneldoc sections in drm_modes.cDaniel Vetter1-57/+2
There's not really any value in stating that no locking is needed. And even if the comment is useful, a check for the right mutex at the beginning of the function is better since that can't be ingored as easily as a bit of documentation. Note that drm_mode_probed_add in drm_crtc.c is also changed, the next patch will move this into drm_modes.c v2: Don't add locking WARN_ONs where it is not strictly required (i.e. the two functions to validate/prune mode lists). Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-13drm/doc: Integrate drm_modes.c kerneldocDaniel Vetter1-11/+17
And clean it up so that there's no kerneldoc warnings. There's still a lot to do with this one here. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-01-14Revert "drm: copy mode type in drm_mode_connector_list_update()"Dave Airlie1-1/+1
This reverts commit 3fbd6439e4639ecaeaae6c079e0aa497a1ac3482. This caused some strange booting lockup issues on an Intel G33 belonging to Daniel Vetter, very unusual, I was hoping Daniel would track this down, but it looks like instead I'll have to hack a different fix for -next. Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-10-23drm: copy mode type in drm_mode_connector_list_update()Marc-André Lureau1-1/+1
In commit 38d5487db7f289be1d56ac7df704ee49ed3213b9, Keith explained: This patch simply merges the two mode type bits together; that seems reasonable to me, but perhaps only a subset of the bits should be used? None of these can be user defined as they all come from looking at just the hardware. However, merging the bits means that a flag becomes sticky. It is not possible, for example to update the mode type to remove the DRM_MODE_TYPE_PREFERRED bit. After a brief discussion with Dave Airlie on irc, it was agreed to propose that change, instead of introducing another function to remove a bit from exisiting modes type. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-10-01drm: Implement timings adjustments for frame packingDamien Lespiau1-1/+21
When using the frame packing and a single big framebuffer, some hardware requires that we do everything like if we were scanning out the big buffer itself. Let's instrument drm_mode_set_crtcinfo() to be able to do this adjustement if the driver is asking for it. v2: Use crtc_vtotal and multiply the clock by 2 instead of reconstructing it (Ville Syrjälä) Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Acked-by: Dave Airlie <airlied@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-01drm: Introduce a crtc_clock for struct drm_display_modeDamien Lespiau1-0/+1
Just like the various timings, make it possible to have a clock field what we can tweak before giving it to hardware. Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Acked-by: Dave Airlie <airlied@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-01drm: Make drm_match_cea_mode() return the underlying 2D VIC for 3d modesDamien Lespiau1-6/+12
When scanning out a stereo mode, the AVI infoframe vic field has to be the underlyng 2D VIC. Before that commit, we weren't matching the CEA mode because of the extra stereo flag and then were setting the VIC field in the AVI infoframe to 0. Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Acked-by: Dave Airlie <airlied@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-21drm: Remove drm_mode_list_concat()Lespiau, Damien1-21/+0
The last user was removed in commit 575dc34ee0de867ba83abf25998e0963bff451fa Author: Dave Airlie <airlied@redhat.com> Date: Mon Sep 7 18:43:26 2009 +1000 drm/kms: remove old std mode fallback code. The new code adds modes in the helper, which makes more sense I disliked the non-driver code adding modes. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-08-19drm: Remove drm_mode_validate_clocksStéphane Marchesin1-37/+0
This function is unused. Signed-off-by: Stéphane Marchesin <marcheu@chromium.org> Reviewed-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-06-11drm: Sort connector modes based on vrefreshVille Syrjälä1-0/+5
Keeping the modes sorted by vrefresh before the pixel clock makes the mode list somehow more pleasing to the eye. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-06-11drm: Preserve the list head in drm_mode_copyVille Syrjälä1-3/+4
Preserve the destination mode's list head in drm_mode_copy. Just in case someone decides that it's a good idea to overwrite a mode which happens to be on some list, Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-06-03drm_modes: videomode: add doubleclk flagSteffen Trumtrar1-0/+2
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-05-13Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linuxLinus Torvalds1-0/+1
Pull drm fixes from Dave Airlie: "Just a few straggling fixes I hoovered up, and an intel fixes pull from Daniel which fixes some regressions, and some mgag200 fixes from Matrox." * 'drm-next' of git://people.freedesktop.org/~airlied/linux: drm/mgag200: Fix framebuffer base address programming drm/mgag200: Convert counter delays to jiffies drm/mgag200: Fix writes into MGA1064_PIX_CLK_CTL register drm/mgag200: Don't change unrelated registers during modeset drm: Only print a debug message when the polled connector has changed drm: Make the HPD status updates debug logs more readable drm: Use names of ioctls in debug traces drm: Remove pointless '-' characters from drm_fb_helper documentation drm: Add kernel-doc for drm_fb_helper_funcs->initial_config drm: refactor call to request_module drm: Don't prune modes loudly when a connector is disconnected drm: Add missing break in the command line mode parsing code drm/i915: clear the stolen fb before resuming Revert "drm/i915: Calculate correct stolen size for GEN7+" drm/i915: hsw: fix link training for eDP on port-A Revert "drm/i915: revert eDP bpp clamping code changes" drm: don't check modeset locks in panic handler drm/i915: Fix pipe enabled mask for pipe C in WM calculations drm/mm: fix dump table BUG drm/i915: Always normalize return timeout for wait_timeout_ioctl
2013-05-10drm: Add missing break in the command line mode parsing codeDamien Lespiau1-0/+1
As we parse the string given on the command line one char at a time, it seems that we do want a break at every case. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-05-02Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linuxLinus Torvalds1-1/+21
Pull drm updates from Dave Airlie: "This is the main drm pull request for 3.10. Wierd bits: - OMAP drm changes required OMAP dss changes, in drivers/video, so I took them in here. - one more fbcon fix for font handover - VT switch avoidance in pm code - scatterlist helpers for gpu drivers - have acks from akpm Highlights: - qxl kms driver - driver for the spice qxl virtual GPU Nouveau: - fermi/kepler VRAM compression - GK110/nvf0 modesetting support. Tegra: - host1x core merged with 2D engine support i915: - vt switchless resume - more valleyview support - vblank fixes - modesetting pipe config rework radeon: - UVD engine support - SI chip tiling support - GPU registers initialisation from golden values. exynos: - device tree changes - fimc block support Otherwise: - bunches of fixes all over the place." * 'drm-next' of git://people.freedesktop.org/~airlied/linux: (513 commits) qxl: update to new idr interfaces. drm/nouveau: fix build with nv50->nvc0 drm/radeon: fix handling of v6 power tables drm/radeon: clarify family checks in pm table parsing drm/radeon: consolidate UVD clock programming drm/radeon: fix UPLL_REF_DIV_MASK definition radeon: add bo tracking debugfs drm/radeon: add new richland pci ids drm/radeon: add some new SI PCI ids drm/radeon: fix scratch reg handling for UVD fence drm/radeon: allocate SA bo in the requested domain drm/radeon: fix possible segfault when parsing pm tables drm/radeon: fix endian bugs in atom_allocate_fb_scratch() OMAPDSS: TFP410: return EPROBE_DEFER if the i2c adapter not found OMAPDSS: VENC: Add error handling for venc_probe_pdata OMAPDSS: HDMI: Add error handling for hdmi_probe_pdata OMAPDSS: RFBI: Add error handling for rfbi_probe_pdata OMAPDSS: DSI: Add error handling for dsi_probe_pdata OMAPDSS: SDI: Add error handling for sdi_probe_pdata OMAPDSS: DPI: Add error handling for dpi_probe_pdata ...
2013-04-26drm: Add drm_mode_equal_no_clocks()Ville Syrjälä1-1/+21
drm_mode_equal_no_clocks() is like drm_mode_equal() except it doesn't compare the clock or vrefresh values. drm_mode_equal() is now implemented by first doing the clock checks, and then calling drm_mode_equal_no_clocks(). v2: Add missing EXPORT_SYMBOL() Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-03-12videomode: combine videomode dmt_flags and data_flagsTomi Valkeinen1-6/+6
Both videomode and display_timing contain flags describing the modes. These are stored in dmt_flags and data_flags. There's no need to separate these flags, and having separate fields just makes the flags more difficult to use. This patch combines the fields and renames VESA_DMT_* flags to DISPLAY_FLAGS_*. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Steffen Trumtrar <s.trumtrar@pengutronix.de>
2013-03-12videomode: simplify videomode Kconfig and MakefileTomi Valkeinen1-4/+4
This patch simplifies videomode related Kconfig and Makefile. After this patch, there's only one non-user selectable Kconfig option left, VIDEOMODE_HELPERS. The reasons for the change: * Videomode helper functions are not something that should be shown in the kernel configuration options. The related code should just be included if it's needed, i.e. selected by drivers using videomode. * There's no need to have separate Kconfig options for videomode and display_timing. First of all, the amount of code for both is quite small. Second, videomode depends on display_timing, and display_timing in itself is not really useful, so both would be included in any case. * CONFIG_VIDEOMODE is a bit vague name, and CONFIG_VIDEOMODE_HELPERS describes better what's included. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Steffen Trumtrar <s.trumtrar@pengutronix.de> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2013-01-24drm_modes: add of_videomode helpersSteffen Trumtrar1-0/+33
Add helper to get drm_display_mode from devicetree. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de> Acked-by: Thierry Reding <thierry.reding@avionic-design.de> Tested-by: Thierry Reding <thierry.reding@avionic-design.de> Tested-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Afzal Mohammed <Afzal@ti.com> Tested-by: Rob Clark <robclark@gmail.com> Tested-by: Leela Krishna Amudala <leelakrishna.a@gmail.com>
2013-01-24drm_modes: add videomode helpersSteffen Trumtrar1-0/+37
Add conversion from videomode to drm_display_mode Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de> Acked-by: Thierry Reding <thierry.reding@avionic-design.de> Tested-by: Thierry Reding <thierry.reding@avionic-design.de> Tested-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Afzal Mohammed <Afzal@ti.com> Tested-by: Rob Clark <robclark@gmail.com> Tested-by: Leela Krishna Amudala <leelakrishna.a@gmail.com>