aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/omapdrm
AgeCommit message (Collapse)AuthorFilesLines
2015-12-31drm: omapdrm: gem: Group functions by purposeLaurent Pinchart1-53/+87
Divide the GEM implementation in groups of functions to improve readability. No code change is performed by this commit. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2015-12-31drm: omapdrm: gem: Remove forward declarationsLaurent Pinchart1-44/+46
Reorder functions to get rid of forward declarations Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2015-12-31drm: omapdrm: gem: Remove unused function prototypesLaurent Pinchart1-6/+0
Several DRM core function prototypes refer to functions that don't exist anymore and are thus obviously never called. Remove them. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2015-12-31drm: omapdrm: Make fbdev emulation optionalLaurent Pinchart6-5/+24
Don't compile the fbdev emulation code when fbdev emulation support is disabled. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2015-12-31drm: omapdrm: Fix plane state free in plane reset handlerLaurent Pinchart1-5/+4
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 omap_plane_atomic_destroy_state() function to destroy the plane state instead of duplicating the code. Signed-off-by: Laurent Pinchart <[email protected]> [[email protected]: move of the func into separate patch] Signed-off-by: Tomi Valkeinen <[email protected]>
2015-12-31drm: omapdrm: move omap_plane_reset()Tomi Valkeinen1-27/+27
Move omap_plane_reset() function to avoid forward declarations in the next patch. Signed-off-by: Tomi Valkeinen <[email protected]>
2015-12-31drm/omap: Use platform_register/unregister_drivers()Thierry Reding1-19/+7
These new helpers simplify implementing multi-driver modules and properly handle failure to register one driver by unregistering all previously registered drivers. Signed-off-by: Thierry Reding <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2015-12-31drm: omapdrm: tiler: Remove unneded module alias for tilerLuis de Bethencourt1-1/+0
omap_dmm_tiler.c can't be compiled as a module and it is built unconditionally as part of omapdrm. Since it can't be used as a module, there is no need for it to have an unused MODULE_ALIAS(). Signed-off-by: Luis de Bethencourt <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2015-12-29drm/omap: make omapdrm select OMAP2_DSSTomi Valkeinen2-4/+6
Now that omapdss is only for omapdrm, we can change omapdrm to select OMAP2_DSS to enable omapdss if omapdrm is enabled, instead of omapdrm depending on omapdss. We can also change omapdss and the display drivers to depend on DRM_OMAP, so that they are only visible under omapdrm in menuconfig. Signed-off-by: Tomi Valkeinen <[email protected]> Acked-by: Dave Airlie <[email protected]> Acked-by: Rob Clark <[email protected]>
2015-12-29drm/omap: move omapdss & displays under omapdrmTomi Valkeinen58-1/+36332
Now that omapfb has its own copy of omapdss and display drivers, we can move omapdss and display drivers which omapdrm uses to omapdrm's directory. We also need to change the main drm Makefile so that omapdrm directory is always entered, because omapdss has a file that can't be built as a module. Signed-off-by: Tomi Valkeinen <[email protected]> Acked-by: Dave Airlie <[email protected]> Acked-by: Rob Clark <[email protected]>
2015-12-24Backmerge drm-fixes merge into Linus's tree into drm-next.Dave Airlie1-4/+1
This merges '5b726e06d6e8309e5c9ef4109a32caf27c71dfc8' into drm-next Just to resolve some merges to make Daniel's life easier. Signed-off-by: DAve Airlie <[email protected]>
2015-12-23Merge branch 'for-linus' into for-nextTakashi Iwai1-4/+1
Conflicts: drivers/gpu/drm/i915/intel_pm.c
2015-12-15drm/omap: use kzalloc in sita_init()Rasmus Villemoes1-5/+2
Signed-off-by: Rasmus Villemoes <[email protected]> Signed-off-by: Thierry Reding <[email protected]> Signed-off-by: Boris Brezillon <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/1450178476-26284-6-git-send-email-boris.brezillon@free-electrons.com Signed-off-by: Daniel Vetter <[email protected]>
2015-12-14drm/omap: fix fbdev pix format to support all platformsTomi Valkeinen1-4/+1
omap_fbdev always creates a framebuffer with ARGB8888 pixel format. On OMAP3 we have VIDEO1 overlay that does not support ARGB8888, and on OMAP2 none of the overlays support ARGB888. This patch changes the omap_fbdev's fb to XRGB8888, which is supported by all platforms. Signed-off-by: Tomi Valkeinen <[email protected]> Tested-by: H. Nikolaus Schaller <[email protected]> Acked-by: Laurent Pinchart <[email protected]>
2015-12-11drm: Pass 'name' to drm_encoder_init()Ville Syrjälä1-1/+1
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ä <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2015-12-11drm: Pass 'name' to drm_universal_plane_init()Ville Syrjälä1-1/+1
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ä <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2015-12-11drm: Pass 'name' to drm_crtc_init_with_planes()Ville Syrjälä1-1/+1
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ä <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2015-11-24drm: Pass the user drm_mode_fb_cmd2 as const to .fb_create()Ville Syrjälä2-5/+5
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ä <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
2015-10-19drm: Check crtc viewport correctly with rotated primary plane on atomic driversVille Syrjälä1-3/+0
On atomic drivers we can dig out the primary plane rotation from the plane state instead of looking at the legacy crtc->invert_dimensions flag. The flag is not set by anyone except omapdrm, and it would be racy to set it the same way in the atomic helpers. v2: Kill crtc->invert_dimensions totally since omap is state based already and no one else ever used it (Matt) Cc: Matt Roper <[email protected]> Cc: Tvrtko Ursulin <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Tomi Valkeinen <[email protected]> Cc: Rob Clark <[email protected]> Signed-off-by: Ville Syrjälä <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Matt Roper <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
2015-10-16drm/gem: Drop struct_mutex requirement from drm_gem_mmap_objDaniel Vetter1-3/+0
Since commit 131e663bd6f1055caaff128f9aa5071d227eeb72 Author: Daniel Vetter <[email protected]> Date: Thu Jul 9 23:32:33 2015 +0200 drm/gem: rip out drm vma accounting for gem mmaps there is no need for this any more. v2: Fixup compile noise spotted by 0-day build. Link: http://mid.gmane.org/[email protected] Reviewed-by: David Herrmann <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
2015-10-16drm/<drivers>: Drop DRM_UNLOCKED from modeset driversDaniel Vetter1-6/+6
Just one special case (since i915 lost its ums code, yay): - radeon: Has slots for the old ums ioctls which don't have DRM_UNLOCKED, but all filled with drm_invalid_op. So ok to drop it everywhere. Every other kms driver just has DRM_UNLOCKED for all their ioctls, as they should. v2: admgpu happened, include that one too. And i915 lost its UMS support which means we can change all the i915 ioctls too. v3: Rebased on top of new vmwgfx DX interface extensions. v4: Rebase on top of render-node support in exynos. Signed-off-by: Daniel Vetter <[email protected]> Reviewed-by: David Herrmann <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
2015-10-07drm: Stop using drm_vblank_count() as the hw frame counterVille Syrjälä1-1/+1
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 <[email protected]> Cc: Thierry Reding <[email protected]> Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: Vincent Abriou <[email protected]> [danvet: s/int pipe/unsigned int pipe/ to follow Thierry's interface change.] Signed-off-by: Daniel Vetter <[email protected]>
2015-10-06drm/irq: Use unsigned int pipe in public APIThierry Reding2-10/+10
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 <[email protected]> Cc: Alex Deucher <[email protected]> Cc: Russell King <[email protected]> Cc: Inki Dae <[email protected]> Cc: Jianwei Wang <[email protected]> Cc: Alison Wang <[email protected]> Cc: Patrik Jakobsson <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Jani Nikula <[email protected]> Cc: Philipp Zabel <[email protected]> Cc: David Airlie <[email protected]> Cc: Rob Clark <[email protected]> Cc: Ben Skeggs <[email protected]> Cc: Tomi Valkeinen <[email protected]> Cc: Laurent Pinchart <[email protected]> Cc: Mark Yao <[email protected]> Cc: Benjamin Gaignard <[email protected]> Cc: Vincent Abriou <[email protected]> Cc: Thomas Hellstrom <[email protected]> Signed-off-by: Thierry Reding <[email protected]> Reviewed-by: Ville Syrjälä <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
2015-10-05drm: Use DRM_ROTATE_MASK and DRM_REFLECT_MASKJoonas Lahtinen2-3/+3
Avoid magic numbers and use the introduced defines. Cc: Ville Syrjälä <[email protected]> Signed-off-by: Joonas Lahtinen <[email protected]> Reviewed-by: Ville Syrjälä <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
2015-09-24drm: Spell vga_switcheroo consistentlyLukas Wunner1-1/+1
Currently everyone and their dog has their own favourite spelling for vga_switcheroo. This makes it hard to grep dmesg for log entries relating to vga_switcheroo. It also makes it hard to find related source files in the tree. vga_switcheroo.c uses pr_fmt "vga_switcheroo". Use that everywhere. Signed-off-by: Lukas Wunner <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
2015-09-08drm/atomic-helper: Add option to update planes only on active crtcDaniel Vetter1-1/+1
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 <[email protected]> Cc: Thierry Reding <[email protected]> Cc: Laurent Pinchart <[email protected]> Reviewed-by: Thierry Reding <[email protected]> Tested-by: Thierry Reding <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
2015-09-08drm/atomic: Make prepare_fb/cleanup_fb only take state, v3.Maarten Lankhorst1-4/+6
This removes the need to separately track fb changes i915. That will be done as a separate commit, however. Changes since v1: - Add dri-devel to cc. - Fix a check in intel's prepare and cleanup fb to take rotation into account. Changes since v2: - Split out i915 changes to a separate commit. Cc: [email protected] Signed-off-by: Maarten Lankhorst <[email protected]> Reviewed-by: Daniel Stone <[email protected]> [danvet: Squash in msm fixup from Maarten.] Signed-off-by: Daniel Vetter <[email protected]>
2015-08-06drm/omap: Use new drm_fb_helper functionsArchit Taneja1-25/+13
Use the newly created wrapper drm_fb_helper functions instead of calling core fbdev functions directly. They also simplify the fb_info creation. v3: - Update error handling for new drm_fb_helper funcs. Check using IS_ERR() instead of checking for NULL. Reported-by: Dan Carpenter <[email protected]> v2: - No changes Cc: Tomi Valkeinen <[email protected]> Cc: Laurent Pinchart <[email protected]> Signed-off-by: Archit Taneja <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
2015-08-06drm/omap: Fixup compile failDaniel Vetter1-2/+4
Maarten didn't fully test his patches on all drm drivers and apparently missed a few places when grepping. Cc: Maarten Lankhorst <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
2015-07-02drm/omap: replace ALIGN(PAGE_SIZE) by PAGE_ALIGNFabian Frederick1-1/+1
use mm.h definition Cc: David Airlie <[email protected]> Cc: Tomi Valkeinen <[email protected]> Cc: [email protected] Signed-off-by: Fabian Frederick <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2015-07-02drm/omap: fix align_pitch() for 24 bits per pixelTomi Valkeinen1-1/+1
align_pitch() uses ALIGN() to ensure the pitch is aligned to SGX's requirement of 8 pixels. However, ALIGN() expects the alignment value to be a power of two, which is not the case for 24 bits per pixels. Use roundup() instead, which works for all alignments. This fixes the error seen with 24 bits per pixel modes: "buffer pitch (2176 bytes) is not a multiple of pixel size (3 bytes)" Signed-off-by: Tomi Valkeinen <[email protected]>
2015-07-02drm/omap: fix omap_gem_put_paddr() error handlingTomi Valkeinen2-6/+4
If tiler_unpin() call in omap_gem_put_paddr() fails, omap_gem_put_paddr() will immediately stop processing and return an error. This patch remoes that error checking, and also removes omap_gem_put_paddr()'s return value, because: * The caller of omap_gem_put_paddr() can do nothing if an error happens, so it's pointless to return an error value * If tiler_unpin() fails, the GEM object will possibly be left in an undefined state, where the DMM mapping may have been removed, but the GEM object still thinks everything is as it should be, leading to crashes later. * There's no point in returning an error from a "free" call, as the caller can do nothing about it. So it's better to clean up as much as possible. Signed-off-by: Tomi Valkeinen <[email protected]> Acked-by: Laurent Pinchart <[email protected]>
2015-07-02drm/omap: fix omap_framebuffer_unpin() error handlingTomi Valkeinen2-13/+5
omap_framebuffer_unpin() check the return value of omap_gem_put_paddr() and return immediately if omap_gem_put_paddr() fails. This patch removes the check for the return value, and also removes the return value of omap_framebuffer_unpin(), because: * Nothing checks the return value of omap_framebuffer_unpin(), and even something did check it, there's nothing the caller can do to handle the error. * If a omap_gem_put_paddr() fails, the framebuffer's other planes will be left unreleased. So it's better to call omap_gem_put_paddr() for all the planes, even if one would fail. Signed-off-by: Tomi Valkeinen <[email protected]> Acked-by: Laurent Pinchart <[email protected]>
2015-07-02drm/omap: increase DMM transaction timeoutTomi Valkeinen1-1/+1
The DMM driver uses a timeout of 1 ms to wait for DMM transaction to finish. While DMM should always finish the operation within that time, the timeout is rather strict. Small misbehavior of the system (e.g. an irq taking too long) could trigger the timeout. As the DMM is a critical piece of code for display memory management, let's increase the timeout to 100 ms so that we are less likely to fail a memory allocation in case of system misbehaviors. 100 ms is just a guess of a reasonably large timeout. The HW should accomplish the task in less than 1 ms. Signed-off-by: Tomi Valkeinen <[email protected]>
2015-07-02drm/omap: check that plane is inside crtcTomi Valkeinen1-0/+26
DRM allows planes to be partially off-screen, but DSS hardware does not. This patch adds the necessary check to reject plane configs if the plane is not fully inside the crtc. Signed-off-by: Tomi Valkeinen <[email protected]> Acked-by: Laurent Pinchart <[email protected]>
2015-06-24drm/omap: return error if dma_alloc_writecombine failsTomi Valkeinen1-7/+11
On a platform with no TILER (e.g. omap3, am43xx), when the user wants to allocate buffer with flag OMAP_BO_SCANOUT, the buffer needs to be allocated with dma_alloc_writecombine. For some reason the driver does not return an error if that alloc fails, instead it continues without backing memory. This leads to errors later when the user tries to use the buffer. This patch makes the driver return an error if dma_alloc_writecombine fails. Signed-off-by: Tomi Valkeinen <[email protected]> Acked-by: Laurent Pinchart <[email protected]>
2015-06-12drm: omapdrm: new vblank and event handlingTomi Valkeinen3-76/+70
Rework the crtc event/flip_wait system as follows: - If we enable a crtc (full modeset), we set omap_crtc->pending and register vblank irq. - If we need to set GO bit (page flip), we do the same but also set the GO bit. - On vblank we unregister the irq, clear the 'pending' flag, send vblank event to userspace if crtc->state->event != NULL, and wake up 'pending_wait' wq. - In omap_atomic_complete() we wait for the 'pending' flag to get reset for all enabled crtcs using 'pending_wait' wq. The above ensures that we send the events to userspace in vblank, and that after the wait in omap_atomic_complete() everything for the affected crtcs has been completed. Signed-off-by: Tomi Valkeinen <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]>
2015-06-12drm: omapdrm: merge omap_crtc_flush and omap_crtc_atomic_flushTomi Valkeinen1-21/+14
omap_crtc_atomic_flush() is the only user of omap_crtc_flush(), so just move the code from omap_crtc_flush() to omap_crtc_atomic_flush(). Signed-off-by: Tomi Valkeinen <[email protected]> Acked-by: Laurent Pinchart <[email protected]>
2015-06-12drm: omapdrm: add lock for fb pinningTomi Valkeinen1-1/+18
Before atomic modesetting omap_framebuffer_pin() and omap_framebuffer_unpin() were always called with modesetting locks taken. With atomic modesetting support this is no longer the case, and we need locking to protect the pin_count and the paddr, as multiple threads may pin the same fb concurrently. This patch adds a mutex to struct omap_framebuffer, and uses it in omap_framebuffer_pin() and omap_framebuffer_unpin(). Signed-off-by: Tomi Valkeinen <[email protected]> Acked-by: Laurent Pinchart <[email protected]>
2015-06-12drm: omapdrm: if omap_plane_atomic_update fails, disable planeTomi Valkeinen1-1/+3
omap_plane_atomic_update() calls dispc_ovl_setup(), which can fail (but shouldn't). To make the code a bit more robust, make sure the plane gets disabled if dispc_ovl_setup() fails, as otherwise we might get illegal HW configuration leading to error interrupts. Signed-off-by: Tomi Valkeinen <[email protected]> Acked-by: Laurent Pinchart <[email protected]>
2015-06-12drm: omapdrm: inline omap_plane_setup into update/disableTomi Valkeinen1-27/+17
At the moment we have omap_plane_setup() function which handles both enabling (and configuring) and disabling the plane. With atomic modesetting we have separate hooks for plane enable/config and disable. This patch moves the code from omap_plane_setup() to omap_plane_atomic_update() and omap_plane_atomic_disable(). Signed-off-by: Tomi Valkeinen <[email protected]> Acked-by: Laurent Pinchart <[email protected]>
2015-06-12drm: omapdrm: omap_plane_setup() cannot fail, use WARNTomi Valkeinen1-9/+4
With atomic modesetting, omap_plane_setup()'s return value is ignored as the functions using it cannot fail. dispc_ovl_setup(), called by omap_plane_setup(), can fail (but shouldn't). Instead of returning an error from omap_plane_setup() which gets ignored, return void and use WARN if dispc_ovl_setup() fails. Signed-off-by: Tomi Valkeinen <[email protected]> Acked-by: Laurent Pinchart <[email protected]>
2015-06-12drm: omapdrm: Don't setup planes manually from CRTC .enable()/.disable()Laurent Pinchart3-22/+1
Planes setup is handled by the DRM core through the atomic helpers, there's no need to duplicate the code in the CRTC .enable() and .disable() operations. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2015-06-12drm: omapdrm: Don't flush CRTC when enabling or disabling itLaurent Pinchart1-4/+0
The omap_crtc_flush() call in omap_crtc_enable() and omap_crtc_disable() is a no-op, as the display manager is always disabled at this point. Just remove the function call. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2015-06-12drm: omapdrm: Move encoder setup to encoder operationsLaurent Pinchart3-89/+34
Now that the driver is fully converted to atomic operations, and that the atomic helpers call the operations in the right order, we can move encoder setup to where it belongs, in the encoder operations. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2015-06-12drm: omapdrm: Simplify DSS power managementLaurent Pinchart2-11/+4
Instead of sprinkling dispc_runtime_get() and dispc_runtime_put() calls in various CRTC operations, move all power management code to the atomic commit function. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2015-06-12drm: omapdrm: Remove nested PM get/sync when configuring encodersLaurent Pinchart1-4/+0
The omap_crtc_encoder_setup() function is always called with the DSS enabled. Remove the dispc_runtime_get() and dispc_runtime_put() calls. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2015-06-12drm: omapdrm: Support unlinking page flip events prematurelyLaurent Pinchart3-29/+39
DRM page flip vblank events requested by page flips or atomic commits are created by the DRM core and then passed to driver through CRTC states (for atomic commit) or directly to the page flip handler (for legacy page flips). The events are then kept aside until the page flip completes, at which point drivers queue them for delivery with a call to drm_send_vblank_event(). When a DRM file handle is closed events pending for delivery are cleaned up automatically by the DRM core. Events that have been passed to the driver but haven't completed yet, however, are not handled by the DRM core. Drivers are responsible for destroying them and must not attempt to queue them for delivery. This is usually handled by drivers' preclose() handlers that cancel and destroy page flip events that reference the file handle being closed. With asynchronous atomic updates the story becomes more complex. Several asynchronous atomic updates can be pending, each of them carrying per-CRTC events. As the atomic_commit() operation doesn't receive a file handle context, drivers can't know which file handle a pending update refers to, making it difficult to cancel or wait for completion of updates related to the file handle being closed. It should be noted that cancelling page flips or waiting for atomic updates completion isn't required by the DRM core when closing a file handle. The only requirement is that no event gets queued for delivery after the preclose() operation returns. This can easily be achieved by storing events for atomic commits in a list, unlinking events from the file handle being closed by setting the file_priv field to NULL, and skipping delivery of unlinked events. This logic replaces the page flip cancellation completely. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2015-06-12drm: omapdrm: omap_crtc_flush() isn't called with modeset lockedLaurent Pinchart1-1/+0
When performing asynchronous atomic updates the modeset lock isn't taken around the callers of omap_crtc_flush(). This isn't an issue though, as access to the CRTC is properly serialized. Just drop the warning. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2015-06-12drm: omapdrm: Don't get/put dispc in omap_crtc_flush()Laurent Pinchart1-4/+0
The omap_crtc_flush() function is always called with a reference to the dispc held. Remove unnecessary calls to dispc_runtime_get() and dispc_runtime_put(). Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>