summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/bridge
AgeCommit message (Collapse)AuthorFilesLines
2016-10-10drm/bridge: Drop drm_connector_unregister and call drm_connector_cleanup ↵Marek Vasut3-22/+3
directly Drop unneeded drm_connector_unregister() and remove the unnecessary wrapper functions around drm_connector_cleanup(). Signed-off-by: Marek Vasut <marex@denx.de> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20161005143133.5549-1-marex@denx.de
2016-10-10drm/bridge: Add RGB to VGA bridge supportMaxime Ripard3-0/+231
Some boards have an entirely passive RGB to VGA bridge, based on DACs implemented by resistor ladders. Those might or might not have an i2c bus routed to the VGA connector in order to access the screen EDIDs. Add a bridge that doesn't do anything but expose the modes available on the screen, either based on the EDIDs if available, or based on the XGA standards. Acked-by: Rob Herring <robh@kernel.org> Reviewed-by: Sean Paul <seanpaul@chromium.org> Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Archit Taneja <architt@codeaurora.org> Link: http://patchwork.freedesktop.org/patch/msgid/20160930143709.1388-3-maxime.ripard@free-electrons.com
2016-10-05drm/bridge: Call drm_connector_cleanup directlyMarek Vasut3-18/+3
Remove the unnecessary wrapper functions around drm_connector_cleanup(). Signed-off-by: Marek Vasut <marex@denx.de> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20161004222331.7200-1-marex@denx.de
2016-10-04drm/bridge: analogix_dp: Add analogix_dp_psr_supportedTomeu Vizoso1-0/+8
So users know whether PSR should be enabled or not. Cc: Yakir Yang <ykk@rock-chips.com> Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Signed-off-by: Archit Taneja <architt@codeaurora.org> Link: http://patchwork.freedesktop.org/patch/msgid/1474639600-30090-1-git-send-email-tomeu.vizoso@collabora.com
2016-09-28Merge tag 'topic/drm-misc-2016-09-25' of ↵Dave Airlie3-571/+231
git://anongit.freedesktop.org/drm-intel into drm-next - more core cleanup patches to prep drm_file to be used for kernel-internal contexts (David Herrmann) - more split-up+docs for drm_crtc.c - lots of small fixes and polish all over * tag 'topic/drm-misc-2016-09-25' of git://anongit.freedesktop.org/drm-intel: (37 commits) drm: bridge: analogix/dp: mark symbols static where possible drm/bochs: mark bochs_connector_get_modes() static drm/bridge: analogix_dp: Improve panel on time drm/bridge: analogix_dp: Don't read EDID if panel present drm/bridge: analogix_dp: Remove duplicated code Revert "drm/i2c: tda998x: don't register the connector" drm: Fix plane type uabi breakage dma-buf/sync_file: free fences array in num_fences is 1 drm/i2c: tda998x: don't register the connector drm: Don't swallow error codes in drm_dev_alloc() drm: Distinguish no name from ENOMEM in set_unique() drm: Remove dirty property from docs drm/doc: Document color space handling drm: Extract drm_color_mgmt.[hc] drm/doc: Polish plane composition property docs drm: Conslidate blending properties in drm_blend.[hc] drm/doc: Polish for drm_plane.[hc] drm: Extract drm_plane.[hc] drm/tilcdc: Add atomic and crtc headers to crtc.c drm: Fix typo in encoder docs ...
2016-09-25drm: bridge: analogix/dp: mark symbols static where possibleBaoyou Xie1-2/+2
We get 2 warnings when building kernel with W=1: drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:1053:5: warning: no previous prototype for 'analogix_dp_get_modes' [-Wmissing-prototypes] drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:1097:1: warning: no previous prototype for 'analogix_dp_detect' [-Wmissing-prototypes] In fact, both functions are only used in the file in which they are declared and don't need a declaration, but can be made static. So this patch marks both functions with 'static'. Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1474788764-6069-1-git-send-email-baoyou.xie@linaro.org
2016-09-24drm/bridge: analogix_dp: Improve panel on timeSean Paul1-10/+13
In order to reduce the time required to turn on the panel, this patch makes 2 assumptions: 1- In detect(): if there's a panel, we're connected. 2- In get_modes(): if there's a panel, let the panel driver decide if it should prepare/unprepare in order to get the modes. The first is straightforward, and shouldn't need further explanation. The second should eliminate the prepare/unprepare delays from get_modes() in most cases, since panels generally hardcode their modes in the driver as opposed to reading EDID. If a panel does need to read EDID, it should be responsible for ensuring it's in a state in which it can. Signed-off-by: Sean Paul <seanpaul@chromium.org>
2016-09-24drm/bridge: analogix_dp: Don't read EDID if panel presentSean Paul1-8/+10
If there's a panel connected to the analogix_dp bridge, rely on the panel driver for modes, rather than reading EDID *and* calling get_modes() on the panel. This allows panels with a valid EDID to read it in the panel driver (e.g. simple_panel), and panels with invalid EDID to homebrew modes in their get_modes implementation. Signed-off-by: Sean Paul <seanpaul@chromium.org>
2016-09-24drm/bridge: analogix_dp: Remove duplicated codeTomeu Vizoso3-555/+210
Remove code for reading the EDID and DPCD fields and use the helpers instead. Besides the obvious code reduction, other helpers are being added to the core that could be used in this driver and will be good to be able to use them instead of duplicating them. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Tested-by: Javier Martinez Canillas <javier@osg.samsung.com> Tested-by: Sean Paul <seanpaul@chromium.org> Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Sean Paul <seanpaul@chromium.org> Cc: Javier Martinez Canillas <javier@osg.samsung.com> Cc: Mika Kahola <mika.kahola@intel.com> Cc: Yakir Yang <ykk@rock-chips.com> Cc: Daniel Vetter <daniel.vetter@intel.com> Cc: Archit Taneja <architt@codeaurora.org>
2016-09-19Merge tag 'imx-drm-next-2016-09-19' of ↵Dave Airlie1-3/+0
git://git.pengutronix.de/git/pza/linux into drm-next imx-drm active plane reconfiguration, cleanup, FSU/IC/IRT/VDIC support - add active plane reconfiguration support (v4), use the atomic_disable callback - stop calling disable_plane manually in the plane destroy path - let mode cleanup destroy mode objects on driver unbind - drop deprecated load/unload drm_driver ops - add exclusive fence to plane state, so the atomic helper can wait on them, remove the open-coded fence wait from imx-drm - add low level deinterlacer (VDIC) support - add support for channel linking via the frame synchronisation unit (FSU) - add queued image conversion support for memory-to-memory scaling, rotation, and color space conversion, using IC and IRT. * tag 'imx-drm-next-2016-09-19' of git://git.pengutronix.de/git/pza/linux: gpu: ipu-v3: Add queued image conversion support gpu: ipu-v3: Add ipu_rot_mode_is_irt() gpu: ipu-v3: fix a possible NULL dereference drm/imx: parallel-display: detach bridge or panel on unbind drm/imx: imx-ldb: detach bridge on unbind drm/imx: imx-ldb: detach panel on unbind gpu: ipu-v3: Add FSU channel linking support gpu: ipu-v3: Add Video Deinterlacer unit drm/imx: add exclusive fence to plane state drm/imx: fold ipu_plane_disable into ipu_disable_plane drm/imx: don't destroy mode objects manually on driver unbind drm/imx: drop deprecated load/unload drm_driver ops drm/imx: don't call disable_plane in plane destroy path drm/imx: Add active plane reconfiguration support drm/imx: Use DRM_PLANE_COMMIT_NO_DISABLE_AFTER_MODESET flag drm/imx: ipuv3-crtc: Use the callback ->atomic_disable instead of ->disable gpu: ipu-v3: Do not wait for DMFC FIFO to clear when disabling DMFC channel
2016-09-15drm/bridge: analogix_dp: squash lines for simple wrapper functionsMasahiro Yamada1-16/+4
Remove unneeded variables and assignments. Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> [seanpaul added analogix prefix to subject] Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/1473863952-7658-4-git-send-email-yamada.masahiro@socionext.com
2016-09-12drm/bridge: adv7511: add support for the 2nd chipSergei Shtylyov2-9/+8
The Renesas Wheat board has 2 ADV7513 chips on the same I2C bus, however the ADV751x driver only supports 1 chip as it tries to assign the packet/ EDID/CEC memory I2C devices to the fixed I2C addresses. Assign these I2C addresses at the fixed offsets (derived from the programming guide) from the main register map address instead. Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Signed-off-by: Archit Taneja <architt@codeaurora.org> Link: http://patchwork.freedesktop.org/patch/msgid/1580212.O1LYdJFM97@wasted.cogentembedded.com
2016-08-31Merge tag 'topic/drm-misc-2016-08-31' of ↵Dave Airlie1-3/+4
git://anongit.freedesktop.org/drm-intel into drm-next More -misc stuff - moar drm_crtc.c split up&documentation - some fixes for the simple kms helpers (Andrea) - I included all the dri1 patches from David - we're not removing any code or drivers, and it seems to have worked as a wake-up call to motivate a few more people to upstream kms conversions for these. Feel free to revert if you disagree strongly. - a few other single patches * tag 'topic/drm-misc-2016-08-31' of git://anongit.freedesktop.org/drm-intel: (24 commits) drm: drm_probe_helper: Fix output_poll_work scheduling drm: bridge/dw-hdmi: Fix colorspace and scan information registers values drm/doc: Polish docs for drm_property&drm_property_blob drm: Unify handling of blob and object properties drm: Extract drm_property.[hc] drm: move drm_mode_legacy_fb_format to drm_fourcc.c drm/doc: Polish docs for drm_mode_object drm: Remove drm_mode_object->atomic_count drm: Extract drm_mode_object.[hc] drm/doc: Polish kerneldoc for encoders drm: Extract drm_encoder.[hc] drm/fb-helper: don't call remove_conflicting_framebuffers for FB=m && DRM=y drm/atomic-helper: Add NO_DISABLE_AFTER_MODESET flag support for plane commit drm/atomic-helper: Disable appropriate planes in disable_planes_on_crtc() drm/atomic-helper: Add atomic_disable CRTC helper callback drm: simple_kms_helper: add support for bridges drm: simple_kms_helper: make connector optional at init time drm/bridge: introduce bridge detaching mechanism drm/simple-helpers: Always add planes to the state update drm: reduce GETCLIENT to a minimum ...
2016-08-30drm: bridge/dw-hdmi: Fix colorspace and scan information registers valuesJose Abreu1-3/+4
Colorspace and scan information values were being written in wrong offsets. This patch corrects this and writes the values at the offsets specified in the databook. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Acked-by: Russell King <rmk+kernel@armlinux.org.uk> Cc: Carlos Palminha <palminha@synopsys.com> Cc: Archit Taneja <architt@codeaurora.org> Cc: David Airlie <airlied@linux.ie> Cc: Russell King <rmk+kernel@arm.linux.org.uk> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Archit Taneja <architt@codeaurora.org> Link: http://patchwork.freedesktop.org/patch/msgid/96fd0f06b7ebc2ee5cb8239a99648f3107e24497.1471530573.git.joabreu@synopsys.com
2016-08-29drm/imx: don't destroy mode objects manually on driver unbindLucas Stach1-3/+0
Instead let drm_mode_config_cleanup() do the work when taking down the master device. This requires all cleanup functions to be properly hooked up to the mode object .destroy callback. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-08-25Merge branch 'for-next' of git://people.freedesktop.org/~seanpaul/dogwood ↵Dave Airlie4-11/+264
into drm-next This pull request contains the following rockchip drm changes: - Introduce support for rk3399 vop/crtc - Add PSR framework to the rockchip driver - Implement PSR in the rockchip analogix edp driver - Fix panel on/off in analogix to avoid damaging panels - Some miscellaneous fixes to clean up logs and code readability * 'for-next' of git://people.freedesktop.org/~seanpaul/dogwood: drm/rockchip: analogix_dp: drop unnecessary probe deferral "error" print drm/rockchip: Enable vblank without event drm/rockchip: Improve analogix-dp psr handling drm/rockchip: A couple small fixes to psr drm/rockchip: Use a spinlock to protect psr state drm/rockchip: Don't use a delayed worker for psr state changes drm/rockchip: Convert psr_list_mutex to spinlock and use it drm/rockchip: analogix_dp: implement PSR function drm/bridge: analogix_dp: add the PSR function support drm/rockchip: add an common abstracted PSR driver drm/rockchip: vop: export line flag function drm/bridge: analogix_dp: Ensure the panel is properly prepared/unprepared dt-bindings: add compatible strings for big/little rockchip vops dt-bindings: sort Rockchip vop compatible by chip's number drm/rockchip: vop: add rk3399 vop support drm/rockchip: vop: introduce VOP_REG_MASK drm/rockchip: sort registers define by chip's number
2016-08-23drm/bridge: analogix_dp: add the PSR function supportYakir Yang4-0/+171
The full name of PSR is Panel Self Refresh, panel device could refresh itself with the hardware framebuffer in panel, this would make lots of sense to save the power consumption. This patch have exported two symbols for platform driver to implement the PSR function in hardware side: - analogix_dp_active_psr() - analogix_dp_inactive_psr() Reviewed-by: Archit Taneja <architt@codeaurora.org> Signed-off-by: Yakir Yang <ykk@rock-chips.com> Signed-off-by: Sean Paul <seanpaul@chromium.org>
2016-08-23drm/bridge: analogix_dp: Ensure the panel is properly prepared/unpreparedSean Paul2-11/+93
Instead of just preparing the panel on bind, actually prepare/unprepare during modeset/disable. The panel must be prepared in order to read hpd status and edid, so we need to keep state around the prepares in order to ensure we don't accidentally turn the panel off at the wrong time. Reviewed-by: Yakir Yang <ykk@rock-chips.com> Tested-by: Yakir Yang <ykk@rock-chips.com> Reviewed-by: Archit Taneja <architt@codeaurora.org> Signed-off-by: Sean Paul <seanpaul@chromium.org>
2016-08-23drm/bridge: dw-hdmi: Delete unnecessary assignment for the field "owner"Markus Elfring1-1/+0
The field "owner" is set by the core. Thus delete an unneeded initialisation. Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/7c97565d-eee3-45e9-b494-9e802977502c@users.sourceforge.net
2016-08-12drm: Remove superflous linux/fb.h includesDaniel Vetter1-1/+0
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-07-29Merge tag 'topic/drm-misc-2016-07-28' of ↵Dave Airlie1-3/+1
git://anongit.freedesktop.org/drm-intel into drm-next A few more simple fixes that Sean&I collected. There's a bunch of bigger things on dri-devel, but I think those are all too late for 4.8 really. I'll try and go collect them after -rc1 for 4.9. * tag 'topic/drm-misc-2016-07-28' of git://anongit.freedesktop.org/drm-intel: drm/arm: mali-dp: Fix error return code in malidp_bind() drm/arm: mali-dp: Remove redundant dev_err call in malidp_bind() drm/gma500: remove unnecessary stub for fb_ioctl() apple-gmux: Sphinxify docs drm/arm: mali-dp: Set crtc.port to the port instead of the endpoint drm/sti: use new Reset API drm/etnaviv: Optimize error handling in etnaviv_gem_new_userptr() drm/etnaviv: Delete unnecessary checks before two function calls drm/vmwgfx: Delete an unnecessary check before the function call "vfree" drm/qxl: Delete an unnecessary check before drm_gem_object_unreference_unlocked() drm/mgag200: Delete an unnecessary check before drm_gem_object_unreference_unlocked() drm/bridge: ps8622: Delete an unnecessary check before backlight_device_unregister() GPU-DRM-GMA500: Delete unnecessary checks before two function calls GPU-DRM-OMAP: Delete unnecessary checks before two function calls
2016-07-22drm/bridge: ps8622: Delete an unnecessary check before ↵Markus Elfring1-3/+1
backlight_device_unregister() The backlight_device_unregister() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/791089e4-201c-ad01-9c3b-f49835765177@users.sourceforge.net
2016-07-19Merge branch 'drm_bridge_for_4.8' of https://github.com/boddob/linux into ↵Dave Airlie8-0/+3225
drm-next This is an update to the previous drm bridge pull request. The ADV7511 driver's conversion from slave encoder to bridge meant that its users (the rcar-du kms driver) should use the bridge interface too. This pull request now also contains a commit that updates the rcar-du's hdmi encoder interface from slave encoder to bridge. The other updates are as before: - Converts the ADV7511 i2c slave encoder driver to a bridge driver. Adds support for the ADV7533 bridge chip. - Add bridge driver for TC358767 (DSI/DPI to eDP) encoder chips. * 'drm_bridge_for_4.8' of https://github.com/boddob/linux: drm: rcar-du: Remove i2c slave encoder interface for hdmi encoder drm/bridge: tc358767: Add DPI to eDP bridge driver dt-bindings: tc358767: add DT documentation dt-bindings: drm/bridge: Update bindings for ADV7533 drm/bridge: adv7533: Change number of DSI lanes dynamically drm/bridge: adv7533: Use internal timing generator drm/bridge: adv7533: Create a MIPI DSI device drm/bridge: adv7533: Initial support for ADV7533 drm/bridge: adv7511: Fix mutex deadlock when interrupts are disabled drm/i2c: adv7511: Move to bridge folder drm/i2c: adv7511: Convert to drm_bridge
2016-07-17drm/bridge: tc358767: Add DPI to eDP bridge driverAndrey Gusakov3-0/+1423
Add a drm_bridge driver for the Toshiba TC358767 DPI/DSI to eDP/DP bridge. Currently only DPI input with 24-bit RGB is supported. Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Archit Taneja <architt@codeaurora.org>
2016-07-16Merge branch 'upstream/analogix-dp-20160705' of ↵Dave Airlie4-11/+17
git://github.com/yakir-Yang/linux into drm-next Please consider merging this tag, which contains the v4 misc fixes and add RK3399 eDP support patches[0] I sent on 2016-06-29, rebased onto v4.7-rc5. * 'upstream/analogix-dp-20160705' of git://github.com/yakir-Yang/linux: dt-bindings: analogix_dp: rockchip: correct the wrong compatible name drm/rockchip: analogix_dp: introduce the pclk for grf drm/bridge: analogix_dp: fix no drm hpd event when panel plug in drm/rockchip: analogix_dp: update the comments about why need to hardcode VOP output mode drm/rockchip: analogix_dp: correct the connector display color format and bpc drm/bridge: analogix_dp: passing the connector as an argument in .get_modes() drm/rockchip: analogix_dp: make panel detect to an optional action drm/rockchip: analogix_dp: add rk3399 eDP support drm/bridge: analogix_dp: some rockchip chips need to flip REF_CLK bit setting drm/bridge: analogix_dp: correct the register bit define error in ANALOGIX_DP_PLL_REG_1 drm/rockchip: analogix_dp: split the lcdc select setting into device data
2016-07-13drm/bridge: adv7533: Change number of DSI lanes dynamicallyArchit Taneja3-0/+31
Lower modes on ADV7533 require lower number of DSI lanes for correct operation. If ADV7533 is being used with 4 DSI lanes, then switch the lanes to 3 when the target mode's pixel clock is less than 80 Mhz. Based on patch by Andy Green <andy.green@linaro.org> Signed-off-by: Archit Taneja <architt@codeaurora.org>
2016-07-13drm/bridge: adv7533: Use internal timing generatorArchit Taneja3-2/+63
ADV7533 provides an internal timing generator for certain modes that it can't use the DSI clock directly. We've observed that HDMI is more stable with the internal timing generator, especially if there are instabilities in the DSI clock source. The data spec also seems to recommend the usage of the timing generator for all modes. However, on some platforms, it's reported that enabling the timing generator causes instabilities with the HDMI output. Create a DT parameter that lets a platform explicitly disable the timing generator. The timing generator is enabled by default. Signed-off-by: Archit Taneja <architt@codeaurora.org>
2016-07-13drm/bridge: adv7533: Create a MIPI DSI deviceArchit Taneja4-8/+147
In order to pass DSI specific parameters to the DSI host, we need the driver to create a mipi_dsi_device DSI device that attaches to the host. Use of_graph helpers to get the DSI host DT node. Create a MIPI DSI device using this host. Finally, attach this device to the DSI host. Populate DT parameters (number of data lanes for now) that are required for DSI RX to work correctly. Hardcode few other parameters (rgb, embedded_sync) for now. Select DRM_MIPI_DSI config option only when ADV7533 support is enabled. Signed-off-by: Archit Taneja <architt@codeaurora.org>
2016-07-13drm/bridge: adv7533: Initial support for ADV7533Archit Taneja5-49/+230
ADV7533 is a DSI to HDMI encoder chip. It is a derivative of ADV7511, with additional blocks to translate input DSI data to parallel RGB data. Besides the ADV7511 I2C register map, it has additional registers that require to be configured to activate the DSI Rx block. Create a new config that enables ADV7533 support. Use DT compatible strings to populate the ADV7533 type enum. Add minimal register configurations belonging to the DSI/CEC register map. Keep the ADV7533 code in a separate file. Originally worked on by Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Archit Taneja <architt@codeaurora.org>
2016-07-13drm/bridge: adv7511: Fix mutex deadlock when interrupts are disabledArchit Taneja1-4/+4
When the adv7511 i2c client doesn't have an interrupt line, we observe a deadlock on caused by trying to lock drm device's mode_config.mutex twice in the same context. Here is the sequence that causes it: ioctl DRM_IOCTL_MODE_GETCONNECTOR from userspace drm_mode_getconnector (acquires mode_config mutex) connector->fill_modes() drm_helper_probe_single_connector_modes connector_funcs->get_modes adv7511_encoder_get_modes adv7511_get_edid_block adv7511_irq_process drm_helper_hpd_irq_event (acquires mode_config mutex again) In adv7511_irq_process, don't call drm_helper_hpd_irq_event when not called from the interrupt handler. It doesn't serve any purpose there anyway. Signed-off-by: Archit Taneja <architt@codeaurora.org>
2016-07-13drm/i2c: adv7511: Move to bridge folderArchit Taneja6-0/+1390
The driver has been converted to use drm_bridge instead of drm_i2c_slave_encoder. We can now move it to the bridge folder. Create a separate folder since we already have a couple of files and expect more when we support audio and ADV7533. Rename the driver to adv7511_drv.c. This will come in handy later when the driver module will need to be built from multiple object files. Signed-off-by: Archit Taneja <architt@codeaurora.org>
2016-07-12drm/bridge: dw-hdmi: Remove the legacy drm_connector_funcs structureLiu Ying1-19/+3
There is no one using the legacy drm_connector_funcs structure since the imx-drm has been converted to atomic, so we may remove it. Signed-off-by: Liu Ying <gnuiyl@gmail.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-07-12drm/imx: atomic phase 2 step 1: Wire up state ->reset, ->duplicate and ->destroyLiu Ying1-0/+3
Wire up CRTCs', planes' and connectors' ->reset, ->duplicate and ->destroy state hooks to use the default implementations from the atomic helper library. The helpers track each DRM object state. Signed-off-by: Liu Ying <gnuiyl@gmail.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-07-05drm/bridge: analogix_dp: fix no drm hpd event when panel plug inYakir Yang1-4/+4
The enum value of DP_IRQ_TYPE_HP_CABLE_IN is zero, but driver only send drm hp event when the irq_type and the enum value is true. if (irq_type & DP_IRQ_TYPE_HP_CABLE_IN || ...) drm_helper_hpd_irq_event(dp->drm_dev); So there would no drm hpd event when cable plug in, to fix that just need to assign all hotplug enum with no-zero values. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Yakir Yang <ykk@rock-chips.com> Reviewed-by: Sean Paul <seanpaul@chromium.org> Reviewed-by: Stéphane Marchesin <marcheu@chromium.org> Reviewed-by: Tomasz Figa <tomasz.figa@chromium.com> Tested-by: Javier Martinez Canillas <javier@osg.samsung.com>
2016-07-05drm/bridge: analogix_dp: passing the connector as an argument in .get_modes()Yakir Yang1-1/+1
It's better to pass the connector to platform driver in .get_modes() callback, just like what the .get_modes() helper function designed. Signed-off-by: Yakir Yang <ykk@rock-chips.com> Reviewed-by: Sean Paul <seanpaul@chromium.org> Reviewed-by: Tomasz Figa <tomasz.figa@chromium.com>
2016-07-05drm/rockchip: analogix_dp: add rk3399 eDP supportYakir Yang1-0/+1
RK3399 and RK3288 shared the same eDP IP controller, only some light difference with VOP configure and GRF configure. Signed-off-by: Yakir Yang <ykk@rock-chips.com> Acked-by: Mark Yao <mark.yao@rock-chips.com> Reviewed-by: Tomasz Figa <tomasz.figa@chromium.com> Reviewed-by: Sean Paul <seanpaul@chromium.org>
2016-07-05drm/bridge: analogix_dp: some rockchip chips need to flip REF_CLK bit settingYakir Yang2-4/+9
As vendor document indicate, when REF_CLK bit set 0, then DP phy's REF_CLK should switch to 24M source clock. But due to IC PHY layout mistaken, some chips need to flip this bit(like RK3288), and unfortunately they didn't indicate in the DP version register. That's why we have to make this little hack. Signed-off-by: Yakir Yang <ykk@rock-chips.com> Reviewed-by: Tomasz Figa <tomasz.figa@chromium.com> Tested-by: Javier Martinez Canillas <javier@osg.samsung.com> Reviewed-by: Sean Paul <seanpaul@chromium.org>
2016-07-05drm/bridge: analogix_dp: correct the register bit define error in ↵Yakir Yang1-2/+2
ANALOGIX_DP_PLL_REG_1 There're an register define error in ANALOGIX_DP_PLL_REG_1 which introduced by commit bcec20fd5ad6 ("drm: bridge: analogix/dp: add some rk3288 special registers setting"). The PHY PLL input clock source is selected by ANALOGIX_DP_PLL_REG_1 BIT 0, not BIT 1. Signed-off-by: Yakir Yang <ykk@rock-chips.com> Reviewed-by: Sean Paul <seanpaul@chromium.org> Reviewed-by: Tomasz Figa <tomasz.figa@chromium.com> Tested-by: Javier Martinez Canillas <javier@osg.samsung.com>
2016-06-20drm/bridge: Add sii902x driverBoris Brezillon3-0/+476
Add basic support for the sii902x RGB -> HDMI bridge. This driver does not support audio output yet. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Tested-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: Archit Taneja <architt@codeaurora.org> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> --- Changes in v8: - remove useless headers inclusion - fix macro names (s/SIL/SII) - drop unneeded hotplug_work field from struct sii902x - drop drm_connector_unregister() call in the ->destroy() method - add a timeout when polling a register value Changes in v6: - use HDMI_INFOFRAME_SIZE(AVI) - fix reset_gpio initialization - reduce the reset time based on Ming feedback Changes in v5: - drop the best_encoder() implementation Changes in v4: - make reset GPIO optional - only support attaching to DRM devices supporting atomic updates Changes in v3: - fix get_modes() implementation to avoid turning the screen in power save mode - rename the driver (sil902x -> sii902x) Changes in v2: - fix errors reported by the kbuild robot fixup! drm: bridge: Add sii902x driver
2016-06-10drm/bridge: dw-hdmi: Use drm_atomic_helper_best_encoder()Boris Brezillon1-10/+1
We have a 1:1 relationship between connectors and encoders, which means we can rely on the drm_atomic_helper_best_encoder() behavior. We still have to explicitly assign ->best_encoder() to drm_atomic_helper_best_encoder(), because the automated fallback to drm_atomic_helper_best_encoder() when ->best_encoder() is NULL is only available when the DRM device is using the atomic helpers, and this bridge is compatible with non-atomic and atomic devices. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1465300095-16971-21-git-send-email-boris.brezillon@free-electrons.com
2016-06-10drm/bridge: ps8622: Rely on the default ->best_encoder() behaviorBoris Brezillon1-10/+0
We have a 1:1 relationship between connectors and encoders, and the driver is relying on the atomic helpers: we can drop the custom ->best_encoder(), and let the core call drm_atomic_helper_best_encoder() for us. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1465300095-16971-20-git-send-email-boris.brezillon@free-electrons.com
2016-06-10drm/bridge: ptn3460: Rely on the default ->best_encoder() behaviorBoris Brezillon1-8/+0
We have a 1:1 relationship between connectors and encoders, and the driver is relying on the atomic helpers: we can drop the custom ->best_encoder(), and let the core call drm_atomic_helper_best_encoder() for us. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1465300095-16971-19-git-send-email-boris.brezillon@free-electrons.com
2016-06-10drm/bridge: anx78xx: Rely on the default ->best_encoder() behaviorBoris Brezillon1-8/+0
We have a 1:1 relationship between connectors and encoders, and the driver is relying on the atomic helpers: we can drop the custom ->best_encoder(), and let the core call drm_atomic_helper_best_encoder() for us. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1465300095-16971-18-git-send-email-boris.brezillon@free-electrons.com
2016-05-12drm/bridge: Add Analogix anx78xx supportEnric Balletbo i Serra4-0/+2244
Although there are other chips from the same family that can reuse this driver, at the moment we only tested ANX7814 chip. The ANX7814 is an ultra-low power Full-HD (1080p60) SlimPort transmitter designed for portable devices. This driver adds initial support for HDMI to DP pass-through mode. Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Cc: Emil Velikov <emil.l.velikov@gmail.com> Cc: Rob Herring <robh@kernel.org> Cc: Dan Carpenter <dan.carpenter@oracle.com> Cc: Daniel Kurtz <djkurtz@chromium.org> Cc: Nicolas Boichat <drinkcat@chromium.org> Cc: Thierry Reding <treding@nvidia.com> [treding@nvidia.com: coding style, propagate regulator_get() errors] Signed-off-by: Thierry Reding <treding@nvidia.com>
2016-04-06Merge branch 'drm-next-analogix-dp-v2' of github.com:yakir-Yang/linux into ↵Dave Airlie8-0/+3417
drm-next This pull request want to land the analogix_dp driver into drm/bridge directory, which reused the Exynos DP code, and add Rockchip DP support. And those patches have been: * 'drm-next-analogix-dp-v2' of github.com:yakir-Yang/linux: drm: bridge: analogix/dp: Fix the possible dead lock in bridge disable time drm: bridge: analogix/dp: add panel prepare/unprepare in suspend/resume time drm: bridge: analogix/dp: add edid modes parse in get_modes method drm: bridge: analogix/dp: move hpd detect to connector detect function drm: bridge: analogix/dp: try force hpd after plug in lookup failed drm: bridge: analogix/dp: add max link rate and lane count limit for RK3288 drm: bridge: analogix/dp: add some rk3288 special registers setting dt-bindings: add document for rockchip variant of analogix_dp drm: rockchip: dp: add rockchip platform dp driver ARM: dts: exynos/dp: remove some properties that deprecated by analogix_dp driver dt-bindings: add document for analogix display port driver drm: bridge: analogix/dp: dynamic parse sync_pol & interlace & dynamic_range drm: bridge: analogix/dp: remove duplicate configuration of link rate and link count drm: bridge: analogix/dp: fix some obvious code style drm: bridge: analogix/dp: rename register constants drm/exynos: dp: rename implementation specific driver part drm: bridge: analogix/dp: split exynos dp driver to bridge directory
2016-04-05drm: bridge: analogix/dp: Fix the possible dead lock in bridge disable timeYakir Yang3-36/+55
It may caused a dead lock if we flush the hpd work in bridge disable time. The normal flow would like: IN --> DRM IOCTL 1. Acquire crtc_ww_class_mutex (DRM IOCTL) IN --> analogix_dp_bridge 2. Acquire hpd work lock (Flush hpd work) 3. HPD work already in idle, no need to run the work function. OUT <-- analogix_dp_bridge OUT <-- DRM IOCTL The dead lock flow would like: IN --> DRM IOCTL 1. Acquire crtc_ww_class_mutex (DRM IOCTL) IN --> analogix_dp_bridge 2. Acquire hpd work lock (Flush hpd work) IN --> analogix_dp_hotplug IN --> drm_helper_hpd_irq_event 3. Acquire mode_config lock (This lock already have been acquired in previous step 1) ** Dead Lock Now ** It's wrong to flush the hpd work in bridge->disable time, I guess the original code just want to ensure the delay work must be finish before encoder disabled. The flush work in bridge disable time is try to ensure the HPD event won't be missed before display card disabled, actually we can take a fast respond way(interrupt thread) to update DRM HPD event to fix the delay update and possible dead lock. Tested-by: Caesar Wang <wxt@rock-chips.com> Tested-by: Douglas Anderson <dianders@chromium.org> Tested-by: Heiko Stuebner <heiko@sntech.de> Tested-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Yakir Yang <ykk@rock-chips.com>
2016-04-05drm: bridge: analogix/dp: add panel prepare/unprepare in suspend/resume timeYakir Yang1-0/+13
Turn off the panel power in suspend time would help to reduce power waste. Tested-by: Caesar Wang <wxt@rock-chips.com> Tested-by: Douglas Anderson <dianders@chromium.org> Tested-by: Heiko Stuebner <heiko@sntech.de> Tested-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Yakir Yang <ykk@rock-chips.com>
2016-04-05drm: bridge: analogix/dp: add edid modes parse in get_modes methodYakir Yang2-30/+33
Display Port monitor could support kinds of mode which indicate in monitor edid, not just one single display resolution which defined in panel or devivetree property display timing. Note: Gustavo Padovan try to remove the controller and phy power on function in bind time at bellow commit: drm/exynos: do not start enabling DP at bind() phase But for now driver need to read edid message in .get_modes() function, so controller must be inited in bind time, so we need to add controller init back. Tested-by: Caesar Wang <wxt@rock-chips.com> Tested-by: Douglas Anderson <dianders@chromium.org> Tested-by: Heiko Stuebner <heiko@sntech.de> Tested-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Yakir Yang <ykk@rock-chips.com>
2016-04-05drm: bridge: analogix/dp: move hpd detect to connector detect functionYakir Yang1-18/+20
This change just make a little clean to make code more like drm core expect, move hdp detect code from bridge->enable(), and place them into connector->detect(). Note: Gustavo Padovan try to remove the controller and phy power on function in bind time at bellow commit: drm/exynos: do not start enabling DP at bind() phase But for now the connector status don't hardcode to connected, need to operate dp phy in .detect function, so we need to revert parts if Gustavo Padovan's changes, add phy poweron function in bind time. Tested-by: Caesar Wang <wxt@rock-chips.com> Tested-by: Douglas Anderson <dianders@chromium.org> Tested-by: Heiko Stuebner <heiko@sntech.de> Tested-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Yakir Yang <ykk@rock-chips.com>
2016-04-05drm: bridge: analogix/dp: try force hpd after plug in lookup failedYakir Yang3-5/+41
Some edp screen do not have hpd signal, so we can't just return failed when hpd plug in detect failed. This is an hardware property, so we need add a devicetree property "analogix,need-force-hpd" to indicate this sutiation. Acked-by: Rob Herring <robh@kernel.org> Tested-by: Caesar Wang <wxt@rock-chips.com> Tested-by: Douglas Anderson <dianders@chromium.org> Tested-by: Heiko Stuebner <heiko@sntech.de> Tested-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Yakir Yang <ykk@rock-chips.com>