summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/exynos/exynos_drm_plane.c
AgeCommit message (Collapse)Author
2017-08-25drm/exynos: mixer: enable NV12MT support for the video planeTobias Jakobi
The video processor supports a tiled version of the NV12 format, known as NV12MT in V4L2 terms. The support was removed in commit 083500baefd5f4c215a5a93aef2492c1aa775828 due to not being a real pixel format, but rather NV12 with a special memory layout. With the introduction of FB modifiers, we can now properly support this format again. Tested with a hacked up modetest from libdrm's test suite on an ODROID-X2 (Exynos4412). Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2017-08-08drm: Nuke drm_atomic_helper_plane_set_propertyDaniel Vetter
It's dead code, the core handles all this directly now. This also allows us to unexport drm_atomic_plane_set_property. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Liviu Dudau <liviu.dudau@arm.com> Cc: Brian Starkey <brian.starkey@arm.com> Cc: Mali DP Maintainers <malidp@foss.arm.com> Cc: Boris Brezillon <boris.brezillon@free-electrons.com> Cc: Daniel Vetter <daniel.vetter@intel.com> Cc: Jani Nikula <jani.nikula@linux.intel.com> Cc: Sean Paul <seanpaul@chromium.org> Cc: David Airlie <airlied@linux.ie> Cc: Inki Dae <inki.dae@samsung.com> Cc: Joonyoung Shim <jy0922.shim@samsung.com> Cc: Seung-Woo Kim <sw0312.kim@samsung.com> Cc: Kyungmin Park <kyungmin.park@samsung.com> Cc: Kukjin Kim <kgene@kernel.org> Cc: Krzysztof Kozlowski <krzk@kernel.org> Cc: Ben Skeggs <bskeggs@redhat.com> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org> Cc: Vincent Abriou <vincent.abriou@st.com> Cc: Yannick Fertre <yannick.fertre@st.com> Cc: Philippe Cornu <philippe.cornu@st.com> Cc: Jyri Sarha <jsarha@ti.com> Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com> Cc: Rongrong Zou <zourongrong@gmail.com> Cc: Shawn Guo <shawn.guo@linaro.org> Cc: Alexey Brodkin <abrodkin@synopsys.com> Cc: Eric Engestrom <eric@engestrom.ch> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Rob Clark <robdclark@gmail.com> Cc: Archit Taneja <architt@codeaurora.org> Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Cc: intel-gfx@lists.freedesktop.org Cc: nouveau@lists.freedesktop.org Cc: linux-renesas-soc@vger.kernel.org Cc: Thomas Hellstrom <thellstrom@vmware.com> Cc: Maxime Ripard <maxime.ripard@free-electrons.com> Link: https://patchwork.freedesktop.org/patch/msgid/20170725080122.20548-6-daniel.vetter@ffwll.ch Reviewed-by: Archit Taneja <architt@codeaurora.org> Acked-by: Philippe Cornu <philippe.cornu@st.com> Tested-by: Philippe Cornu <philippe.cornu@st.com> Acked-by: Liviu Dudau <Liviu.Dudau@arm.com> Acked-by: Vincent Abriou <vincent.abriou@st.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-08-01drm: Plumb modifiers through plane initBen Widawsky
This is the plumbing for supporting fb modifiers on planes. Modifiers have already been introduced to some extent, but this series will extend this to allow querying modifiers per plane. Based on this, the client to enable optimal modifications for framebuffers. This patch simply allows the DRM drivers to initialize their list of supported modifiers upon initializing the plane. v2: A minor addition from Daniel v3: * Updated commit message * s/INVALID/DRM_FORMAT_MOD_INVALID (Liviu) * Remove some excess newlines (Liviu) * Update comment for > 64 modifiers (Liviu) v4: Minor comment adjustments (Liviu) v5: Some new platforms added due to rebase v6: Add some missed plane inits (or maybe they're new - who knows at this point) (Daniel) Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Reviewed-by: Daniel Stone <daniels@collabora.com> (v2) Reviewed-by: Liviu Dudau <Liviu.Dudau@arm.com> Signed-off-by: Daniel Stone <daniels@collabora.com>
2017-06-01drm/exynos: set plane possible_crtcs in exynos_plane_initAndrzej Hajda
All Exynos planes are assigned to exactly one CRTC, it allows to simplify initialization by moving setting of possible_crtcs to exynos_plane_init. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-10-01drm/exynos: use drm core to handle page-flip eventAndrzej Hajda
Exynos DRM framework handled page-flip event with custom code. The patch replaces it with drm-core vblank queue. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-07-29drm/exynos: use generic code for managing zpos plane propertyMarek Szyprowski
This patch replaces zpos property handling custom code in Exynos DRM driver with calls to generic DRM code. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org> Cc: Inki Dae <inki.dae@samsung.com> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Ville Syrjala <ville.syrjala@linux.intel.com> Cc: Joonyoung Shim <jy0922.shim@samsung.com> Cc: Seung-Woo Kim <sw0312.kim@samsung.com> Cc: Andrzej Hajda <a.hajda@samsung.com> Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Cc: Gustavo Padovan <gustavo@padovan.org> Cc: vincent.abriou@st.com Cc: fabien.dessenne@st.com Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-06-10drm/exynos: use logical AND in exynos_drm_plane_check_size()Tobias Jakobi
The current bitwise AND should result in the same assembler but this is what the code is actually supposed to do. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1464179407-9004-1-git-send-email-tjakobi@math.uni-bielefeld.de
2016-05-17drm: Drop plane argument from __drm_atomic_helper_plane_destroy_stateDaniel Vetter
It's unused, and really this helper should only look at the state structure and nothing else. v2: Fix commit message (Laurent). v3: Rebase onto mtk driver merge. Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Eric Anholt <eric@anholt.net> Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Cc: Inki Dae <inki.dae@samsung.com> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Mark Yao <mark.yao@rock-chips.com> Acked-by: Thierry Reding <thierry.reding@gmail.com> Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Eric Anholt <eric@anholt.net> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1462804451-15318-2-git-send-email-daniel.vetter@ffwll.ch
2016-04-30drm/exynos: fix adjusted_mode pointer in exynos_plane_mode_setAndrzej Hajda
exynos_plane_mode_set should use adjusted_mode from the same atomic state as plane state. Otherwise it will result in incorrect behavior in case crtc mode changes. The patch fixes bug with black console framebuffer in case of command mode panels. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-01-13drm/exynos: make zpos property configurableMarek Szyprowski
This patch adds all infrastructure to make zpos plane property configurable from userspace. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-01-13drm/exynos: rename zpos to indexMarek Szyprowski
This patch renames zpos entry to index, because in most places it is used as index for selecting hardware layer/window instead of configurable layer position. This will later enable to make the zpos property configurable. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-12-15Merge branch 'exynos-drm-next' of ↵Dave Airlie
git://git.kernel.org:/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-next - Support runtime pm . In case of most ARM SoC, each IP has each power domain which should be controlled by each IP driver using runtime pm interface. So this patch series makes each IP driver to control its own power domain when drm dpms is requested. - Support of_graph based dt binding for DP panel. . This patch series adds of_graph based dt binding for DP panel. And also it keeps backward compatibility. This includes dt binding patch so I got Acked-by from Krzysztof Kozlowski who is a Exynos SoC maintainer and from Rob Herring who is a device tree maintainer. - Cleanup for Exynos DRM IPP enhancement. . This patch series is a first step for enhancing existing IPP framework which will integrate existing IPP functions with DRM KMS part so that these can be transparent to userspace. For other portion of the patch series, we will have more times for the review.] * 'exynos-drm-next' of git://git.kernel.org:/pub/scm/linux/kernel/git/daeinki/drm-exynos: (29 commits) drm/exynos: gem: remove old unused prototypes drm/exynos: fimd: fix dma burst size setting for small plane size drm/exynos: fix clipping when scaling is enabled drm/exynos: mixer: use ratio precalculated in exynos_state drm/exynos: add generic check for plane state drm/exynos: introduce exynos_drm_plane_config structure drm/exynos: mixer: enable video overlay plane only when VP is available drm/exynos: mixer: use crtc->state->adjusted_mode instead of crtc->mode drm/exynos: introduce exynos_drm_plane_state structure drm/exynos: move dma_addr attribute from exynos plane to exynos fb drm/exynos: exynos7-decon: remove excessive check drm/exynos: rotator: convert to common clock framework drm/exynos: gsc: add device tree support and remove usage of static mappings drm/exynos: gsc: fix wrong pm_runtime state drm/exynos: gsc: prepare and unprepare gsc clock ARM: dts: Use OF graph for DP to panel connection in exynos5800-peach-pi dt-bindings: exynos-dp: update ports node binding for panel drm/exynos: dp: add of_graph dt binding support for panel drm/exynos: decon: remove unused variables drm/exynos: dsi: modify a error type when getting a node failed ...
2015-12-13drm/exynos: fix clipping when scaling is enabledMarek Szyprowski
This patch fixes calculation of src x/y offset for negative crtc x/y values when scaling is enabled. This fixes possible IOMMU fault when scaling is enabled. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-12-13drm/exynos: add generic check for plane stateMarek Szyprowski
This patch adds generic check for plane state - display area dimensions, so drivers can always assume that they get valid plane state to set. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-12-13drm/exynos: introduce exynos_drm_plane_config structureMarek Szyprowski
This patch adds common structure for keeping plane configuration and capabilities data. This patch is inspired by similar code developed by Tobias Jakobi. Changelog v2: - fix vidi_win_types(i) call. vidi_win_types is not a function. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-12-13drm/exynos: introduce exynos_drm_plane_state structureMarek Szyprowski
This patch introduces exynos_drm_plane_state structure, which subclasses drm_plane_state and holds precalculated data suitable for configuring Exynos hardware. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-12-13drm/exynos: move dma_addr attribute from exynos plane to exynos fbMarek Szyprowski
DMA address is a framebuffer attribute and the right place for it is exynos_drm_framebuffer not exynos_drm_plane. This patch also introduces helper function for getting dma address of the given framebuffer. Changelog v2: - use state->fb instead of plane->base.fb. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-12-11drm: Pass 'name' to drm_universal_plane_init()Ville Syrjälä
Done with coccinelle for the most part. It choked on msm/mdp/mdp5/mdp5_plane.c like so: "BAD:!!!!! enum drm_plane_type type;" No idea how to deal with that, so I just fixed that up by hand. Also it thinks '...' is part of the semantic patch, so I put an 'int DOTDOTDOT' placeholder in its place and got rid of it with sed afterwards. I didn't convert drm_plane_init() since passing the varargs through would mean either cpp macros or va_list, and I figured we don't care about these legacy functions enough to warrant the extra pain. @@ typedef uint32_t; identifier dev, plane, possible_crtcs, funcs, formats, format_count, type; @@ int drm_universal_plane_init(struct drm_device *dev, struct drm_plane *plane, unsigned long possible_crtcs, const struct drm_plane_funcs *funcs, const uint32_t *formats, unsigned int format_count, enum drm_plane_type type + ,const char *name, int DOTDOTDOT ) { ... } @@ identifier dev, plane, possible_crtcs, funcs, formats, format_count, type; @@ int drm_universal_plane_init(struct drm_device *dev, struct drm_plane *plane, unsigned long possible_crtcs, const struct drm_plane_funcs *funcs, const uint32_t *formats, unsigned int format_count, enum drm_plane_type type + ,const char *name, int DOTDOTDOT ); @@ expression E1, E2, E3, E4, E5, E6, E7; @@ drm_universal_plane_init(E1, E2, E3, E4, E5, E6, E7 + ,NULL ) v2: Split crtc and plane changes apart Pass NUL for no-name instead of "" Leave drm_plane_init() alone v3: Add ', or NULL...' to @name kernel doc (Jani) Annotate the function with __printf() attribute (Jani) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1449670795-2853-1-git-send-email-ville.syrjala@linux.intel.com
2015-10-26drm/exynos: cleanup name of gem object for exynos_drmJoonyoung Shim
Struct of gem object in exynos_drm driver is struct exynos_drm_gem_obj. It's too long and we can know its meaning of name without _obj postfix. We use several names to variable name of gem object for exynos_drm - exynos_gem_obj, gem_obj and obj. Especially "obj" name can cause misunderstanding with variable name "obj" of struct drm_gem_object. This will clean about name of gem object for exynos_drm as follows. s/struct exynos_drm_gem_obj/struct exynos_drm_gem s/exynos_gem_obj or gem_obj or obj/exynos_gem Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-10-26drm/exynos: add cursor plane supportGustavo Padovan
Set one of the planes for each crtc driver as a cursor plane enabled window managers to fully work on exynos. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-09-02drm/exynos: remove exynos_drm_fb_get_buf_cnt()Joonyoung Shim
We can get buffer count of framebuffer using drm_format_num_planes(), so keeping exynos_drm_fb_get_buf_cnt() is unnecessary. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-31drm/exynos: Properly report supported formats for each deviceMarek Szyprowski
Exynos DRM reported that all planes for all supported sub-devices supports only three pixel formats: XRGB24, ARGB24 and NV12. This patch lets each Exynos DRM sub-drivers to provide the list of supported pixel formats and registers this list to DRM core. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-31drm/exynos: check for pending fb before finish updateGustavo Padovan
The current code was ignoring the end of update for all overlay planes, caring only for the primary plane update in case of pageflip. This change adds a change to start to check for pending updates for all planes through exynos_plane->pending_fb. At the start of plane update the pending_fb is set with the fb to be shown on the screen. Then only when to fb is already presented in the screen we set pending_fb to NULL to signal that the update was finished. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com> fixup! drm/exynos: check for pending fb before finish update
2015-08-16drm/exynos: merge exynos_drm_buf.c to exynos_drm_gem.cJoonyoung Shim
The struct exynos_drm_gem_obj can have fields of the struct exynos_drm_gem_buf then don't need to use exynos_drm_buf.c file. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: unify exynos_drm_plane names with drm coreGustavo Padovan
Rename crtc_{widht,height} to crtc_{w,h} and src_{width,height} to src_{w,h} to make it similar to the atomic state names. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: use drm atomic state directlyGustavo Padovan
For some fields the use of struct exynos_drm_plane filled with data from the plane state just creates a source of duplicated information and overhead. Here we change the crtc drivers to access the plane state directly simplifying the code by not relying on a exynos internal struct. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: pass struct exynos_drm_plane in update/enableGustavo Padovan
We already have the plane pointer in before calling .update_plane() or disable_plane() so pass it directly to those calls avoiding a new conversion from zpos to struct exynos_drm_plane. v2: don't remove check for suspended in FIMD (comment by Joonyoung) Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: rename win_commit/disable to atomic-like namesGustavo Padovan
Rename win_commit() helper to update_plane() and win_disable() to disable_plane(). Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-06-20drm/exynos: remove exported functions from exynos_drm_planeGustavo Padovan
Now that no one is using the functions exported by exynos_drm_plane due to the atomic conversion we can make remove some of the them or make them static. v2: remove unused exynos_drm_crtc v3: fix checkpatch error (reported by Joonyoung) Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Tested-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-06-20drm/exynos: atomic phase 3: atomic updates of planesGustavo Padovan
Now that phase 1 and 2 are complete we can switch the update/disable_plane callbacks to their atomic version. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Tested-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-06-20drm/exynos: atomic phase 2: wire up state reset(), duplicate() and destroy()Gustavo Padovan
Set CRTC, planes and connectors to use the default implementations from the atomic helper library. The helpers will work to keep track of state for each DRM object. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Tested-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-06-20drm/exynos: use adjusted_mode of crtc_state instead of modeJoonyoung Shim
Handle changes by removing copy from adjusted_mode to mode as using adjusted_mode of crtc_state. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-06-20drm/exynos: atomic phase 1: use drm_plane_helper_disable()Gustavo Padovan
The atomic helper to disable planes also uses the optional .atomic_disable() helper. The unique operation it does is calling .win_disable() Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Tested-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-06-20drm/exynos: atomic phase 1: use drm_plane_helper_update()Gustavo Padovan
Rip out the check from exynos_update_plane() and create exynos_check_plane() for the check phase enabling use to use the atomic helpers to call our check and update phases when updating planes. Update all users of exynos_update_plane() accordingly to call exynos_check_plane() before. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Tested-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>y Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-05-19drm/exynos: plane: honor buffer offset for dma_addrTobias Jakobi
Previously we were ignoring the buffer offsets that are passed through the addfb2 ioctl. This didn't cause any major issues, since for uni-planar formats (like XRGB8888) userspace would most of the time just use offsets[0]=0. However with NV12 offsets[1] is very likely non-zero. So properly apply the offsets to our dma addresses. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Acked-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-04-13drm/exynos: add ratio calculationJoonyoung Shim
Calculation ratio from exynos_drm plane codes, then each hw drivers can use it without extra operation. Also this fixes width and height of source used for actual crtc shown via screen. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-04-13drm/exynos: use src_x and src_y instead of fb_x and fb_yJoonyoung Shim
It's more reasonable to use src_x and src_y to represent source as counterpart of destination(crtc). Already we are using src_width and src_height for width and height of source. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-04-13drm/exynos: remove exynos_plane_destroy()Gustavo Padovan
The .destroy() callback for exynos can be replaced by drm_plane_cleanup(). The only extra operation on exynos_plane_destroy() was a call to exynos_plane_disable() but the plane is already disabled by a earlier call to drm_framebuffer_remove(). Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-04-13drm/exynos: make zpos property immutableGustavo Padovan
We already set each plane zpos at init, after that changes to zpos are not expected. This patch turns zpos into a read-only property so now it is impossible to set zpos. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-04-13drm/exynos: preset zpos value for overlay planesGustavo Padovan
Usually userspace don't want to have two overlay planes on the same zpos so this change assign a different zpos for each plane. Before this change a zpos of value zero was created for all planes so the userspace had to set up the zpos of every plane it wanted to use. Also all places that were storing zpos positions are now unsigned int. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-04-13drm/exynos: remove struct *_win_data abstraction on planesGustavo Padovan
struct {fimd,mixer,vidi}_win_data was just keeping the same data as struct exynos_drm_plane thus get ride of it and use exynos_drm_plane directly. It changes how planes are created and remove .win_mode_set() callback that was only filling all *_win_data structs. v2: check for return of exynos_plane_init() Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-03-18drm/exynos: Check for NULL dereference of crtcCharles Keepax
The commit "drm/exynos: remove exynos_plane_dpms" (d9ea6256) removed the use of the enabled flag, which means that the code may attempt to call win_enable on a NULL crtc. This results in the following oops on Arndale: [ 1.673479] Unable to handle kernel NULL pointer dereference at virtual address 00000368 [ 1.681500] pgd = c0004000 [ 1.684154] [00000368] *pgd=00000000 [ 1.687713] Internal error: Oops: 5 [#1] PREEMPT SMP ARM [ 1.693012] Modules linked in: [ 1.696045] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 3.19.0-07545-g57485fa #1907 [ 1.703524] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree) (....) [ 2.014803] [<c02f9cfc>] (exynos_plane_destroy) from [<c02e61b4>] (drm_mode_config_cleanup+0x168/0x20c) [ 2.024178] [<c02e61b4>] (drm_mode_config_cleanup) from [<c02f66fc>] (exynos_drm_load+0xac/0x12c) This patch adds in a check to ensure exynos_crtc is not NULL before it is dereferenced. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-02-13Merge branch 'exynos-drm-next' of ↵Dave Airlie
git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-next Summary: - Add code cleanups and bug fixups. - Add a new display controller dirver, DECON which is a new display controller of Exynos7 SoC. This device is much different from FIMD of Exynos4 and Exynos4 SoC series. * 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos: drm/exynos: Add DECON driver drm/exynos: fix NULL pointer reference drm/exynos: remove exynos_plane_dpms drm/exynos: remove mode property of exynos crtc drm/exynos: Remove exynos_plane_dpms() call with no effect drm/exynos: fix DMA_ATTR_NO_KERNEL_MAPPING usage drm/exynos: hdmi: replace fb size with mode size from win commit drm/exynos: fix no hdmi output drm/exynos: use driver internal struct drm/exynos: fix wrong pipe calculation for crtc drm/exynos: remove to use unnecessary MODULE_xxx macro drm/exynos: remove DRM_EXYNOS_DMABUF config drm/exynos: IOMMU support should not be selectable by user drm/exynos: add support for 'hdmi' clock
2015-02-11Merge tag 'topic/drm-misc-2015-02-06' of ↵Dave Airlie
git://anongit.freedesktop.org/drm-intel into drm-next Flushing out my drm-misc queue with a few oddball things all over. * tag 'topic/drm-misc-2015-02-06' of git://anongit.freedesktop.org/drm-intel: drm: Use static attribute groups for managing connector sysfs entries drm: remove DRM_FORMAT_NV12MT drm/modes: Print the mode status in human readable form drm/irq: Don't disable vblank interrupts when already disabled
2015-02-09drm/exynos: remove exynos_plane_dpmsJoonyoung Shim
The exynos_plane_dpms function handles enabled flag of exynos plane and calls internal hw driver callback function for hw overlay on/off. But it causes state disharmory problem currently and is will be obstacle to apply atomic operation later to keep non-standard per-plane dpms state like enabled flag. Let's remove enabled flag, it just stop to recall internal callback function but hw drivers can handle it properly. And call internal callback function directly then we can remove unnecessary exynos_plane_dpms function Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-02-04drm: remove DRM_FORMAT_NV12MTDaniel Vetter
So this has been merged originally in commit 83052d4d5cd518332440bb4ee63d68bb5f744e0f Author: Seung-Woo Kim <sw0312.kim@samsung.com> Date: Thu Dec 15 15:40:55 2011 +0900 drm: Add multi buffer plane pixel formats which hasn't seen a lot of review really. The problem is that it's not a real pixel format, but just a different way to lay out NV12 pixels in macroblocks, i.e. a tiling format. The new way of doing this is with the soon-to-be-merged fb modifiers. This was brough up in some long irc discussion around the entire topic, as an example of where things have gone wrong. Luckily we can correct the mistake: - The kms side support for NV12MT is all dead code because format_check in drm_crtc.c never accepted NV12MT. - The gem side for the gsc support doesn't look better: The code forgets to set the pixel format and makes a big mess with the tiling mode bits, inadvertedly setting them all. Conclusion: This never really worked (at least not in upstream) and hence we can safely correct our mistake here. Cc: Seung-Woo Kim <sw0312.kim@samsung.com> Cc: Inki Dae <inki.dae@samsung.com> Cc: Kyungmin Park <kyungmin.park@samsung.com> Cc: Rob Clark <robclark@freedesktop.org> Cc: Daniel Stone <daniel@fooishbar.org> Cc: Damien Lespiau <damien.lespiau@intel.com> Reviewed-by: Rob Clark <robclark@freedesktop.org> Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Acked-by: Joonyoung Shim <jy0922.shim@samsung.com> Acked-by: Seung-Woo Kim <sw0312.kim@samsung.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-01-25drm/exynos: create exynos_check_plane()Gustavo Padovan
Split update plane in two parts, an initial check part that can fail and the update part that can't fail. This is a important step for the upcoming atomic modesetting support. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-01-25drm/exynos: remove struct exynos_drm_managerGustavo Padovan
exynos_drm_manager was just a redundant struct to represent the crtc as well. In this commit we merge exynos_drm_manager into exynos_drm_crtc to remove an unnecessary level of indirection easing the understand of the flow on exynos. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-01-25drm/exynos: unify plane update on exynos_update_plane()Gustavo Padovan
We can safely use the exynos_update_plane() to update the plane framebuffer for both the overlay and primary planes. Note that this patch removes a call to manager->ops->commit() in exynos_drm_crtc_mode_set_commit(). The commit() call is used only by the fimd driver to set underlying timings and need only in full modeset operations. For plane update only win_commit is needed. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-01-25drm/exynos: remove exynos_plane_commit() wrapperGustavo Padovan
It's doing nothing but calling exynos_crtc->ops->win_commit(), so let's call this directly to avoid extra layers of abstraction. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>