aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/rockchip/rockchip_drm_fb.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-07-26drm/atomic: implement drm_atomic_helper_commit_tail for runtime_pm usersMaxime Ripard1-20/+1
The current drm_atomic_helper_commit_tail helper works only if the CRTC is accessible, and documents an alternative implementation that is supposed to be used if that happens. That implementation is then duplicated by some drivers. Instead of documenting it, let's implement an helper that all the relevant users can use directly. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/a8f92dc70048bab746e94dadd1c23200626aff60.1500555652.git-series.maxime.ripard@free-electrons.com Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-06-21drm/rockchip: Remove unnecessary NULL checkThierry Reding1-3/+1
The expression &private->fbdev_helper can never be NULL, so the check is completely unnecessary. Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20170329144401.1804-12-thierry.reding@gmail.com
2017-02-26Merge airlied/drm-next into drm-misc-nextDaniel Vetter1-1/+1
Backmerge the main pull request to sync up with all the newly landed drivers. Otherwise we'll have chaos even before 4.12 started in earnest. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2017-02-12drm: Constify drm_mode_config atomic helper private pointerLaurent Pinchart1-1/+1
The drm_mode_config helper private field points to a structure of function pointers that don't need to be modified at runtime. Make it const. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk> Acked-by: Brian Starkey <brian.starkey@arm.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20170102091613.6310-1-laurent.pinchart@ideasonboard.com
2017-02-05drm/rockchip: return ERR_PTR instead of NULLJulia Lawall1-1/+1
rockchip_drm_framebuffer_init is only used in one case, in rockchip_drm_fbdev.c, where its return value is tested using IS_ERR. To enable propagating the reason for the error, change the definition so that it returns an ERR_PTR value. Problem found with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
2016-12-15drm: Pass 'dev' to drm_helper_mode_fill_fb_struct()Ville Syrjälä1-1/+1
Pass the drm_device to drm_helper_mode_fill_fb_struct() so that we can populate fb->dev early. Will make it easier to use the fb before we register it. @@ identifier fb, mode_cmd; @@ void drm_helper_mode_fill_fb_struct( + struct drm_device *dev, struct drm_framebuffer *fb, const struct drm_mode_fb_cmd2 *mode_cmd ); @@ identifier fb, mode_cmd; @@ void drm_helper_mode_fill_fb_struct( + struct drm_device *dev, struct drm_framebuffer *fb, const struct drm_mode_fb_cmd2 *mode_cmd ) { ... } @@ function func; identifier dev; expression E1, E2; @@ func(struct drm_device *dev, ...) { ... drm_helper_mode_fill_fb_struct( + dev, E1, E2); ... } @@ expression E1, E2; @@ drm_helper_mode_fill_fb_struct( + dev, E1, E2); v2: Rerun spatch 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> Link: http://patchwork.freedesktop.org/patch/msgid/1481748539-18283-1-git-send-email-ville.syrjala@linux.intel.com
2016-09-21drm/rockchip: Replace custom wait_for_vblanks with helperTomasz Figa1-63/+1
Currently the driver uses a custom function to wait for flip to complete after an atomic commit. It was needed before because of two problems: - there is no hardware vblank counter, so the original helper would have a race condition with the vblank interrupt, - the driver didn't support unreferencing cursor framebuffers asynchronously to the commit, which was what the helper expected. Since both problems have been solved by previous patches, we can now make the driver use the generic helper and remove custom waiting code. Signed-off-by: Tomasz Figa <tfiga@chromium.org>
2016-09-21drm/rockchip: Don't key off vblank for psrSean Paul1-1/+1
Instead of keying off vblank for psr, just flush every time we get an atomic update. This ensures that cursor updates will properly disable psr (without turning vblank on/off), and unifies the paths between fb_dirty and atomic psr enable/disable. Reviewed-by: Yakir Yang <ykk@rock-chips.com> Signed-off-by: Sean Paul <seanpaul@chromium.org>
2016-09-01Merge tag 'topic/drm-misc-2016-08-31' of git://anongit.freedesktop.org/drm-intel into drm-nextDave Airlie1-1/+2
More -misc stuff - moar drm_crtc.c split up&documentation - some fixes for the simple kms helpers (Andrea) - I included all the dri1 patches from David - we're not removing any code or drivers, and it seems to have worked as a wake-up call to motivate a few more people to upstream kms conversions for these. Feel free to revert if you disagree strongly. - a few other single patches * tag 'topic/drm-misc-2016-08-31' of git://anongit.freedesktop.org/drm-intel: (24 commits) drm: drm_probe_helper: Fix output_poll_work scheduling drm: bridge/dw-hdmi: Fix colorspace and scan information registers values drm/doc: Polish docs for drm_property&drm_property_blob drm: Unify handling of blob and object properties drm: Extract drm_property.[hc] drm: move drm_mode_legacy_fb_format to drm_fourcc.c drm/doc: Polish docs for drm_mode_object drm: Remove drm_mode_object->atomic_count drm: Extract drm_mode_object.[hc] drm/doc: Polish kerneldoc for encoders drm: Extract drm_encoder.[hc] drm/fb-helper: don't call remove_conflicting_framebuffers for FB=m && DRM=y drm/atomic-helper: Add NO_DISABLE_AFTER_MODESET flag support for plane commit drm/atomic-helper: Disable appropriate planes in disable_planes_on_crtc() drm/atomic-helper: Add atomic_disable CRTC helper callback drm: simple_kms_helper: add support for bridges drm: simple_kms_helper: make connector optional at init time drm/bridge: introduce bridge detaching mechanism drm/simple-helpers: Always add planes to the state update drm: reduce GETCLIENT to a minimum ...
2016-08-29drm/atomic-helper: Add NO_DISABLE_AFTER_MODESET flag support for plane commitLiu Ying1-1/+2
Drivers may set the NO_DISABLE_AFTER_MODESET flag in the 'flags' parameter of the helper drm_atomic_helper_commit_planes() if the relevant display controllers(e.g., IPUv3 for imx-drm) require to disable a CRTC's planes when the CRTC is disabled. The helper would skip the ->atomic_disable call for a plane if the CRTC of the old plane state needs a modesetting operation. Of course, the drivers need to disable the planes in their CRTC disable callbacks since no one else would do that. Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Philipp Zabel <p.zabel@pengutronix.de> Cc: David Airlie <airlied@linux.ie> Cc: Russell King <linux@armlinux.org.uk> Cc: Peter Senna Tschudin <peter.senna@gmail.com> Cc: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Liu Ying <gnuiyl@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1472461923-14364-1-git-send-email-gnuiyl@gmail.com
2016-08-23drm/rockchip: add an common abstracted PSR driverYakir Yang1-0/+12
The PSR driver have exported four symbols for specific device driver, and it's safe to call them in interrupt context: - rockchip_drm_psr_register() - rockchip_drm_psr_unregister() - rockchip_drm_psr_enable() - rockchip_drm_psr_disable() - rockchip_drm_psr_flush() Encoder driver should call the register/unregister interfaces to hook itself into common PSR driver, encoder have implement the 'psr_set' callback which use the set PSR state in hardware side. Crtc driver would call the enable/disable interfaces when vblank is enable/disable, after that the common PSR driver would call the encoder registered callback to set the PSR state. Fb driver would call the flush interface in 'fb->dirty' callback, this helper function would force all PSR enabled encoders to exit from PSR for 3 seconds. Signed-off-by: Yakir Yang <ykk@rock-chips.com> [seanpaul removed leftover psr_enabled/psr_work kruft from drm_vop.c] Signed-off-by: Sean Paul <seanpaul@chromium.org>
2016-07-19drm/rockchip: Delete an unnecessary check before drm_gem_object_unreference_unlocked()Markus Elfring1-6/+2
The drm_gem_object_unreference_unlocked() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
2016-07-19drm/rockchip: fix "should it be static?" warningsJohn Keeping1-1/+1
Combined with the previous commit, this fixes all of the sparse warnings in drm/rockchip. Signed-off-by: John Keeping <john@metanate.com>
2016-07-19drm/rockchip: fb: add missing headerJohn Keeping1-0/+1
This fixes the following sparse warnings: drivers/gpu/drm/rockchip/rockchip_drm_fb.c:32:23: warning: symbol 'rockchip_fb_get_gem_obj' was not declared. Should it be static? drivers/gpu/drm/rockchip/rockchip_drm_fb.c:315:24: warning: symbol 'rockchip_drm_framebuffer_init' was not declared. Should it be static? drivers/gpu/drm/rockchip/rockchip_drm_fb.c:329:6: warning: symbol 'rockchip_drm_mode_config_init' was not declared. Should it be static? Signed-off-by: John Keeping <john@metanate.com>
2016-06-10drm/rockchip: convert to helper nonblocking atomic commitDaniel Vetter1-63/+9
With the various bits fixed rockchip now has an atomic compliant handling/signalling of crtc_state->event, which means we can just switch over to the new nonblocking helpers and remove some code. v2: Fixes from Tomeu. v3: Send out vblank events correctly when shutting down a crtc for good. This is part of the atomic interface contract. v4: Properly protect vop->event. v5: Add more WARN_ON to check vop->event isn't clobbered. Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com> Cc: Mark yao <mark.yao@rock-chips.com> Tested-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2016-06-10drm/atomic-helper: Massage swap_state signature somewhatDaniel Vetter1-1/+1
- dev is redundant, we have state->atomic - add stall parameter, which must be set when swapping needs to stall for preceeding commits to stop looking at ->state pointers. Currently all drivers need this to be, just prep work for a glorious future. v2: Rebased on top of commit e7cf0963f816fa44190caaf51aeffaa614c340c6 Author: Gerd Hoffmann <kraxel@redhat.com> Date: Tue May 31 08:50:47 2016 +0200 virtio-gpu: add atomic_commit function Cc: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1465509992-19284-1-git-send-email-daniel.vetter@ffwll.ch Link: http://patchwork.freedesktop.org/patch/msgid/1465388359-8070-2-git-send-email-daniel.vetter@ffwll.ch
2016-05-17drm: Remove unused drm_device from drm_gem_object_lookup()Chris Wilson1-2/+1
drm_gem_object_lookup() has never required the drm_device for its file local translation of the user handle to the GEM object. Let's remove the unused parameter and save some space. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: dri-devel@lists.freedesktop.org Cc: Dave Airlie <airlied@redhat.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> [danvet: Fixup kerneldoc too.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-05-02drm/rockchip: Rename async to nonblock.Maarten Lankhorst1-3/+3
The async name is deprecated and should be changed to nonblocking. Cc: Mark Yao <mark.yao@rock-chips.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1461679905-30177-11-git-send-email-maarten.lankhorst@linux.intel.com
2016-01-20drm/rockchip: explain why we can't wait_for_vblanksJohn Keeping1-0/+15
Signed-off-by: John Keeping <john@metanate.com>
2016-01-20drm/rockchip: don't wait for vblank if fb hasn't changedJohn Keeping1-2/+6
As commented in drm_atomic_helper_wait_for_vblanks(), userspace relies on cursor ioctls being unsynced. Converting the rockchip driver to atomic has significantly impacted cursor performance by making every cursor update wait for vblank. By skipping the vblank sync when the framebuffer has not changed (as is done in drm_atomic_helper_wait_for_vblanks()) we can avoid this for the common case of moving the cursor and only need to delay the cursor ioctl when the cursor icon changes. We cannot add the check on legacy_cursor_update since that results in the cursor bo being unreferenced while the hardware may still be reading it. Fully supporting unsynced cursor updates is left for the future when the atomic helper framework supports async updates. Signed-off-by: John Keeping <john@metanate.com> Tested-by: Heiko Stuebner <heiko@sntech.de>
2016-01-18drm/rockchip: cleanup unnecessary export symbolMark Yao1-1/+0
Now rockchip_drm_vop.c is build into rockchipdrm.ko, so no need to export following symbol anymore: rockchip_drm_dma_attach_device rockchip_drm_dma_detach_device rockchip_drm_dma_attach_device rockchip_drm_dma_detach_device rockchip_register_crtc_funcs rockchip_unregister_crtc_funcs rockchip_fb_get_gem_obj Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2015-12-28drm/rockchip: support atomic asynchronous commitMark Yao1-13/+41
If drm core requests a async commit, rockchip_drm_atomic_commit will schedule a work task to update later. Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2015-12-28drm/rockchip: Convert to support atomic APIMark Yao1-0/+95
Rockchip vop not support hw vblank counter, needed check the committed register if it's really take effect. Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2015-12-15drm/rockchip: Constify function pointer structsVille Syrjälä1-1/+1
Moves a bunch of junk to .rodata from .data. drivers/gpu/drm/rockchip/dw_hdmi-rockchip.ko: -.rodata 772 +.rodata 828 -.data 148 +.data 92 drivers/gpu/drm/rockchip/rockchipdrm.ko: -.rodata 748 +.rodata 760 -.data 448 +.data 436 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-25-git-send-email-boris.brezillon@free-electrons.com Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-11-24drm: Pass the user drm_mode_fb_cmd2 as const to .fb_create()Ville Syrjälä1-3/+3
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-07-13drm/rockchip: only call drm_fb_helper_hotplug_event if fb_helper presentHeiko Stübner1-1/+2
Add a check for the presence of fb_helper to rockchip_drm_output_poll_changed() to only call drm_fb_helper_hotplug_event if there is actually a fb_helper available. Without this check I see NULL pointer dereferences when the hdmi hotplug irq fires before the fb_helper got initialized. Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2014-12-02drm: rockchip: Add basic drm driverMark Yao1-0/+201
This patch adds the basic structure of a DRM Driver for Rockchip Socs. Signed-off-by: Mark Yao <mark.yao@rock-chips.com> Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Acked-by: Daniel Vetter <daniel@ffwll.ch> Reviewed-by: Rob Clark <robdclark@gmail.com>