summaryrefslogtreecommitdiff
path: root/drivers/gpu
AgeCommit message (Collapse)Author
2016-08-16drm: Extract drm_connector.[hc]Daniel Vetter
Pulls in quite a lot of connector related structures (cmdline mode, force/status enums, display info), but I think that all makes perfect sense. Also had to move a few more core kms object stuff into drm_modeset.h. And as a first cleanup remove the kerneldoc for the 2 connector IOCTL - DRM core docs are aimed at drivers, no point documenting internal in excruciating detail. v2: And also pull in all the connector property code. Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1471034937-651-14-git-send-email-daniel.vetter@ffwll.ch
2016-08-16drm: Export drm_property_replace_global_blobDaniel Vetter
It's really part of the core blob interface, and the drm_connector.c extraction needs it too. Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1471034937-651-13-git-send-email-daniel.vetter@ffwll.ch
2016-08-16drm: update kerneldoc for changes introduced by commits "16fadc2568e9" and ↵Lothar Waßmann
"9671e228fb78" Describe the new parameter 'bus_flags' to of_get_drm_display_mode() in the kerneldoc comments and add kerneldoc comments to the new function drm_bus_flags_from_videomode(). Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1471354477-25877-1-git-send-email-LW@KARO-electronics.de
2016-08-16drm/doc: Update drm_framebuffer docsDaniel Vetter
- Move the intro section into a DOC comment, and update it slightly. - kernel-doc for struct drm_framebuffer! v2: - Copypaste fail (Sean). - Explain the linear @offsets clearer (Ville). Cc: Sean Paul <seanpaul@chromium.org> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1471034937-651-12-git-send-email-daniel.vetter@ffwll.ch
2016-08-16drm: Extract drm_framebuffer.[hc]Daniel Vetter
Also start with drm_modeset.h with the core bits, since we need to untangle this mess somehow. That allows us to move the drm_modes.h include to the right spot, except for the temporary connector status enum. That will get fixed as soon as drm_connector.h exists. v2: Rebase. v3: Move drm_crtc_force_disable_all back again, that wasn't meant to be moved (Sean). v4: Rebase. Cc: Sean Paul <seanpaul@chromium.org> Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-08-16drm/kms: Nuke dirty_info propertyDaniel Vetter
It was added way back together with the dirty_fb ioctl, but neither generic xfree86-modesetting nor the vmware driver use it. Everyone is supposed to just unconditionally call the dirtyfb when they do frontbuffer rendering. And since unused uabi is bad uabi (there's reasons we require open source userspace for everything) let's nuke this. For reference see commit 884840aa3ce3214259e69557be5b4ce0d781ffa4 Author: Jakob Bornecrantz <jakob@vmware.com> Date: Thu Dec 3 23:25:47 2009 +0000 drm: Add dirty ioctl and property Cc: Jakob Bornecrantz <jakob@vmware.com> Cc: Dave Airlie <airlied@redhat.com> Cc: Sinclair Yeh <syeh@vmware.com> Cc: Thomas Hellstrom <thellstrom@vmware.com> Acked-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1471034937-651-9-git-send-email-daniel.vetter@ffwll.ch
2016-08-16drm/hisilicon: Don't set drm_device->platformdevDaniel Vetter
It's deprecated and only should be used by drivers which still use drm_platform_init, not by anyone else. And indeed it's entirely unused and can be nuked. This required a bit more fudging, but I guess kirin_dc_ops really wants to operate on the platform_device, not something else. Also bonus points for implementing abstraction, and then storing the vfunc in a global variable. Cc: Xinliang Liu <xinliang.liu@linaro.org> Cc: Xinwei Kong <kong.kongxinwei@hisilicon.com> Cc: Archit Taneja <architt@codeaurora.org> Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1471034937-651-7-git-send-email-daniel.vetter@ffwll.ch
2016-08-16drm/etnaviv: Don't set drm_device->platformdevDaniel Vetter
It's deprecated and only should be used by drivers which still use drm_platform_init, not by anyone else. And indeed it's entirely unused and can be nuked. Cc: Lucas Stach <l.stach@pengutronix.de> Cc: Russell King <rmk+kernel@arm.linux.org.uk> Cc: Christian Gmeiner <christian.gmeiner@gmail.com> Acked-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1471034937-651-6-git-send-email-daniel.vetter@ffwll.ch
2016-08-16drm/kms-helpers: Extract drm_modeset_helper.[hc]Daniel Vetter
While reviewing docs I spotted that we have a few functions that really just don't fit into their containing helper library section. Extract them and shovel them all into a new library for random one-off aux stuff. v2: Remove wrongly added files for real. Cc: Sean Paul <seanpaul@chromium.org> Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1471034937-651-3-git-send-email-daniel.vetter@ffwll.ch
2016-08-16drm/doc: Fix more kerneldoc/sphinx warningsDaniel Vetter
These are the leftovers I could only track down using keep_warnings = True. For some of them we might want to update our style guide on how to reference structures and constants, not sure ... Cc: Markus Heiser <markus.heiser@darmarit.de> Cc: Jonathan Corbet <corbet@lwn.net> Cc: linux-doc@vger.kernel.org Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1471034937-651-1-git-send-email-daniel.vetter@ffwll.ch
2016-08-16drm: drop DRIVER_HAVE_IRQ flag for some driversShawn Guo
Since commit 4984979b9b90 ("drm/irq: simplify irq checks in drm_wait_vblank"), the drm driver feature flag DRIVER_HAVE_IRQ is only required for drivers that have an IRQ handler managed by the DRM core. Some drivers, armada, etnaviv, kirin and sti, set this flag without .irq_handler setup in drm_driver. These drivers manage IRQ handler by themselves and the flag DRIVER_HAVE_IRQ makes no sense there. Drop the flag for these drivers to avoid confusion. Signed-off-by: Shawn Guo <shawnguo@kernel.org> Cc: Vincent Abriou <vincent.abriou@st.com> Cc: Xinliang Liu <z.liuxinliang@hisilicon.com> Acked-by: Russell King <rmk+kernel@armlinux.org.uk> (for armada and etnaviv) Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1471331168-5601-1-git-send-email-shawnguo@kernel.org
2016-08-16drm: remove `const` attribute to hint at caller that they now own the memoryEric Engestrom
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-08-16drm/mgag200: fix error return code in mgag200fb_create()Wei Yongjun
Fix to return error code -ENOMEM from the vmalloc() error handling case instead of 0, as done elsewhere in this function. Fixes: aec9e12953e7 ("drm/mgag200: Fix error handling paths in fbdev driver") Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1471273431-6753-1-git-send-email-weiyj.lk@gmail.com
2016-08-15drm: make drm_get_format_name thread-safeEric Engestrom
Signed-off-by: Eric Engestrom <eric@engestrom.ch> [danvet: Clarify that the returned pointer must be freed with kfree().] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-08-15Merge tag 'drm-intel-next-2016-08-08' of ↵Dave Airlie
git://anongit.freedesktop.org/drm-intel into drm-next - refactor ddi buffer programming a bit (Ville) - large-scale renaming to untangle naming in the gem code (Chris) - rework vma/active tracking for accurately reaping idle mappings of shared objects (Chris) - misc dp sst/mst probing corner case fixes (Ville) - tons of cleanup&tunings all around in gem - lockless (rcu-protected) request lookup, plus use it everywhere for non(b)locking waits (Chris) - pipe crc debugfs fixes (Rodrigo) - random fixes all over * tag 'drm-intel-next-2016-08-08' of git://anongit.freedesktop.org/drm-intel: (222 commits) drm/i915: Update DRIVER_DATE to 20160808 drm/i915: fix aliasing_ppgtt leak drm/i915: Update comment before i915_spin_request drm/i915: Use drm official vblank_no_hw_counter callback. drm/i915: Fix copy_to_user usage for pipe_crc Revert "drm/i915: Track active streams also for DP SST" drm/i915: fix WaInsertDummyPushConstPs drm/i915: Assert that the request hasn't been retired drm/i915: Repack fence tiling mode and stride into a single integer drm/i915: Document and reject invalid tiling modes drm/i915: Remove locking for get_tiling drm/i915: Remove pinned check from madvise ioctl drm/i915: Reduce locking inside swfinish ioctl drm/i915: Remove (struct_mutex) locking for busy-ioctl drm/i915: Remove (struct_mutex) locking for wait-ioctl drm/i915: Do a nonblocking wait first in pread/pwrite drm/i915: Remove unused no-shrinker-steal drm/i915: Tidy generation of the GTT mmap offset drm/i915/shrinker: Wait before acquiring struct_mutex under oom drm/i915: Simplify do_idling() (Ironlake vt-d w/a) ...
2016-08-15Merge tag 'topic/drm-misc-2016-08-12' of ↵Dave Airlie
git://anongit.freedesktop.org/drm-intel into drm-next - more fence destaging and cleanup (Gustavo&Sumit) - DRIVER_LEGACY to untangle from DRIVER_MODESET - drm_mm refactor (Chris) - fbdev-less compile fies - clipped plane src/dst rects (Ville) - + a few mediatek patches that build on top of that (Bibby+Daniel) - small stuff all over really * tag 'topic/drm-misc-2016-08-12' of git://anongit.freedesktop.org/drm-intel: (43 commits) dma-buf/fence: kerneldoc: remove spurious section header dma-buf/fence: kerneldoc: remove unused struct members Revert "gpu: drm: omapdrm: dss-of: add missing of_node_put after calling of_parse_phandle" drm: Protect fb_defio in drivers with CONFIG_KMS_FBDEV_EMULATION drm/radeon|amgpu: Make fbdev emulation optional drm/vmwgfx: select CONFIG_FB drm: Remove superflous linux/fb.h includes drm/fb-helper: Add a dummy remove_conflicting_framebuffers dma-buf/sync_file: only enable fence signalling on poll() Documentation: add doc for sync_file_get_fence() dma-buf/sync_file: add sync_file_get_fence() dma-buf/sync_file: refactor fence storage in struct sync_file dma-buf/fence-array: add fence_is_array() drm/dp_helper: Rate limit timeout errors from drm_dp_i2c_do_msg() drm/dp_helper: Print first error received on failure in drm_dp_dpcd_access() drm: Add ratelimited versions of the DRM_DEBUG* macros drm: Make sure drm_vblank_no_hw_counter isn't abused drm/mediatek: Fix mtk_atomic_complete for runtime_pm drm/mediatek: plane: Use FB's format's cpp to compute x offset drm/mediatek: plane: Merge mtk_plane_enable into mtk_plane_atomic_update ...
2016-08-15Merge tag 'imx-drm-next-2016-08-12' of ↵Dave Airlie
git://git.pengutronix.de/git/pza/linux into drm-next imx-drm updates and encoder atomic_mode_set helper callback - add pixel clock and DE polarity configuration from device tree using display timing bindings for parallel and LVDS output - cleanup/remove trivial functions - cleanup and fixes in preparation for capture support - add atomic_mode_set helper and use it in imx-ldb - this is an alternative to the encoder mode_set callback that passes the crtc and connector state instead of just the mode. It allows drivers to get information from the attached connector without having to iterate over all connectors - add drm_bridge support to imx-ldb, for bridges attached via LVDS * tag 'imx-drm-next-2016-08-12' of git://git.pengutronix.de/git/pza/linux: drm/imx-ldb: Add support to drm-bridge drm/imx: imx-ldb: use encoder atomic_mode_set callback drm/atomic-helper: Add atomic_mode_set helper callback drm/imx: Remove imx_drm_handle_vblank() gpu: ipu-v3: Add missing IDMAC channel names gpu: ipu-v3: rename CSI client device gpu: ipu-v3: Fix IRT usage gpu: ipu-v3: Fix CSI data format for 16-bit media bus formats gpu: ipu-v3: set correct full sensor frame for PAL/NTSC gpu: ipu-v3: Add VDI input IDMAC channels gpu: ipu-v3: Add ipu_get_num() gpu: ipu-cpmem: Add ipu_cpmem_get_burstsize() gpu: ipu-cpmem: Add ipu_cpmem_set_uv_offset() drm/imx: Remove imx_drm_crtc_id() drm/imx: Remove imx_drm_crtc_vblank_get/_put() drm/imx: convey the pixelclk-active and de-active flags from DT to the ipu-di driver drm: add a helper function to extract 'de-active' and 'pixelclk-active' from DT
2016-08-15Merge tag 'mediatek-drm-next-2016-08-12' of ↵Dave Airlie
git://git.pengutronix.de/git/pza/linux into drm-next mediatek-drm maintainers and gamma correction - add MAINTAINERS entry for mediatek-drm driver - add support for AAL and GAMMA engines - hook up gamma correction LUT - add support for temporal dithering to OD and GAMMA engines * tag 'mediatek-drm-next-2016-08-12' of git://git.pengutronix.de/git/pza/linux: drm/mediatek: set mt8173 dithering function drm/mediatek: Add gamma correction. drm/mediatek: Add GAMMA engine basic function drm/mediatek: Add AAL engine basic function drm: mediatek: add Maintainers entry for Mediatek DRM drivers
2016-08-15Merge branch 'drm-next-tilcdc-atomic' of https://github.com/jsarha/linux ↵Dave Airlie
into drm-next Please pull tilcdc atomic modeset support and some non critical fixes. * 'drm-next-tilcdc-atomic' of https://github.com/jsarha/linux: (29 commits) drm/tilcdc: Change tilcdc_crtc_page_flip() to tilcdc_crtc_update_fb() drm/tilcdc: Remove unnecessary pm_runtime_get() and *_put() calls drm/tilcdc: Get rid of legacy dpms mechanism drm/tilcdc: Use drm_atomic_helper_resume/suspend() drm/tilcdc: Enable and disable interrupts in crtc start() and stop() drm/tilcdc: tfp410: Add atomic modeset helpers to connector funcs drm/tilcdc: tfp410: Set crtc panel info at init phase drm/tilcdc: panel: Add atomic modeset helpers to connector funcs drm/tilcdc: panel: Set crtc panel info at init phase drm/tilcdc: Remove tilcdc_verify_fb() drm/tilcdc: Remove obsolete crtc helper functions drm/tilcdc: Set DRIVER_ATOMIC and use atomic crtc helpers drm/tilcdc: Add drm_mode_config_reset() call to tilcdc_load() drm/tilcdc: Add atomic mode config funcs drm/tilcdc: Add tilcdc_crtc_atomic_check() drm/tilcdc: Add tilcdc_crtc_mode_set_nofb() drm/tilcdc: Initialize dummy primary plane from crtc init drm/tilcdc: Add dummy primary plane implementation drm/tilcdc: Make tilcdc_crtc_page_flip() work if crtc is not yet on drm/tilcdc: Make tilcdc_crtc_page_flip() public ...
2016-08-12Revert "gpu: drm: omapdrm: dss-of: add missing of_node_put after calling ↵Peter Chen
of_parse_phandle" This reverts commit 2ab9f5879162499e1c4e48613287e3f59e593c4f Author: Peter Chen <peter.chen@nxp.com> Date: Fri Jul 15 11:17:03 2016 +0800 gpu: drm: omapdrm: dss-of: add missing of_node_put after calling of_parse_phandle The of_get_next_parent will drop refcount on the passed node, so the reverted patch is wrong, thanks for Tomi Valkeinen points it. Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Signed-off-by: Peter Chen <peter.chen@nxp.com> Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/1470908694-16362-1-git-send-email-peter.chen@nxp.com
2016-08-12drm: Protect fb_defio in drivers with CONFIG_KMS_FBDEV_EMULATIONDaniel Vetter
For reasons that entirely elude me fb.h exposes all the structures, even when it is not enabled. Except for special stuff like fb_defio. Which means all the drivers which haven't yet switched over to the defio support in the helpers and still roll their own, will fail to compile when fbdev emulation is disabled. Protect just those bits, as a gnarly reminder that conversion to the core defio helpers would be good. Cc: Dave Airlie <airlied@redhat.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1470847958-28465-6-git-send-email-daniel.vetter@ffwll.ch
2016-08-12drm/radeon|amgpu: Make fbdev emulation optionalDaniel Vetter
Seems to at least compile fine, only change needed was to use the fb_set_suspend helper. Cc: alexander.deucher@amd.com Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1470847958-28465-5-git-send-email-daniel.vetter@ffwll.ch
2016-08-12drm/vmwgfx: select CONFIG_FBDaniel Vetter
vmwgfx doesn't actually build without that. It would be great if vmwgfx could switch over to the fbdev emulation helpers, since those will take care of all this already. I guess one reason to not do that was lack of defio support in the helpers, but that's fixed now. If there's any other hold-up, we should figure out what it is and whether it makes sense to address it. Cc: Sinclair Yeh <syeh@vmware.com> Cc: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1470847958-28465-4-git-send-email-daniel.vetter@ffwll.ch
2016-08-12drm: Remove superflous linux/fb.h includesDaniel Vetter
Everyone who uses the fbdev emulation helpers doesn't need to include fb.h directly. Remove it. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1470847958-28465-3-git-send-email-daniel.vetter@ffwll.ch
2016-08-12drm/fb-helper: Add a dummy remove_conflicting_framebuffersDaniel Vetter
Lots of drivers don't properly compile without this when CONFIG_FB=n. It's kinda a hack, but since CONFIG_FB doesn't stub any fucntions when it's disabled I think it makes sense to add it to drm_fb_helper.h. Long term we probably need to rethink all the logic to unload firmware framebuffer drivers, at least if we want to be able to move away from CONFIG_FB and fbcon. v2: Unfortunately just stubbing out remove_conflicting_framebuffers in drm_fb_helper.h upset gcc about static vs. non-static declarations, so a new wrapper it needs to be. Means more churn :( Cc: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Cc: Noralf Trønnes <noralf@tronnes.org> Cc: tomi.valkeinen@ti.com Cc: dh.herrmann@gmail.com Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1470847958-28465-2-git-send-email-daniel.vetter@ffwll.ch
2016-08-11drm/imx-ldb: Add support to drm-bridgePeter Senna Tschudin
Add support to attach a drm_bridge to imx-ldb in addition to existing support to attach a LVDS panel. This patch does a simple code refactoring by moving code from for_each_child_of_node iterator to a new function named imx_ldb_panel_ddc(). This was necessary to allow the panel ddc code to run only when the imx_ldb is not attached to a bridge. Cc: Enric Balletbo i Serra <enric.balletbo@collabora.com> Cc: Philipp Zabel <p.zabel@pengutronix.de> Cc: Rob Herring <robh@kernel.org> Cc: Fabio Estevam <fabio.estevam@nxp.com> Cc: David Airlie <airlied@linux.ie> Cc: Thierry Reding <treding@nvidia.com> Cc: Thierry Reding <thierry.reding@gmail.com> Signed-off-by: Peter Senna Tschudin <peter.senna@collabora.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-08-11drm/mediatek: set mt8173 dithering functionBibby Hsieh
Some panels only accept bpc (bit per color) 6-bit. But, the default bpc in mt8173 display data path is 8-bit. If we didn't enable dithering function to convert bpc, display cannot show the smooth grayscale image. In mt8173, the dithering function in OD (OverDrive) and GAMMA module, we have to config them with connector->display_mode.bpc when CRTC initial. 1. Clear the default value at *_DITHER_5 and *_DITHER_7 register. 2. Calculate the LSB_ERR_SHIFT bits and ADD_LSHIFT bits two values. i.e. Input bpc of OD is 10 bits, we assume the bpc of panel is 6-bit, so, we need to set 4-bit to LSB_ERR_SHIFT and ADD_LSHIFT bits respectively. 3. Then, set the OD or GAMMA to dithering mode depends on path-1 or path-2. Signed-off-by: Bibby Hsieh <bibby.hsieh@mediatek.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-08-11drm/mediatek: Add gamma correction.Bibby Hsieh
Add gamma set function to correct brightness values. It applies arbitrary mapping curve to compensate the incorrect transfer function of the panel. Signed-off-by: Bibby Hsieh <bibby.hsieh@mediatek.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-08-11drm/mediatek: Add GAMMA engine basic functionBibby Hsieh
In order to correct brightness values, we have to support gamma funciton on MT8173. In MT8173, we have two engines for supporting gamma function: AAL and GAMMA. This patch add some GAMMA engine basic function, include config, start and stop function. Signed-off-by: Bibby Hsieh <bibby.hsieh@mediatek.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-08-11drm/mediatek: Add AAL engine basic functionBibby Hsieh
In order to correct brightness values, we have to support gamma funciton on MT8173. In MT8173, we have two engines for supporting gamma function: AAL and GAMMA. This patch add some AAL engine basic function, include config, start and stop function. Signed-off-by: Bibby Hsieh <bibby.hsieh@mediatek.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-08-09drm/dp_helper: Rate limit timeout errors from drm_dp_i2c_do_msg()Lyude
Timeouts can be errors, but timeouts are also usually normal behavior and happen a lot. Since the kernel already lets us know when we're suppressing messages due to rate limiting, rate limit timeout errors so we don't make too much noise in the kernel log. Signed-off-by: Lyude <cpaul@redhat.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1470443443-27252-8-git-send-email-cpaul@redhat.com
2016-08-09drm/dp_helper: Print first error received on failure in drm_dp_dpcd_access()Lyude
Since we always retry in drm_dp_dpcd_access() regardless of the error, we're going to make a lot of noise if the aux->transfer function prints it's own errors (as is the case with radeon). If we can print the error code here, this reduces the need for drivers to do this. So instead of having to print "dp_aux_ch timed out" over 32 times we can just print once. Signed-off-by: Lyude <cpaul@redhat.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1470443443-27252-2-git-send-email-cpaul@redhat.com
2016-08-09drm/cirrus: Fix NULL pointer dereference when registering the fbdevBoris Brezillon
cirrus_modeset_init() is initializing/registering the emulated fbdev and, since commit c61b93fe51b1 ("drm/atomic: Fix remaining places where !funcs->best_encoder is valid"), DRM internals can access/test some of the fields in mode_config->funcs as part of the fbdev registration process. Make sure dev->mode_config.funcs is properly set to avoid dereferencing a NULL pointer. Reported-by: Mike Marshall <hubcap@omnibond.com> Reported-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Fixes: c61b93fe51b1 ("drm/atomic: Fix remaining places where !funcs->best_encoder is valid") Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-08-08drm/edid: Set 8 bpc color depth for displays with "DFP 1.x compliant TMDS".Mario Kleiner
According to E-EDID spec 1.3, table 3.9, a digital video sink with the "DFP 1.x compliant TMDS" bit set is "signal compatible with VESA DFP 1.x TMDS CRGB, 1 pixel / clock, up to 8 bits / color MSB aligned". For such displays, the DFP spec 1.0, section 3.10 "EDID support" says: "If the DFP monitor only supports EDID 1.X (1.1, 1.2, etc.) without extensions, the host will make the following assumptions: 1. 24-bit MSB-aligned RGB TFT 2. DE polarity is active high 3. H and V syncs are active high 4. Established CRT timings will be used 5. Dithering will not be enabled on the host" So if we don't know the bit depth of the display from additional colorimetry info we should assume 8 bpc / 24 bpp by default. This patch adds info->bpc = 8 assignement for that case. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Cc: Jani Nikula <jani.nikula@intel.com> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-08-08drm/i915/dp: Revert "drm/i915/dp: fall back to 18 bpp when sink capability ↵Mario Kleiner
is unknown" This reverts commit 013dd9e03872 ("drm/i915/dp: fall back to 18 bpp when sink capability is unknown") This commit introduced a regression into stable kernels, as it reduces output color depth to 6 bpc for any video sink connected to a Displayport connector if that sink doesn't report a specific color depth via EDID, or if our EDID parser doesn't actually recognize the proper bpc from EDID. Affected are active DisplayPort->VGA converters and active DisplayPort->DVI converters. Both should be able to handle 8 bpc, but are degraded to 6 bpc with this patch. The reverted commit was meant to fix Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=105331 A followup patch implements a fix for that specific bug, which is caused by a faulty EDID of the affected DP panel by adding a new EDID quirk for that panel. DP 18 bpp fallback handling and other improvements to DP sink bpc detection will be handled for future kernels in a separate series of patches. Please backport to stable. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Acked-by: Jani Nikula <jani.nikula@intel.com> Cc: stable@vger.kernel.org Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-08-08drm/edid: Add 6 bpc quirk for display AEO model 0.Mario Kleiner
Bugzilla https://bugzilla.kernel.org/show_bug.cgi?id=105331 reports that the "AEO model 0" display is driven with 8 bpc without dithering by default, which looks bad because that panel is apparently a 6 bpc DP panel with faulty EDID. A fix for this was made by commit 013dd9e03872 ("drm/i915/dp: fall back to 18 bpp when sink capability is unknown"). That commit triggers new regressions in precision for DP->DVI and DP->VGA displays. A patch is out to revert that commit, but it will revert video output for the AEO model 0 panel to 8 bpc without dithering. The EDID 1.3 of that panel, as decoded from the xrandr output attached to that bugzilla bug report, is somewhat faulty, and beyond other problems also sets the "DFP 1.x compliant TMDS" bit, which according to DFP spec means to drive the panel with 8 bpc and no dithering in absence of other colorimetry information. Try to make the original bug reporter happy despite the faulty EDID by adding a quirk to mark that panel as 6 bpc, so 6 bpc output with dithering creates a nice picture. Tested by injecting the edid from the fdo bug into a DP connector via drm_kms_helper.edid_firmware and verifying the 6 bpc + dithering is selected. This patch should be backported to stable. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Cc: stable@vger.kernel.org Cc: Jani Nikula <jani.nikula@intel.com> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-08-08drm/tilcdc: Change tilcdc_crtc_page_flip() to tilcdc_crtc_update_fb()Jyri Sarha
Change tilcdc_crtc_page_flip() to tilcdc_crtc_update_fb(). The function is not used as a page_flip() callback anymore so it is only confusing to call it that. The function should only be used by dummy primary plane commit() callback. Signed-off-by: Jyri Sarha <jsarha@ti.com>
2016-08-08drm/tilcdc: Remove unnecessary pm_runtime_get() and *_put() callsJyri Sarha
Remove unnecessary pm_runtime_get() and *_put() calls from commit phase callbacks. Those calls are not needed since we have the whole commit phase between pm_runtime_get_sync() and pm_runtime_put_sync(). Signed-off-by: Jyri Sarha <jsarha@ti.com>
2016-08-08drm/tilcdc: Get rid of legacy dpms mechanismJyri Sarha
Get rid of legacy dpms mechanism. This simplifies the code quite a bit. The old start() and stop() functions become tilcdc_crtc_enable() and *_disable(). The functions are added with all the necessary mechanisms from the old dpms function and they are used directly as the crtc helper enable() and disable() callbacks. Signed-off-by: Jyri Sarha <jsarha@ti.com>
2016-08-08drm/tilcdc: Use drm_atomic_helper_resume/suspend()Jyri Sarha
Use drm_atomic_helper_resume/suspend() and get rid off all the obsolete register level context restoring code. Signed-off-by: Jyri Sarha <jsarha@ti.com>
2016-08-08drm/tilcdc: Enable and disable interrupts in crtc start() and stop()Jyri Sarha
Enable and disable interrupts in crtc start() and stop(). None of the interrupts can fire if CRTC is disabled, so it is cleaner - when considering suspend/resume code etc. - to enable the interrupts when CRTC is turned on and to disable them when CRTC is turned off. Signed-off-by: Jyri Sarha <jsarha@ti.com>
2016-08-08drm/tilcdc: tfp410: Add atomic modeset helpers to connector funcsJyri Sarha
Add atomic modeset helpers to tfp410 connector funcs. Property handling related helpers, atomic reset helper, and new dpms helper is needed in connector for atomic modeseting to work. The default helper functions are enough. Signed-off-by: Jyri Sarha <jsarha@ti.com>
2016-08-08drm/tilcdc: tfp410: Set crtc panel info at init phaseJyri Sarha
Set crtc panel info at init phase. Setting it at prepare callback does it multiple times for no good reason and it is also too late when atomic modeset is used. Signed-off-by: Jyri Sarha <jsarha@ti.com>
2016-08-08drm/tilcdc: panel: Add atomic modeset helpers to connector funcsJyri Sarha
Add atomic modeset helpers to panel connector funcs. Property handling related helpers, atomic reset helper, and new dpms helper is needed in connector for atomic modeseting to work. The default helper functions are enough. Signed-off-by: Jyri Sarha <jsarha@ti.com>
2016-08-08drm/tilcdc: panel: Set crtc panel info at init phaseJyri Sarha
Set crtc panel info at init phase. Setting it at prepare callback does it multiple times for no good reason and it is also too late when atomic modeset is used. Signed-off-by: Jyri Sarha <jsarha@ti.com>
2016-08-08drm/tilcdc: Remove tilcdc_verify_fb()Jyri Sarha
Remove tilcdc_verify_fb(). The tilcdc_verify_fb() function is not needed because the same checks are implemented in tilcdc_plane_atomic_check(). Signed-off-by: Jyri Sarha <jsarha@ti.com>
2016-08-08drm/tilcdc: Remove obsolete crtc helper functionsJyri Sarha
Remove obsolete crtc helper functions. These are not needed when atomic modeset is used. Note that the drm_crtc_helper_funcs mode_fixup() is still needed. The crtc's check() callback can not do its job here. The plane's check() callback needs to set drm_crtc_state's ->mode_changed to true if the pixel format for the framebuffer changes. Because of this drm_mode_config_funcs atomic_check() callback needs to call drm_atomic_helper_check_modeset() once more after it has called drm_atomic_helper_check_planes(). If the fixing of the adjusted_mode would be done in drm_crtc_helper_funcs atomic_check() callback, it would get over written by the extra drm_atomic_helper_check_modeset() call. Signed-off-by: Jyri Sarha <jsarha@ti.com>
2016-08-08drm/tilcdc: Set DRIVER_ATOMIC and use atomic crtc helpersJyri Sarha
Set DRIVER_ATOMIC and use atomic helpers and rename commit and prepare crtc helpers to enable and disable. This makes the final jump to mode setting, but there is lot of obsolete code to clean up. Signed-off-by: Jyri Sarha <jsarha@ti.com>
2016-08-08drm/tilcdc: Add drm_mode_config_reset() call to tilcdc_load()Jyri Sarha
Add drm_mode_config_reset() call to tilcdc_load(). This is need to initialize atomic state variables at load time. Signed-off-by: Jyri Sarha <jsarha@ti.com>
2016-08-08drm/tilcdc: Add atomic mode config funcsJyri Sarha
Add atomic mode config funcs. The atomic_commit implementation is a copy-paste from drm_atomic_helper_commit(), leaving out the async test. The similar copy-paste implementation appears to be used in many other drivers too. The standard drm_atomic_helper_check() is used for checking. The drm_atomic_helper_check() can not be used in drm_mode_config_funcs atomic_check() callback because the plane's check implementation may update crtc state's ->mode_changed flag. Because of this the drm_atomic_helper_check_modeset() has to be called once more after drm_atomic_helper_check_planes() (see drm_atomic_helper_check_modeset() documentation). Signed-off-by: Jyri Sarha <jsarha@ti.com>