summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/tilcdc
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'tilcdc-4.10-fixes' of https://github.com/jsarha/linux into drm-fixesDave Airlie2017-01-091-9/+18
|\ | | | | | | | | | | | | tilcdc fixes for v4.10. * tag 'tilcdc-4.10-fixes' of https://github.com/jsarha/linux: drm: tilcdc: simplify the recovery from sync lost error on rev1
| * drm: tilcdc: simplify the recovery from sync lost error on rev1Bartosz Golaszewski2017-01-041-9/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revision 2 of LCDC suffers from an issue where a SYNC_LOST error caused by limited memory bandwidth may leave the picture shifted a couple pixels to the right. This issue has not been observed on revision 1, while the recovery mechanism introduces a different issue, where the END_OF_FRAME interrupt doesn't fire while drm is waiting for vblanks. On rev1: recover from sync lost errors by simply clearing the RASTER_ENABLE bit in the RASTER_CTRL register and re-enabling it again as is suggested by the datasheet. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Reviewed-by: Jyri Sarha <jsarha@ti.com> Signed-off-by: Jyri Sarha <jsarha@ti.com>
* | ktime: Cleanup ktime_set() usageThomas Gleixner2016-12-251-1/+1
| | | | | | | | | | | | | | | | | | | | ktime_set(S,N) was required for the timespec storage type and is still useful for situations where a Seconds and Nanoseconds part of a time value needs to be converted. For anything where the Seconds argument is 0, this is pointless and can be replaced with a simple assignment. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org>
* | Merge remote-tracking branch 'airlied/drm-next' into drm-misc-nextDaniel Vetter2016-12-068-390/+695
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | Backmerge v4.9-rc8 to get at commit e94bd1736f1f60e916a85a80c0b0ebeaae36cce5 Author: Michel Dänzer <michel.daenzer@amd.com> Date: Wed Nov 30 17:30:01 2016 +0900 drm: Don't call drm_for_each_crtc with a non-KMS driver so I can apply Michel's follow-up patch. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
| * drm/tilcdc: fix parsing of some DT propertiesBartosz Golaszewski2016-11-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The DT binding for tildc is not consistent with the driver code: there are two options - 'max-width' and 'max-pixelclock' specified in the documentation which are parsed as 'ti,max-width' and 'ti,max-pixelclock' respectively. Make the driver code consistent with the binding. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Reviewed-by: Jyri Sarha <jsarha@ti.com> Signed-off-by: Jyri Sarha <jsarha@ti.com>
| * drm/tilcdc: Enable frame done irq and functionality for LCDC rev 1Jyri Sarha2016-11-302-7/+12
| | | | | | | | | | | | | | | | We should wait for the last frame to complete before shutting things down also on LCDC rev 1. Signed-off-by: Jyri Sarha <jsarha@ti.com> Tested-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
| * drm/tilcdc: Configure video mode to HW in enable() not in mode_set_nofb()Jyri Sarha2016-11-302-220/+212
| | | | | | | | | | | | | | | | | | | | Configure video mode to HW in enable() call back. There is no reason to do it before that. This makes PM functions way easier because there is no HW context to save when screen is for instance blanked. This patch removes mode_set_nofb() call back from tilcdc. Signed-off-by: Jyri Sarha <jsarha@ti.com> Tested-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
| * drm/tilcdc: Load palette at the end of mode_set_nofb()Jyri Sarha2016-11-301-20/+5
| | | | | | | | | | | | | | | | | | Load palette at the end of mode_set_nofb(). Moving the palette loading to mode_set_nofb() saves us from storing and restoring of framebuffer addresses in dma registers that were just recently written there. Signed-off-by: Jyri Sarha <jsarha@ti.com> Tested-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
| * drm/tilcdc: Add timeout wait for palette loading to completeJyri Sarha2016-11-301-1/+5
| | | | | | | | | | | | | | | | | | Add timeout wait for palette loadind to complete. We do not want to hang forever if palette loaded interrupt does not arrive for some reason. Signed-off-by: Jyri Sarha <jsarha@ti.com> Tested-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
| * drm/tilcdc: Enable palette loading for revision 2 LCDC tooJyri Sarha2016-11-301-43/+47
| | | | | | | | | | | | | | | | | | | | The LCDC revision 2 documentation also mentions the mandatory palette for true color modes. Even if the rev 2 LCDC appears to work just fine without the palette being loaded loading it helps in testing the feature. Signed-off-by: Jyri Sarha <jsarha@ti.com> Tested-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
| * drm/tilcdc: Fix load mode bit-field setting in tilcdc_crtc_enable()Jyri Sarha2016-11-301-1/+3
| | | | | | | | | | | | | | | | | | Set LCDC_PALETTE_LOAD_MODE bit-field with new tilcdc_write_mask() instead of tilcdc_set(). Setting a bit-fields with tilcdc_set() is fundamentally broken. Signed-off-by: Jyri Sarha <jsarha@ti.com> Tested-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
| * drm/tilcdc: Add tilcdc_write_mask() to tilcdc_regs.hJyri Sarha2016-11-301-0/+13
| | | | | | | | | | | | | | | | Add tilcdc_write_mask() for handling register field wider than one bit and mask values for those fields. Signed-off-by: Jyri Sarha <jsarha@ti.com> Tested-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
| * drm/tilcdc: Fix tilcdc_crtc_create() return value handlingJyri Sarha2016-11-303-13/+12
| | | | | | | | | | | | | | | | Failed tilcdc_crtc_create() error handling was broken, this patch should fix it. Signed-off-by: Jyri Sarha <jsarha@ti.com> Tested-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
| * drm/tilcdc: implement palette loading for rev1Bartosz Golaszewski2016-11-301-1/+87
| | | | | | | | | | | | | | | | | | | | | | | | Revision 1 of the IP doesn't work if we don't load the palette (even if it's not used, which is the case for the RGB565 format). Add a function called from tilcdc_crtc_enable() which performs all required actions if we're dealing with a rev1 chip. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Jyri Sarha <jsarha@ti.com> Tested-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
| * drm/tilcdc: Enable sync lost error and recovery handling for rev 1 LCDCJyri Sarha2016-11-302-15/+21
| | | | | | | | | | | | | | | | Revision 1 LCDC support also sync lost errors and can benefit from sync lost recovery routine. Signed-off-by: Jyri Sarha <jsarha@ti.com> Tested-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
| * drm/tilcdc: Add drm bridge support for attaching drm bridge driversJyri Sarha2016-11-304-74/+207
| | | | | | | | | | | | | | | | | | | | | | Adds drm bride support for attaching drm bridge drivers to tilcdc. The decision whether a video port leads to an external encoder or bridge is made simply based on remote device's compatible string. The code has been tested with BeagleBone-Black with and without BeagleBone DVI-D Cape Rev A3 using ti-tfp410 driver. Signed-off-by: Jyri Sarha <jsarha@ti.com> Tested-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
| * drm/tilcdc: Recover from sync lost error flood by resetting the LCDCJyri Sarha2016-11-301-1/+25
| | | | | | | | | | | | | | | | | | | | | | | | Recover from sync lost error flood by resetting the LCDC instead of turning off the SYNC_LOST error IRQ. When LCDC starves on limited memory bandwidth it may sometimes result an error situation when the picture may have shifted couple of pixels to right and SYNC_LOST interrupt is generated on every frame. LCDC main reset recovers from this situation and causes a brief blanking on the screen. Signed-off-by: Jyri Sarha <jsarha@ti.com> Tested-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
| * drm/tilcdc: Fix race from forced shutdown of crtc in unloadJyri Sarha2016-11-293-8/+26
| | | | | | | | | | | | | | Fix race from forced shutdown of crtc in unload by adding internal locking and a boolean telling if device is going to be shutdown. Signed-off-by: Jyri Sarha <jsarha@ti.com>
| * drm/tilcdc: Use unload to handle initialization failuresJyri Sarha2016-11-293-71/+43
| | | | | | | | | | | | | | | | Use unload to handle initialization failures instead of complex goto label mess. To do this the initialization sequence needed slight reordering and some unload functions needed to become conditional. Signed-off-by: Jyri Sarha <jsarha@ti.com>
| * drm/tilcdc: Stop using struct drm_driver load() callbackJyri Sarha2016-11-291-54/+70
| | | | | | | | | | | | | | | | | | | | | | | | Stop using struct drm_driver load() and unload() callbacks. The callbacks should not be used anymore. Instead of using load the drm_device is allocated with drm_dev_alloc() and registered with drm_dev_register() only after the driver is completely initialized. The deinitialization is done directly either in component unbind callback or in platform driver demove callback. Signed-off-by: Jyri Sarha <jsarha@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
| * drm/tilcdc: Remove obsolete drm_connector_register() callsJyri Sarha2016-11-292-4/+0
| | | | | | | | | | | | | | | | | | Remove obsolete drm_connector_register() calls from tilcdc_panel.c and tilcdc_tfp410.c. All connectors are registered when drm_dev_register() is called. Signed-off-by: Jyri Sarha <jsarha@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
| * drm/tilcdc: Correct misspelling in error messageDaniel Schultz2016-11-291-1/+1
| | | | | | | | | | | | | | | | | | This error message will be printed when a FIFO underflow irq has triggered. Since this happens sometimes and the error message will be displayed on the console, it should have a correct spelling. Signed-off-by: Daniel Schultz <d.schultz@phytec.de> Signed-off-by: Jyri Sarha <jsarha@ti.com>
| * drm/tilcdc: Add revision handling for FB_CEILINGDaniel Schultz2016-11-291-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The commit d8ff0c63fbcb ("drm/tilcdc: Adjust the FB_CEILING address") added an adjustment of the FB_CEILING address. This is done by decrementing the address by one. On the AM335x (rev 0x4F201000) the framebuffer is rotated left over the display border, because the ceiling address is 8f276fff instead of 8f277000. Since this adjustment isn't necessary for the LCDC v2, the origin ceiling address should be used. Signed-off-by: Daniel Schultz <d.schultz@phytec.de> Signed-off-by: Jyri Sarha <jsarha@ti.com>
| * drm/tilcdc: add a da850-specific compatible stringBartosz Golaszewski2016-11-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | Due to some potential tweaks for the da850 LCDC (for example: the required memory bandwith settings) we need a separate compatible for the IP present on the da850 boards. Suggested-by: Sekhar Nori <nsekhar@ti.com> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Jyri Sarha <jsarha@ti.com>
| * drm/tilcdc: add a workaround for failed clk_set_rate()Bartosz Golaszewski2016-11-291-6/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some architectures don't use the common clock framework and don't implement all the clk interfaces for every clock. This is the case for da850-lcdk where clk_set_rate() only works for PLL0 and PLL1. Trying to set the clock rate for the LCDC clock results in -EINVAL being returned. As a workaround for that: if the call to clk_set_rate() fails, fall back to adjusting the clock divider instead. Proper divider value is calculated by dividing the current clock rate by the required pixel clock rate in HZ. This code is based on a hack initially developed internally for baylibre by Karl Beldan <kbeldan@baylibre.com>. Tested with a da850-lcdk with an LCD display connected over VGA. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Jyri Sarha <jsarha@ti.com>
* | drm: Make the connector .detect() callback optionalLaurent Pinchart2016-12-011-8/+0
|/ | | | | | | | | | | | | | | | | | Many drivers (21 to be exact) create connectors that are always connected (for instance to an LVDS or DSI panel). Instead of forcing them to implement a dummy .detect() handler, make the callback optional and consider the connector as always connected in that case. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Acked-by: Jyri Sarha <jsarha@ti.com> Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Philipp Zabel <p.zabel@pengutronix.de> Acked-by: Vincent Abriou <vincent.abriou@st.com> Acked-by: Alexey Brodkin <abrodkin@synopsys.com> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> [seanpaul fixed small conflict in rcar-du/rcar_du_lvdscon.c] Signed-off-by: Sean Paul <seanpaul@chromium.org>
* drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefsJani Nikula2016-11-021-2/+0
| | | | | | | | | | If we define drm_compat_ioctl NULL on CONFIG_COMPAT=n, we don't have to check for the config everywhere. Reviewed-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/1478014844-27454-1-git-send-email-jani.nikula@intel.com
* drm: convert DT component matching to component_match_add_release()Russell King2016-10-251-1/+3
| | | | | | | | | | Convert DT component matching to use component_match_add_release(). Acked-by: Jyri Sarha <jsarha@ti.com> Reviewed-by: Jyri Sarha <jsarha@ti.com> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/E1bwo6l-0005Io-Q1@rmk-PC.armlinux.org.uk
* drm: tilcdc: Replace drm_fb_get_bpp_depth() with drm_format_plane_cpp()Laurent Pinchart2016-10-182-13/+12
| | | | | | | | | | | | | | The driver needs the number of bytes per pixel, not the bpp and depth info meant for fbdev compatibility. Use the right API. In the tilcdc_crtc_mode_set() function compute the hardware register value directly from the pixel format instead of computing the number of bits per pixels first. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Signed-off-by: Archit Taneja <architt@codeaurora.org> Link: http://patchwork.freedesktop.org/patch/msgid/1476744081-24485-7-git-send-email-laurent.pinchart@ideasonboard.com
* drm: Add reference counting to drm_atomic_stateChris Wilson2016-10-171-2/+0
| | | | | | | | | | | | | | | | | | | | drm_atomic_state has a complicated single owner model that tracks the single reference from allocation through to destruction on another thread - or perhaps on a local error path. We can simplify this tracking by using reference counting (at a cost of a few more atomics). This is even more beneficial when the lifetime of the state becomes more convoluted than being passed to a single worker thread for the commit. v2: Double check !intel atomic_commit functions for missing gets v3: Update kerneldocs Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: dri-devel@lists.freedesktop.org Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20161014121833.439-27-chris@chris-wilson.co.uk
* Merge tag 'tilcdc-4.9-3.1' of https://github.com/jsarha/linux into drm-nextDave Airlie2016-09-286-51/+73
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Second attempt for 3rd drm/tilcdc pull request for v4.9. * tag 'tilcdc-4.9-3.1' of https://github.com/jsarha/linux: drm/tilcdc: fix wrong error handling drm/tilcdc: Return directly after a failed kfree_table_init() in tilcdc_convert_slave_node() drm/tilcdc: Remove "default" from blue-and-red-wiring property binding drm/tilcdc: Fix non static symbol warning drm/tilcdc: mark symbols static where possible drm/tilcdc: add missing header dependencies drm/tilcdc: WARN if CRTC is touched without CRTC lock drm/tilcdc: Take CRTC lock when calling tilcdc_crtc_disable() drm/tilcdc: Remove unnecessary tilcdc_crtc_disable() from tilcdc_unload() drm/tilcdc: Flush flip-work workqueue before drm_flip_work_cleanup() drm/tilcdc: Clean up LCDC functional clock rate setting code drm/tilcdc: Take crtc modeset lock while updating the crtc clock rate
| * drm/tilcdc: fix wrong error handlingDaniel Schultz2016-09-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When 'component_bind_all' fails it should not try to unbind components in the error handling. This will produce a null pointer kernel panic when no component exist. This patch changes the order of the error handling. Now, it will only unbind components if the are bound. Otherwise, the module will jump to an error label below. Signed-off-by: Daniel Schultz <d.schultz@phytec.de> Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Jyri Sarha <jsarha@ti.com>
| * drm/tilcdc: Return directly after a failed kfree_table_init() in ↵Markus Elfring2016-09-231-1/+1
| | | | | | | | | | | | | | | | | | | | tilcdc_convert_slave_node() Return directly after a memory allocation failed in this function at the beginning. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Jyri Sarha <jsarha@ti.com>
| * drm/tilcdc: Fix non static symbol warningWei Yongjun2016-09-221-2/+2
| | | | | | | | | | | | | | | | | | | | Fixes the following sparse warning: drivers/gpu/drm/tilcdc/tilcdc_drv.c:64:5: warning: symbol 'tilcdc_atomic_check' was not declared. Should it be static? Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Jyri Sarha <jsarha@ti.com>
| * drm/tilcdc: mark symbols static where possibleBaoyou Xie2016-09-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We get 3 warnings when building kernel with W=1: drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c:142:29: warning: no previous prototype for 'tilcdc_get_overlay' [-Wmissing-prototypes] drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c:198:13: warning: no previous prototype for 'tilcdc_convert_slave_node' [-Wmissing-prototypes] drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c:264:12: warning: no previous prototype for 'tilcdc_slave_compat_init' [-Wmissing-prototypes] In fact, these 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 these functions with 'static'. Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org> Signed-off-by: Jyri Sarha <jsarha@ti.com>
| * drm/tilcdc: add missing header dependenciesBaoyou Xie2016-09-222-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We get 4 warnings when building kernel with W=1: drivers/gpu/drm/tilcdc/tilcdc_tfp410.c:393:12: warning: no previous prototype for 'tilcdc_tfp410_init' [-Wmissing-prototypes] drivers/gpu/drm/tilcdc/tilcdc_tfp410.c:398:13: warning: no previous prototype for 'tilcdc_tfp410_fini' [-Wmissing-prototypes] drivers/gpu/drm/tilcdc/tilcdc_panel.c:443:12: warning: no previous prototype for 'tilcdc_panel_init' [-Wmissing-prototypes] drivers/gpu/drm/tilcdc/tilcdc_panel.c:448:13: warning: no previous prototype for 'tilcdc_panel_fini' [-Wmissing-prototypes] In fact, these functions are declared in drivers/gpu/drm/tilcdc/tilcdc_tfp410.h, drivers/gpu/drm/tilcdc/tilcdc_panel.h, so this patch adds missing header dependencies. Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org> Signed-off-by: Jyri Sarha <jsarha@ti.com>
| * drm/tilcdc: WARN if CRTC is touched without CRTC lockJyri Sarha2016-09-071-0/+8
| | | | | | | | | | | | | | | | | | WARN if CRTC is touched without CRTC lock. The crtc functions should not be called simultaneously from multiple threads. Having the DRM CRTC lock should take care of that. Signed-off-by: Jyri Sarha <jsarha@ti.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
| * drm/tilcdc: Take CRTC lock when calling tilcdc_crtc_disable()Jyri Sarha2016-09-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Take CRTC lock when calling tilcdc_crtc_disable() in tilcdc_crtc_destroy(). In theory there could still be some operation ongoing, which should finish before destroying the CRTC. However, the main reason for adding this is to be able to add WARNing in tilcdc_crtc_disable() if CRTC is not locked. Signed-off-by: Jyri Sarha <jsarha@ti.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
| * drm/tilcdc: Remove unnecessary tilcdc_crtc_disable() from tilcdc_unload()Jyri Sarha2016-09-071-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Remove unnecessary tilcdc_crtc_disable() from tilcdc_unload(). The tilcdc_crtc_disable() called via tilcdc_crtc_destroy() by drm_mode_config_cleanup() couple of lines later. The early call to tilcdc_crtc_disable() was a wrong fix (that worked) for calling drm_flip_work_cleanup() before flushing the flip-work queue. Signed-off-by: Jyri Sarha <jsarha@ti.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
| * drm/tilcdc: Flush flip-work workqueue before drm_flip_work_cleanup()Jyri Sarha2016-09-071-0/+4
| | | | | | | | | | | | | | | | | | | | | | Flush flip-work workqueue before drm_flip_work_cleanup(). It causes a nasty warning if there is unfinished flip-work in the queue when drm_flip_work_cleanup() is called. The flush_workqueue() has to be called before drm_crtc_cleanup() for unref_worker() to be able to do its job. Signed-off-by: Jyri Sarha <jsarha@ti.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
| * drm/tilcdc: Clean up LCDC functional clock rate setting codeJyri Sarha2016-09-073-42/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clean up LCDC functional clock rate setting code. The LCDC functional clock is set by two functions: mode_set_nofb() and cpufreq_transition(). When tilcdc_crtc_mode_set_nofb() is called in atomic commit phase the drm atomic helpers have taken all the necessary drm locks and turned off the crtc, while tilcdc_commit() is keeping LCDC powered on. For mode_set_nofb() just a simple clock setting function without any locking or power management code is enough. The new tilcdc_crtc_set_clk() is implemented for that purpose. cpufreq_transition() on the other hand is called from outside DRM and it needs to take the necessary locks and turn off the CRTC while keeping the LCDC powered. The reimplemented tilcdc_crtc_update_clk() is for that purpose and it uses the new tilcdc_crtc_set_clk() to actually set the clock. Signed-off-by: Jyri Sarha <jsarha@ti.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
| * drm/tilcdc: Take crtc modeset lock while updating the crtc clock rateJyri Sarha2016-09-071-0/+3
| | | | | | | | | | | | | | | | | | Take crtc modeset lock while updating the crtc clock rate. To avoid a race in tilcdc_crtc_update_clk(), we do not want crtc mode to change while we update crtc clock. Signed-off-by: Jyri Sarha <jsarha@ti.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
* | drm/tilcdc: Add atomic and crtc headers to crtc.cSean Paul2016-09-211-2/+4
|/ | | | | | | Also reorder alphabetically and fix up drm_flip_work header. Reviewed-by: Daniel Vetter <daniel@ffwll.ch> Signed-off-by: Sean Paul <seanpaul@chromium.org>
* drm/tilcdc: Choose console BPP that supports RGBJyri Sarha2016-09-016-19/+9
| | | | | | | | | | | | Choose console BPP that supports RGB and remove the old fbdev bpp selection code. LCDC on AM335x has red and blue wires switched between 24 bit and 16 bit colors. If 24 format is wired for RGB colors, the 16 bit format is wired for BGR. drm_fbdev_cma_init() does not currently like anything else but RGB formats, so we must choose such bytes per pixel value that supports RGB. Signed-off-by: Jyri Sarha <jsarha@ti.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
* drm/tilcdc: Add blue-and-red-crossed devicetree propertyJyri Sarha2016-09-013-6/+48
| | | | | | | | | | | | | | | | | | | | | | | Add "blue-and-red-wiring"-device tree property and update devicetree binding document. The red and blue components are reversed between 24 and 16 bit modes on am335x LCDC output pins. To get 24 RGB format the red and blue wires has to be crossed and this in turn causes 16 colors output to be in BGR format. With straight wiring the 16 color is RGB and 24 bit is BGR. The new property describes whether the red and blue wires are crossed or not. If the property is not present or its value is not recognized the legacy mode is assumed. The legacy configuration supports RGB565, RGB888 and XRGB8888 formats. However, depending on wiring, the red and blue colors are swapped in either 16 or 24-bit color modes. For more details see section 3.1.1 in AM335x Silicon Errata: http://www.ti.com/general/docs/lit/getliterature.tsp?baseLiteratureNumber=sprz360 Signed-off-by: Jyri Sarha <jsarha@ti.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
* drm/tilcdc: Write DMA base and ceiling address with single instructionJyri Sarha2016-09-012-2/+22
| | | | | | | | | | | Write DMA base and ceiling address with a single instruction, if available. This should make it more unlikely that LCDC would fetch the DMA addresses in the middle of an update. Having bad combination of addresses in dma base and ceiling (e.g base > ceiling) can cause unpredictaple behavior in LCDC. Signed-off-by: Jyri Sarha <jsarha@ti.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
* drm/tilcdc: Remove drm_helper_disable_unused_functions() callJyri Sarha2016-09-011-2/+0
| | | | | | | | drm_helper_disable_unused_functions() should not be called by atomic drivers. Signed-off-by: Jyri Sarha <jsarha@ti.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
* drm/tilcdc: Enable EOF interrupts for v1 LCDCKarl Beldan2016-09-011-0/+2
| | | | | | | | | This got accidentally dropped in the fixed commit and is required for the driver to properly work on the rev1 IP, such as found on the LCDK. Fixes: 2b2080d7e9ae ("drm/tilcdc: Get rid of complex ping-pong mechanism") Signed-off-by: Karl Beldan <kbeldan@baylibre.com> Signed-off-by: Jyri Sarha <jsarha@ti.com>
* drm/tilcdc: Adjust the FB_CEILING addressKarl Beldan2016-09-011-1/+1
| | | | | | | | | | | | | | The LCDC seems to expect its framebuffer ceiling address pointer to be an inclusive bound. The IP rev2 seems to cope with that but rev1 (as found on the LCDK) don't. Also note that this is what the framebuffer code does in da8xx-fb.c. Since, as the TRM puts it, "The 2 LSBs are hardwired to 00b", the dma_addr_t can be decremented without cast. I tested it with a v2 (AM335x, rev 0x4F201000) and an LCDK (v1). Signed-off-by: Karl Beldan <kbeldan@baylibre.com> Signed-off-by: Jyri Sarha <jsarha@ti.com>
* drm/tilcdc: Fix check for remote port parentTeresa Remmet2016-09-011-1/+1
| | | | | | | | | In function tilcdc_get_external_components the check for the remote port parent is not correct. We need a '||' instead of an '&&'. Signed-off-by: Teresa Remmet <t.remmet@phytec.de> Signed-off-by: Jyri Sarha <jsarha@ti.com>
OpenPOWER on IntegriCloud