summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/exynos/exynos_mixer.c
Commit message (Collapse)AuthorAgeFilesLines
* drm/exynos: fix a timeout loopDan Carpenter2017-01-311-1/+1
| | | | | | | | | | | | | | We were trying to print an error message if we timed out here, but the loop actually ends with "tries" set to UINT_MAX and not zero. Fix this by changing from tries-- to --tries. A for loop would actually be the most natural way to do this. My fix means we only loop 99 times instead of 100 but that's probably ok. Fixes: a696394c5224 ('drm/exynos: mixer: simplify loop in vp_win_reset()') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* drm: Nuke fb->pixel_formatVille Syrjälä2016-12-151-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace uses of fb->pixel_format with fb->format->format. Less duplicated information is a good thing. Note that coccinelle failed to eliminate the "/* fourcc format */" comment from drm_framebuffer.h, so I had to do that part manually. @@ struct drm_framebuffer *FB; expression E; @@ drm_helper_mode_fill_fb_struct(...) { ... - FB->pixel_format = E; ... } @@ struct drm_framebuffer *FB; expression E; @@ i9xx_get_initial_plane_config(...) { ... - FB->pixel_format = E; ... } @@ struct drm_framebuffer *FB; expression E; @@ ironlake_get_initial_plane_config(...) { ... - FB->pixel_format = E; ... } @@ struct drm_framebuffer *FB; expression E; @@ skylake_get_initial_plane_config(...) { ... - FB->pixel_format = E; ... } @@ struct drm_framebuffer *a; struct drm_framebuffer b; @@ ( - a->pixel_format + a->format->format | - b.pixel_format + b.format->format ) @@ struct drm_plane_state *a; struct drm_plane_state b; @@ ( - a->fb->pixel_format + a->fb->format->format | - b.fb->pixel_format + b.fb->format->format ) @@ struct drm_crtc *CRTC; @@ ( - CRTC->primary->fb->pixel_format + CRTC->primary->fb->format->format | - CRTC->primary->state->fb->pixel_format + CRTC->primary->state->fb->format->format ) @@ struct drm_mode_set *set; @@ ( - set->fb->pixel_format + set->fb->format->format | - set->crtc->primary->fb->pixel_format + set->crtc->primary->fb->format->format ) @@ @@ struct drm_framebuffer { ... - uint32_t pixel_format; ... }; v2: Fix commit message (Laurent) Rebase due to earlier removal of many fb->pixel_format uses, including the 'fb->format = drm_format_info(fb->format->format);' snafu v3: Adjusted the semantic patch a bit and regenerated due to code changes Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1) Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Link: http://patchwork.freedesktop.org/patch/msgid/1481751175-18463-1-git-send-email-ville.syrjala@linux.intel.com
* drm: Nuke fb->bits_per_pixelVille Syrjälä2016-12-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace uses of fb->bits_per_pixel with fb->format->cpp[0]*8. Less duplicated information is a good thing. Note that I didn't put parens around the cpp*8 in the below cocci script, on account of not wanting spurious parens all over the place. Instead I did the unsafe way, and tried to look over the entire diff to spot if any dangerous expressions were produced. I didn't see any. There are some cases where previously the code did X*bpp/8, so the division happened after the multiplication. Those are now just X*cpp so the division effectively happens before the multiplication, but that is perfectly fine since bpp is always a multiple of 8. @@ struct drm_framebuffer *FB; expression E; @@ drm_helper_mode_fill_fb_struct(...) { ... - FB->bits_per_pixel = E; ... } @@ struct drm_framebuffer *FB; expression E; @@ i9xx_get_initial_plane_config(...) { ... - FB->bits_per_pixel = E; ... } @@ struct drm_framebuffer *FB; expression E; @@ ironlake_get_initial_plane_config(...) { ... - FB->bits_per_pixel = E; ... } @@ struct drm_framebuffer *FB; expression E; @@ skylake_get_initial_plane_config(...) { ... - FB->bits_per_pixel = E; ... } @@ struct drm_framebuffer FB; expression E; @@ ( - E * FB.bits_per_pixel / 8 + E * FB.format->cpp[0] | - FB.bits_per_pixel / 8 + FB.format->cpp[0] | - E * FB.bits_per_pixel >> 3 + E * FB.format->cpp[0] | - FB.bits_per_pixel >> 3 + FB.format->cpp[0] | - (FB.bits_per_pixel + 7) / 8 + FB.format->cpp[0] | - FB.bits_per_pixel + FB.format->cpp[0] * 8 | - FB.format->cpp[0] * 8 != 8 + FB.format->cpp[0] != 1 ) @@ struct drm_framebuffer *FB; expression E; @@ ( - E * FB->bits_per_pixel / 8 + E * FB->format->cpp[0] | - FB->bits_per_pixel / 8 + FB->format->cpp[0] | - E * FB->bits_per_pixel >> 3 + E * FB->format->cpp[0] | - FB->bits_per_pixel >> 3 + FB->format->cpp[0] | - (FB->bits_per_pixel + 7) / 8 + FB->format->cpp[0] | - FB->bits_per_pixel + FB->format->cpp[0] * 8 | - FB->format->cpp[0] * 8 != 8 + FB->format->cpp[0] != 1 ) @@ struct drm_plane_state *state; expression E; @@ ( - E * state->fb->bits_per_pixel / 8 + E * state->fb->format->cpp[0] | - state->fb->bits_per_pixel / 8 + state->fb->format->cpp[0] | - E * state->fb->bits_per_pixel >> 3 + E * state->fb->format->cpp[0] | - state->fb->bits_per_pixel >> 3 + state->fb->format->cpp[0] | - (state->fb->bits_per_pixel + 7) / 8 + state->fb->format->cpp[0] | - state->fb->bits_per_pixel + state->fb->format->cpp[0] * 8 | - state->fb->format->cpp[0] * 8 != 8 + state->fb->format->cpp[0] != 1 ) @@ @@ - (8 * 8) + 8 * 8 @@ struct drm_framebuffer FB; @@ - (FB.format->cpp[0]) + FB.format->cpp[0] @@ struct drm_framebuffer *FB; @@ - (FB->format->cpp[0]) + FB->format->cpp[0] @@ @@ struct drm_framebuffer { ... - int bits_per_pixel; ... }; v2: Clean up the 'cpp*8 != 8' and '(8 * 8)' cases (Laurent) v3: Adjusted the semantic patch a bit and regenerated due to code changes Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1) Link: http://patchwork.freedesktop.org/patch/msgid/1481751140-18352-1-git-send-email-ville.syrjala@linux.intel.com
* drm/exynos: use drm core to handle page-flip eventAndrzej Hajda2016-09-301-9/+0Star
| | | | | | | | 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>
* drm/exynos: mixer: simplify loop in vp_win_reset()Tobias Jakobi2016-09-301-2/+2
| | | | | | | A simple while loop should do the same here. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* drm/exynos: mixer: convert booleans to flags in mixer contextTobias Jakobi2016-09-301-25/+30
| | | | | | | | | | | The mixer context struct already has a 'flags' field, so we can use it to store the 'interlace', 'vp_enabled' and 'has_sclk' booleans. We use the non-atomic helper functions to access these bits. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* drm/exynos: use generic code for managing zpos plane propertyMarek Szyprowski2016-07-291-2/+4
| | | | | | | | | | | | | | | | | | | | | | 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>
* drm/exynos: clean up wait_for_vblankInki Dae2016-04-301-39/+0Star
| | | | | | | | | | | This patch cleans up wait_for_vblank relevant codes. wait_for_vblank callback isn't used anymore in Exynos drm driver so it removes relevant codes. However, display controllers - FIMD and DECON - still use this function driver internally to ensure shadow registers to be updated, which resolves page fault issue so keep it. Signed-off-by: Inki Dae <inki.dae@samsung.com>
* drm/exynos: mixer: use generic of_device_get_match_data helperMarek Szyprowski2016-04-301-7/+3Star
| | | | | | | Simplify code by replacing custom code by generic helper. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* drm/exynos: mixer: remove support for non-dt platformsMarek Szyprowski2016-04-301-16/+0Star
| | | | | | | | There are no non-devicetree based Exynos platforms in mainline, so there no point keeping old platform driver data for them. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* drm/exynos/mixer: enable HDMI-PHY before configuring MIXERAndrzej Hajda2016-04-291-0/+4
| | | | | | | According to documentation HDMI-PHY must be on prior to MIXER configuration. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* drm/exynos: fix building without CONFIG_PM_SLEEPArnd Bergmann2016-02-011-4/+2Star
| | | | | | | | | | | | | | | | | The runtime PM operations use the suspend/resume functions even when CONFIG_PM_SLEEP is not set, but this now fails for the exynos DRM driver: exynos_mixer.c:1289:61: error: 'exynos_mixer_resume' undeclared here (not in a function) SET_RUNTIME_PM_OPS(exynos_mixer_suspend, exynos_mixer_resume, NULL) This removes the #ifdef and instead marks the functions as __maybe_unused, which does the right thing in all cases and also looks nicer. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* drm/exynos: mixer: properly update all planes on the same vblank eventMarek Szyprowski2016-01-121-9/+25
| | | | | | | | | This patch also moves mixer_vsync_set_update() to newly introduced mixer_atomic_begin/flush callbacks. This ensures that all mixer planes will be updated on the same vsync event. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* drm/exynos: mixer: unify a check for video-processor windowMarek Szyprowski2016-01-121-2/+2
| | | | | | | | | Always use macro instead of hard-coded '2' value in conditions related to video processor window. Additional checks are not needed, because video layer is registered only when video processor is available. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* drm/exynos: mixer: also allow ARGB1555 and ARGB4444Tobias Jakobi2016-01-121-0/+6
| | | | | | | | | Allow the remaining alpha formats now that blending is properly setup. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* drm/exynos: mixer: refactor layer setupMarek Szyprowski2016-01-121-0/+43
| | | | | | | | | | | | | Properly configure blending properties of given hardware layer based on the selected pixel format. Currently only per-pixel-based alpha is possible when respective pixel format has been selected. Configuration of global, per-plane alpha value, color key and background color will be added later. This patch is heavily inspired by earlier work done by Tobias Jakobi <tjakobi@math.uni-bielefeld.de>. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* drm/exynos: mixer: remove all static blending setupTobias Jakobi2016-01-121-23/+0Star
| | | | | | | | Previously blending setup was static and most of it was done in mixer_win_reset(). Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* drm/exynos: mixer: set window priority based on zposMarek Szyprowski2016-01-121-18/+21
| | | | | | | | | | | | | | | 'zpos' plane property is configurable, so adjust hardware layers priority based on the zpos value. 'zpos' value shifted by one can be used directly as hw priority value and stored to the registers, because mixer accepts priority values from 1 to 15 (0 means that layer is disabled). This patch also changes the default layer priority to match already exposed initial zpos values. The initial configuration is now: [top] video > gfx layer1 > gfx layer0 [bottom]. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* drm/exynos: rename zpos to indexMarek Szyprowski2016-01-121-7/+7
| | | | | | | | | | 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>
* drm/exynos: mixer: use ratio precalculated in exynos_stateMarek Szyprowski2015-12-131-30/+3Star
| | | | | | | | | Common plane code already calculates and checks for supported scalling modes, so additional code in mixer driver can be now removed. 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>
* drm/exynos: add generic check for plane stateMarek Szyprowski2015-12-131-0/+3
| | | | | | | | | 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>
* drm/exynos: introduce exynos_drm_plane_config structureMarek Szyprowski2015-12-131-20/+24
| | | | | | | | | | | | 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>
* drm/exynos: mixer: enable video overlay plane only when VP is availableMarek Szyprowski2015-12-131-0/+3
| | | | | | | | | Video overlay plane should be registered only when suitable hardware sub-block (Video Processor) is available. 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>
* drm/exynos: mixer: use crtc->state->adjusted_mode instead of crtc->modeMarek Szyprowski2015-12-131-2/+2
| | | | | | | | | This patch replaces usage of crtc->mode with crtc->state->adjusted_mode like it is already done in common plane code. 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>
* drm/exynos: introduce exynos_drm_plane_state structureMarek Szyprowski2015-12-131-28/+33
| | | | | | | | | | 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>
* drm/exynos: move dma_addr attribute from exynos plane to exynos fbMarek Szyprowski2015-12-131-3/+4
| | | | | | | | | | | | | 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>
* drm/exynos: add pm_runtime to MixerGustavo Padovan2015-12-131-42/+64
| | | | | | | | | | | Let pm_runtime handle the enabling/disabling of the device with proper refcnt instead of rely on specific flags to track the enabled state. Changelog v2: - revive MXR_BIT_POWERED flag to keep current dpms mode. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* drm/exynos/mixer: replace direct cross-driver call with drm mode validationAndrzej Hajda2015-11-031-2/+4
| | | | | | | | | HDMI driver called directly function from MIXER driver to invalidate modes not supported by MIXER. The patch replaces the hack with proper .atomic_check callback. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* drm/exynos: add cursor plane supportGustavo Padovan2015-10-261-2/+2
| | | | | | | | 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>
* drm/exynos: add global macro for the default primary planeGustavo Padovan2015-10-261-4/+3Star
| | | | | | | | | Define DEFAULT_WIN as zero to help set the primary plane on all CRTCs. Some CRTCs were defining a variable to store the default window, but that is not necessary as the default (primary) window is always the window zero. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* drm: exynos: mixer: fix using usleep() in atomic contextTomasz Stanislawski2015-10-261-1/+1
| | | | | | | | | | | This patch fixes calling usleep_range() after taking reg_slock using spin_lock_irqsave(). The mdelay() is used instead. Waiting in atomic context is not the best idea in general. Hopefully, waiting occurs only when Video Processor fails to reset correctly. Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* drm/exynos: Properly report supported formats for each deviceMarek Szyprowski2015-08-301-2/+28
| | | | | | | | | | 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>
* drm/exynos: check for pending fb before finish updateGustavo Padovan2015-08-301-1/+9
| | | | | | | | | | | | | | | | 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
* drm/exynos: unify exynos_drm_plane names with drm coreGustavo Padovan2015-08-161-11/+11
| | | | | | | | | 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>
* drm/exynos: use drm atomic state directlyGustavo Padovan2015-08-161-31/+34
| | | | | | | | | | | 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>
* drm/exynos: pass struct exynos_drm_plane in update/enableGustavo Padovan2015-08-161-9/+11
| | | | | | | | | | | | 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>
* drm/exynos: rename win_commit/disable to atomic-like namesGustavo Padovan2015-08-161-5/+5
| | | | | | | | | 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>
* drm/exynos: use KMS version of DRM vblanks functionsGustavo Padovan2015-08-161-2/+2
| | | | | | | | | | | | Get rid of legacy DRM vblank function that are less clear to use. The new ones basically requires only the crtc as parameters. It also clean ups exynos_drm_crtc_finish_pageflip() parameters as a consequence. 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>
* drm/exynos: remove drm_iommu_attach_device_if_possibleJoonyoung Shim2015-08-161-2/+1Star
| | | | | | | | | | | | Already drm_iommu_attach_device checks whether support iommu internally. It should clear channels always regardless iommu support. We didn't know because we can detect the problem when iommu is enabled, so we don't have to use drm_iommu_attach_device_if_possible and then we can remove drm_iommu_attach_device_if_possible and clear_channels function pointer. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* drm/exynos/mixer: replace MXR_INT_EN register cache with flagAndrzej Hajda2015-08-161-11/+9Star
| | | | | | | | Driver uses only VSYNC interrupts, so we need to cache VSYNC bit state only. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* drm/exynos/mixer: simplify poweron flagAndrzej Hajda2015-08-161-38/+14Star
| | | | | | | | | The driver uses bool protected by mutex to track power state. The patch replaces this combo with single bit and atomic bitops. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* drm/exynos: remove unnecessary checking to support iommuJoonyoung Shim2015-08-161-2/+1Star
| | | | | | | | | | Already drm_iommu_attach_device and drm_iommu_detach_device check whether support iommu internally, so we don't have to call is_drm_iommu_supported before call them. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* drm/exynos/mixer: always update INT_EN cacheAndrzej Hajda2015-08-161-0/+5
| | | | | | | | | INT_EN cache field was updated only by mixer_enable_vblank. The patch adds update also by mixer_disable_vblank function. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* drm/exynos/mixer: correct vsync configuration sequenceAndrzej Hajda2015-08-161-2/+5
| | | | | | | | Specification advises to clear vsync indicator before configuring vsync. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* drm/exynos/mixer: fix interrupt clearingAndrzej Hajda2015-08-161-5/+4Star
| | | | | | | | | The driver used incorrect flags to clear interrupt status. The patch fixes it. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* drm/exynos: add drm_iommu_attach_device_if_possible()Hyungwon Hwang2015-06-221-3/+5
| | | | | | | | | Every CRTC drivers in Exynos DRM implements the code which checks whether IOMMU is supported or not, and if supported enable it. Making new helper for it generalize each CRTC drivers. Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* drm/exynos: remove chained calls to enableJoonyoung Shim2015-06-191-34/+4Star
| | | | | | | | | | | | | | | | | | | | With atomic modesetting all the control for CRTC, Planes, Encoders and Connectors should come from DRM core, so the driver is not allowed to enable or disable planes from inside the crtc_enable()/disable() call. But it needs to disable planes with crtc_disable in exynos driver internally. Because crtc is disabled before plane is disabled, it means plane_disable just returns without any register changes, then we cannot be sure setting register to disable plane when crtc is disable. This patch removes this chainned calls to enable plane from exynos hw drivers code letting only DRM core touch planes except to disable plane. Also it leads eliminable enabled and resume of struct exynos_drm_plane. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* drm/exynos: remove to call mixer_wait_for_vblankJoonyoung Shim2015-06-191-1/+0Star
| | | | | | | | | | | The reason waiting vblank is to be power gated and disabled clocks after dma operation is completed. The dma operation is stopped already before be power gated and clocks are disabled when mixer is disabled by commit 381be025ac1a6("drm/exynos: stop mixer before gating clocks during poweroff"). Don't need to wait vblank anymore. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* drm/exynos: fix broken component binding in case of multiple pipelinesAndrzej Hajda2015-06-191-12/+2Star
| | | | | | | | | | | | | | | | In case there are multiple pipelines and deferred probe occurs, only components of the first pipeline were bound. As a result only one pipeline was available. The main cause of this issue was dynamic generation of component match table - every component driver during probe registered itself on helper list, if there was at least one pipeline present on this list component match table were created without deferred components. This patch removes this helper list, instead it creates match table from existing devices requiring exynos_drm KMS drivers. This way match table do not depend on probe/deferral order and contains all KMS components. As a side effect patch makes the code cleaner and significantly smaller. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* drm/exynos: add error messages if clks failed to get enabledGustavo Padovan2015-06-191-5/+26
| | | | | | | Check error and call DRM_ERROR if clk_prepare_enable() fails. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>