summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/rcar-du
AgeCommit message (Collapse)Author
2016-01-20dma-mapping: always provide the dma_map_ops based implementationChristoph Hellwig
Move the generic implementation to <linux/dma-mapping.h> now that all architectures support it and remove the HAVE_DMA_ATTR Kconfig symbol now that everyone supports them. [valentinrothberg@gmail.com: remove leftovers in Kconfig] Signed-off-by: Christoph Hellwig <hch@lst.de> Cc: "David S. Miller" <davem@davemloft.net> Cc: Aurelien Jacquiot <a-jacquiot@ti.com> Cc: Chris Metcalf <cmetcalf@ezchip.com> Cc: David Howells <dhowells@redhat.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Haavard Skinnemoen <hskinnemoen@gmail.com> Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no> Cc: Helge Deller <deller@gmx.de> Cc: James Hogan <james.hogan@imgtec.com> Cc: Jesper Nilsson <jesper.nilsson@axis.com> Cc: Koichi Yasutake <yasutake.koichi@jp.panasonic.com> Cc: Ley Foon Tan <lftan@altera.com> Cc: Mark Salter <msalter@redhat.com> Cc: Mikael Starvik <starvik@axis.com> Cc: Steven Miao <realmz6@gmail.com> Cc: Vineet Gupta <vgupta@synopsys.com> Cc: Christian Borntraeger <borntraeger@de.ibm.com> Cc: Joerg Roedel <jroedel@suse.de> Cc: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Valentin Rothberg <valentinrothberg@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-12-15drm: Constify drm_encoder_slave_funcsVille Syrjälä
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Link: http://patchwork.freedesktop.org/patch/msgid/1450178476-26284-11-git-send-email-boris.brezillon@free-electrons.com Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-12-11drm: Pass 'name' to drm_encoder_init()Ville Syrjälä
Done with coccinelle for the most part. However, 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. @@ identifier dev, encoder, funcs; @@ int drm_encoder_init(struct drm_device *dev, struct drm_encoder *encoder, const struct drm_encoder_funcs *funcs, int encoder_type + ,const char *name, int DOTDOTDOT ) { ... } @@ identifier dev, encoder, funcs; @@ int drm_encoder_init(struct drm_device *dev, struct drm_encoder *encoder, const struct drm_encoder_funcs *funcs, int encoder_type + ,const char *name, int DOTDOTDOT ); @@ expression E1, E2, E3, E4; @@ drm_encoder_init(E1, E2, E3, E4 + ,NULL ) v2: 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/1449670818-2966-1-git-send-email-ville.syrjala@linux.intel.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-12-11drm: Pass 'name' to drm_crtc_init_with_planes()Ville Syrjälä
Done with coccinelle for the most part. However, 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_crtc_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. @@ identifier dev, crtc, primary, cursor, funcs; @@ int drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc, struct drm_plane *primary, struct drm_plane *cursor, const struct drm_crtc_funcs *funcs + ,const char *name, int DOTDOTDOT ) { ... } @@ identifier dev, crtc, primary, cursor, funcs; @@ int drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc, struct drm_plane *primary, struct drm_plane *cursor, const struct drm_crtc_funcs *funcs + ,const char *name, int DOTDOTDOT ); @@ expression E1, E2, E3, E4, E5; @@ drm_crtc_init_with_planes(E1, E2, E3, E4, E5 + ,NULL ) v2: Split crtc and plane changes apart Pass NULL for no-name instead of "" Leave drm_crtc_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/1449670771-2751-1-git-send-email-ville.syrjala@linux.intel.com
2015-11-24drm: Pass the user drm_mode_fb_cmd2 as const to .fb_create()Ville Syrjälä
Drivers shouldn't clobber the passed in addfb ioctl parameters. i915 was doing just that. To prevent it from happening again, pass the struct around as const, starting all the way from internal_framebuffer_create(). Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-10-21drm: rcar-du: Add support for the R8A7794 DULaurent Pinchart
The R8A7794 DU has a fixed output routing configuration with one RGB output per CRTC and thus lacks the RGB output routing register field. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-10-21drm: rcar-du: Add support for the R8A7793 DULaurent Pinchart
The R8A7793 DU is identical to the R8A7791 and thus only requires a new DT compatible string. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-10-20drm: rcar-du: Fix plane state free in plane reset handlerLaurent Pinchart
The plane reset handler frees the plane state and allocates a new default state, but when doing so attempt to free the plane state using the base plane state pointer instead of casting it to the driver-specific state object that has been allocated. Fix it by using the rcar_du_plane_atomic_destroy_state() function to destroy the plane state instead of duplicating the code. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Thierry Reding <treding@nvidia.com>
2015-10-20drm: rcar-du: Enable DU0 to DPAD connection on R8A7791Laurent Pinchart
The DPAD RGB output can be driven by both DU0 and DU1 on R8A7791. Mark the DU0 connection as possible. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-10-20drm: rcar-du: Add dependency on OFLaurent Pinchart
The driver requires OF support, add a dependency in Kconfig and remove the platform_device_id table that isn't used anymore. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
2015-10-20drm: rcar-du: Remove obsolete rcar-du-r8a779x platform_device_id entriesGeert Uytterhoeven
Since commit a483dcbfa21f919c ("ARM: shmobile: lager: Remove legacy board support"), R-Car Gen2 SoCs are only supported in generic DT-only ARM multi-platform builds. The driver doesn't need to match platform devices by name anymore, hence remove the corresponding platform_device_id entry. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-10-07drm: Stop using drm_vblank_count() as the hw frame counterVille Syrjälä
drm_vblank_count() returns the software counter. We should not pretend it's the hw counter since we use the hw counter to figuere out what the software counter value should be. So instead provide a new function drm_vblank_no_hw_counter() for drivers that don't have a real hw counter. The new function simply returns 0, which is about the only thing it can do. Cc: Vincent Abriou <vincent.abriou@st.com> Cc: Thierry Reding <treding@nvidia.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Vincent Abriou <vincent.abriou@st.com> [danvet: s/int pipe/unsigned int pipe/ to follow Thierry's interface change.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-10-06drm/irq: Use unsigned int pipe in public APIThierry Reding
This continues the pattern started in commit cc1ef118fc09 ("drm/irq: Make pipe unsigned and name consistent"). This is applied to the public APIs and driver callbacks, so pretty much all drivers need to be updated to match the new prototypes. Cc: Christian König <christian.koenig@amd.com> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Russell King <rmk+kernel@arm.linux.org.uk> Cc: Inki Dae <inki.dae@samsung.com> Cc: Jianwei Wang <jianwei.wang.chn@gmail.com> Cc: Alison Wang <alison.wang@freescale.com> Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Cc: Daniel Vetter <daniel.vetter@intel.com> Cc: Jani Nikula <jani.nikula@linux.intel.com> Cc: Philipp Zabel <p.zabel@pengutronix.de> Cc: David Airlie <airlied@linux.ie> Cc: Rob Clark <robdclark@gmail.com> Cc: Ben Skeggs <bskeggs@redhat.com> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Mark Yao <mark.yao@rock-chips.com> Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org> Cc: Vincent Abriou <vincent.abriou@st.com> Cc: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Thierry Reding <treding@nvidia.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-08drm/atomic-helper: Add option to update planes only on active crtcDaniel Vetter
With drivers supporting runtime pm it's generally not a good idea to touch the hardware when it's off. Add an option to the commit_planes helper to support this case. Note that the helpers already add all planes on a crtc when a modeset happens, hence plane updates will not be lost if drivers set this to true. v2: Check for NULL state->crtc before chasing the pointer. Also check both old and new crtc if there's a switch. Finally just outright disallow switching crtcs for a plane if the plane is in active use, on most hardware that doesn't make sense. v3: Since commit_planes(active_only = true) is for enabling things only after all the crtc are on we should only look at the new crtc to decide whether to call the plane hooks - if the current CRTC isn't on then skip. If the old crtc (when moving a plane) went down then the plane should have been disabled as part of the pipe shutdown work already. For which there's currently no helper really unfortunately. Also move the check for wether a plane gets a new CRTC assigned while still in active use out of this patch. v4: Rebase over exynos changes. Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Thierry Reding <treding@nvidia.com> Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Thierry Reding <treding@nvidia.com> Tested-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-07-27drm/atomic: pass old crtc state to atomic_begin/flush.Maarten Lankhorst
In intel it's useful to keep track of some state changes with old crtc state vs new state, for example to disable initial planes or when a modeset's prevented during fastboot. Cc: dri-devel@lists.freedesktop.org Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com> [danvet: squash in fixup for exynos provided by Maarten.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-06-16drm: rcar-du: Use the drm atomic state duplication helpers for planesLaurent Pinchart
Ensure that the duplicate and destroy plane state operations will always be in sync with the DRM core implementation of the plane state by using the __drm_atomic_helper_plane_duplicate_state() and __drm_atomic_helper_plane_destroy_state() functions designed especially for this purpose. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2015-06-16drm: rcar-du: Clean up planes in the error paths of .atomic_commit()Laurent Pinchart
When the .atomic_commit() handler fails, clean up planes previoulsy prepared by drm_atomic_helper_prepare_planes() with a call to drm_atomic_helper_cleanup_planes(). Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2015-06-16drm: rcar-du: Convert rcar_du_encoders_init_one() return value to 0/<0Laurent Pinchart
The function returns 1 on success, and either 0 or a negative error code on failure. As the 0 and negative values don't need to be differentiated by the caller, convert it to the usual scheme of returning 0 on success and a negative error code on failure. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-06-16drm: rcar-du: Clarify error message when encoder initialization failsLaurent Pinchart
A failure to initialize an encoder currently prints an error message in the kernel log without mentioning which encoder failed to initialize. To help debugging initialization issues print the encoder DT node name. This requires moving the error message to the rcar_du_encoders_init_one function and refactoring it slightly. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-06-16drm: rcar-du: Fix crash with groups that have less than 9 planesLaurent Pinchart
Commit 917de180379d ("drm: rcar-du: Implement universal plane support") made the number of planes per group dynamic, but didn't update all loops over the planes array, resulting in out-of-bound accesses on DU instances that have an odd number of CRTCs (such as the R8A7790). Fix it. Fixes: 917de180379d ("drm: rcar-du: Implement universal plane support") Cc: stable@vger.kernel.org Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-06-16drm: rcar-du: Disable all planes when stopping the CRTCLaurent Pinchart
The DSnPR plane configuration registers are updated on vblank, and no vblank will occur once the CRTC is stopped. We thus can't only disable planes right before starting the CRTC as it would start scanning out immediately from old frame buffers until the next vblank. Fix the problem by disabling all planes when stopping the CRTC and wait for the change to take effect. This increases the CRTC stop delay, especially when multiple CRTCs are stopped in one operation as we now wait for one vblank per CRTC. Whether this can be improved needs to be researched. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-06-16drm: rcar-du: Print the error value when DRM/KMS init failsLaurent Pinchart
This helps debugging probe failures. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-05-25drm: rcar-du: Split planes pre-association 4/4 between CRTCsLaurent Pinchart
If we have more than one CRTCs in a group pre-associate planes 0-3 with CRTC 0 and planes 4-7 with CRTC 1 to minimize flicker occurring when the association is changed. The pre-association could be controlled by a module parameter if needed. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-05-25drm: rcar-du: Store the number of CRTCs per group in the group structureLaurent Pinchart
The number of CRTCs in a group is only used to implement plane initialization for now, but is also needed to implement pre-association of planes to CRTCs. Store it in the group structure instead of computing it on demand. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-05-25drm: rcar-du: Consider plane to CRTC associations in the plane allocatorLaurent Pinchart
Hardware planes are driven by the timing generator of the CRTC they are associated to. Changing the association requires restarting the CRTC group that the plane belongs to, resulting in flicker on the other CRTC. To avoid flicker as much as possible, try to allocate planes first from the free planes already associated with the target CRTC. If allocation fails then fall back to allocation from all free planes. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-05-25drm: rcar-du: Keep plane to CRTC associations when disabling a planeLaurent Pinchart
Changing the plane to CRTC associations requires restarting the CRTC group, creating visible flicker. Mitigate the issue by changing plane association only when a plane becomes enabled, not when it get disabled. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-05-25drm: rcar-du: Add plane allocation debuggingLaurent Pinchart
Plane allocation is a complex process, add debugging statements to help finding out what could might wrong. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-05-25drm: rcar-du: Rename to_rcar_du_plane_state to to_rcar_plane_stateLaurent Pinchart
All other cast functions are named without using "du", make the plane state cast consistent with them. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-05-25drm: rcar-du: Embed rcar_du_planes structure into rcar_du_groupLaurent Pinchart
The rcar_du_planes structure contains a single field and is only instantiated in the rcar_du_group structure. Embed it directly and remove the rcar_du_planes structure. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-05-25drm: rcar-du: Move properties from rcar_du_planes to rcar_du_deviceLaurent Pinchart
The plane property objects are instantiated once per CRTC group, while they should be instantiated once globally for the device. Fix this and move them to the rcar_du_device structure. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-05-25drm: rcar-du: Document the rcar_du_plane_state structureLaurent Pinchart
Document the structure fields using kerneldoc. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-05-25drm: rcar-du: Document the rcar_du_crtc structureLaurent Pinchart
Document the structure fields using kerneldoc. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-04-13Merge tag 'of-graph-drm-2015-04-08' of ↵Dave Airlie
git://git.pengutronix.de/git/pza/linux into drm-next drm: Use of-graph helpers to loop over endpoints Convert all drm callers that use of_graph_get_next_endpoint to loop over of-graph endpoints to the newly introduced for_each_endpoint_of_node helper macro. * tag 'of-graph-drm-2015-04-08' of git://git.pengutronix.de/git/pza/linux: drm/rockchip: use for_each_endpoint_of_node macro, drop endpoint reference on break drm/rcar-du: use for_each_endpoint_of_node macro drm/imx: use for_each_endpoint_of_node macro in imx_drm_encoder_get_mux_id drm: use for_each_endpoint_of_node macro in drm_of_find_possible_crtcs of: Explicitly include linux/types.h in of_graph.h dt-bindings: brcm: rationalize Broadcom documentation naming of/unittest: replace 'selftest' with 'unittest' Documentation: rename of_selftest.txt to of_unittest.txt Documentation: update the of_selftest.txt dt: OF_UNITTEST make dependency broken MAINTAINERS: Pantelis Antoniou device tree overlay maintainer of: Add of_graph_get_port_by_id function of: Add for_each_endpoint_of_node helper macro of: Decrement refcount of previous endpoint in of_graph_get_next_endpoint
2015-04-08drm/rcar-du: use for_each_endpoint_of_node macroPhilipp Zabel
Using the for_each_... macro should make the code a bit shorter and easier to read. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2015-03-19drm: rcar-du: Enable the atomic updates APILaurent Pinchart
Set the DRIVER_ATOMIC flag to enable usage of the atomic updates API with the driver. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-03-19drm: rcar-du: Don't initialize event->pipe fieldLaurent Pinchart
The field is set by drm_send_vblank_event(), there's no need to preinitialize it. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-03-19drm: rcar-du: Fix framebuffer reference leak through plane stateLaurent Pinchart
Plane state duplication takes a reference to the framebuffer stored in the state, but state destroy doesn't release it. This causes a reference leak. Fix it. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-03-03drm: rcar-du: Fix race condition in hardware plane allocatorLaurent Pinchart
The plane allocator has been inherently racy since the beginning of the transition to atomic updates, as the allocator lock is released between free plane check (at .atomic_check() time) and the reservation (at .atomic_update() time). To fix it, create a new allocator solely based on the atomic plane states without keeping any external state and perform allocation in the .atomic_check() handler. The core idea is to replace the free planes bitmask with a collective knowledge based on the allocated hardware plane(s) for each KMS plane. The allocator then loops over all plane states to compute the free planes bitmask, allocates hardware planes based on that bitmask, and stores the result back in the plane states. For this to work we need to access the current state of planes not touched by the atomic update. To ensure that it won't be modified, we need to lock all planes using drm_atomic_get_plane_state(). This effectively serializes atomic updates from .atomic_check() up to completion, either when swapping the states if the check step has succeeded, or when freeing the states if the check step has failed. Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-03-03drm: rcar-du: Move group locking inside rcar_du_crtc_update_planes()Laurent Pinchart
Only the planes to CRTCs association control register DPTSR needs to be protected by custom locking, don't hold the mutex around the whole code. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-03-03drm: rcar-du: Move plane commit code from CRTC start to CRTC resumeLaurent Pinchart
As the DRM core will commit plane states when performing atomic updates, those don't need to be committed manually when the CRTC is started except in the system resume code path. However, the atomic plane commit step is currently performed between mode set disable and mode set enable to mimick the legacy mode setting operations order. This causes the device clocks to be disabled after applying plane settings and reenabled when enabling the CRTC, potentially losing hardware in between. Reorder the operations to enable the CRTC first and only then apply plane settings, removing the need to manage clocks in the atomic begin and flush handlers. We can then move the plane state commit code out of the CRTC start handler to the system resume handler. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-03-03drm: rcar-du: Move plane format to plane stateLaurent Pinchart
The format stored in the rcar_du_plane structure is part of the plane state. Move it to the rcar_du_plane_state structure and precompute it in the .atomic_check() handler. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-03-03drm: rcar-du: Remove unneeded rcar_du_crtc plane fieldLaurent Pinchart
The rcar_du_crtc plane field is only used to check for an error that can't occur. Remove it. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-03-03drm: rcar-du: Replace plane crtc and enabled fields by plane stateLaurent Pinchart
The crtc and enabled fields duplicates information stored in the plane state. Use the plane state instead and remove the fields. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-03-03drm: rcar-du: Rework plane setup codeLaurent Pinchart
Now that the plane setup code isn't called outside of the plane implementation, it can be simplified by merging the rcar_du_plane_compute_base() and rcar_du_plane_update_base() functions. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-03-03drm: rcar-du: Switch plane set_property to atomic helpersLaurent Pinchart
Allow setting up plane properties atomically using the plane set_property atomic helper. The properties are now stored in the plane state (requiring subclassing it) and applied when updating the planes. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-03-03drm: rcar-du: Switch page flip to atomic helpersLaurent Pinchart
The atomic page flip helper implements the page flip operation using asynchronous commits. As the legacy page flip was the last CRTC operation that needed direct access to plane setup, the plane setup functions can now become private to the plane implementation. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-03-03drm: rcar-du: Implement asynchronous commit supportLaurent Pinchart
Implement a custom .atomic_commit() handler that supports asynchronous commits using a work queue. This can be used for userspace-driven asynchronous commits, as well as for an atomic page flip implementation. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-03-03drm: rcar-du: Replace encoder mode_fixup with atomic_checkLaurent Pinchart
The encoder .mode_fixup() operation is legacy, atomic updates uses the new .atomic_check() operation. Convert the encoders drivers. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2015-03-03drm: rcar-du: Switch connector DPMS to atomic helpersLaurent Pinchart
The atomic connector DPMS helper implements the connector DPMS operation using atomic commit, removing the need for DPMS helper operations on CRTCs and encoders. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>