aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm
AgeCommit message (Collapse)AuthorFilesLines
2017-08-04drm: cirrus: remove dead code and pointless local lut storagePeter Rosin3-65/+16
The redundant fb helpers .load_lut, .gamma_set and .gamma_get are no longer used. Remove the dead code and hook up the crtc .gamma_set to use the crtc gamma_store directly instead of duplicating that info locally. Acked-by: Daniel Vetter <[email protected]> Signed-off-by: Peter Rosin <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-08-04drm: ast: remove dead code and pointless local lut storagePeter Rosin3-41/+6
The redundant fb helpers .load_lut, .gamma_set and .gamma_get are no longer used. Remove the dead code and hook up the crtc .gamma_set to use the crtc gamma_store directly instead of duplicating that info locally. Acked-by: Daniel Vetter <[email protected]> Signed-off-by: Peter Rosin <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-08-04drm: armada: remove dead empty functionsPeter Rosin3-14/+0
The redundant fb helpers .gamma_set and .gamma_get are no longer used. Remove the dead code. Acked-by: Daniel Vetter <[email protected]> Signed-off-by: Peter Rosin <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-08-04drm: amd: remove dead code and pointless local lut storagePeter Rosin7-128/+28
The redundant fb helpers .load_lut, .gamma_set and .gamma_get are no longer used. Remove the dead code and hook up the crtc .gamma_set to use the crtc gamma_store directly instead of duplicating that info locally. Acked-by: Daniel Vetter <[email protected]> Signed-off-by: Peter Rosin <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-08-04drm/rockchip: fix race with kms hotplug and fbdevMark yao1-7/+6
According to the kerneldoc[0], should do fbdev setup before calling drm_kms_helper_poll_init(), otherwise, Kms hotplug event may race into fbdev helper initial, and fb_helper->dev may be NULL pointer, that would cause the bug: [ 0.735411] [00000200] *pgd=00000000f6ffe003, *pud=00000000f6ffe003, *pmd=0000000000000000 [ 0.736156] Internal error: Oops: 96000005 [#1] PREEMPT SMP [ 0.736648] Modules linked in: [ 0.736930] CPU: 2 PID: 20 Comm: kworker/2:0 Not tainted 4.4.41 #20 [ 0.737480] Hardware name: Rockchip RK3399 Board rev2 (BOX) (DT) [ 0.738020] Workqueue: events cdn_dp_pd_event_work [ 0.738447] task: ffffffc0f21f3100 ti: ffffffc0f2218000 task.ti: ffffffc0f2218000 [ 0.739109] PC is at mutex_lock+0x14/0x44 [ 0.739469] LR is at drm_fb_helper_hotplug_event+0x30/0x114 [ 0.756253] [<ffffff8008a344f4>] mutex_lock+0x14/0x44 [ 0.756260] [<ffffff8008445708>] drm_fb_helper_hotplug_event+0x30/0x114 [ 0.756271] [<ffffff8008473c84>] rockchip_drm_output_poll_changed+0x18/0x20 [ 0.756280] [<ffffff8008439fcc>] drm_kms_helper_hotplug_event+0x28/0x34 [ 0.756286] [<ffffff800846c444>] cdn_dp_pd_event_work+0x394/0x3c4 [ 0.756295] [<ffffff80080b2b38>] process_one_work+0x218/0x3e0 [ 0.756302] [<ffffff80080b3538>] worker_thread+0x2e8/0x404 [ 0.756308] [<ffffff80080b7e70>] kthread+0xe8/0xf0 [ 0.756316] [<ffffff8008082690>] ret_from_fork+0x10/0x40 [0]: https://01.org/linuxgraphics/gfx-docs/drm/gpu/drm-kms-helpers.html Signed-off-by: Mark Yao <[email protected]> Reviewed-by: Sandy huang <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-08-04drm/rockchip: vop: report error when check resource errorMark yao1-1/+3
The user would be confused while facing a error commit without any error report. Signed-off-by: Mark Yao <[email protected]> Reviewed-by: Sandy huang <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-08-04drm/rockchip: vop: round_up pitches to word alignMark yao1-2/+2
VOP pitch register is word align, need align to word. VOP_WIN0_VIR: bit[31:16] win0_vir_stride_uv Number of words of Win0 uv Virtual width bit[15:0] win0_vir_width Number of words of Win0 yrgb Virtual width ARGB888 : win0_vir_width RGB888 : (win0_vir_width*3/4) + (win0_vir_width%3) RGB565 : ceil(win0_vir_width/2) YUV : ceil(win0_vir_width/4) Signed-off-by: Mark Yao <[email protected]> Reviewed-by: Sandy huang <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-08-04drm/rockchip: vop: fix NV12 video display errorMark yao1-0/+3
fixup the scale calculation formula on the case src_height == (dst_height/2). Signed-off-by: Mark Yao <[email protected]> Reviewed-by: Sandy huang <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-08-04drm/rockchip: vop: fix iommu page fault when resumeMark yao1-18/+15
Iommu would get page fault with following path: vop_disable: 1, disable all windows and set vop config done 2, vop enter to standy, all windows not works, but their registers are not clean, when you read window's enable bit, may found the window is enable. vop_enable: 1, memcpy(vop->regsbak, vop->regs, len) save current vop registers to vop->regsbak, then you can found window is enable on regsbak. 2, VOP_WIN_SET(vop, win, gate, 1); force enable window gate, but gate and enable are on same hardware register, then window enable bit rewrite to vop hardware. 3, vop power on, and vop might try to scan destroyed buffer, then iommu get page fault. Move windows disable after vop regsbak restore, then vop regsbak mechanism would keep tracing the modify, everything would be safe. Signed-off-by: Mark Yao <[email protected]> Reviewed-by: Sandy huang <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-08-04drm/rockchip: vop: no need wait vblank on crtc enableMark yao1-36/+0
Since atomic framework, crtc enable and disable are in pairs, no need to wait vblank. Signed-off-by: Mark Yao <[email protected]> Reviewed-by: Sandy huang <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-08-04drm/rockchip: vop: report error when check resource errorMark yao1-1/+3
The user would be confused while facing a error commit without any error report. Signed-off-by: Mark Yao <[email protected]> Reviewed-by: Sandy huang <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-08-04drm/rockchip: vop: round_up pitches to word alignMark yao1-2/+2
VOP pitch register is word align, need align to word. VOP_WIN0_VIR: bit[31:16] win0_vir_stride_uv Number of words of Win0 uv Virtual width bit[15:0] win0_vir_width Number of words of Win0 yrgb Virtual width ARGB888 : win0_vir_width RGB888 : (win0_vir_width*3/4) + (win0_vir_width%3) RGB565 : ceil(win0_vir_width/2) YUV : ceil(win0_vir_width/4) Signed-off-by: Mark Yao <[email protected]> Reviewed-by: Sandy huang <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-08-04drm/rockchip: vop: fix NV12 video display errorMark yao1-0/+3
fixup the scale calculation formula on the case src_height == (dst_height/2). Signed-off-by: Mark Yao <[email protected]> Reviewed-by: Sandy huang <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-08-04drm/rockchip: vop: fix iommu page fault when resumeMark yao1-18/+15
Iommu would get page fault with following path: vop_disable: 1, disable all windows and set vop config done 2, vop enter to standy, all windows not works, but their registers are not clean, when you read window's enable bit, may found the window is enable. vop_enable: 1, memcpy(vop->regsbak, vop->regs, len) save current vop registers to vop->regsbak, then you can found window is enable on regsbak. 2, VOP_WIN_SET(vop, win, gate, 1); force enable window gate, but gate and enable are on same hardware register, then window enable bit rewrite to vop hardware. 3, vop power on, and vop might try to scan destroyed buffer, then iommu get page fault. Move windows disable after vop regsbak restore, then vop regsbak mechanism would keep tracing the modify, everything would be safe. Signed-off-by: Mark Yao <[email protected]> Reviewed-by: Sandy huang <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-08-04Merge branch 'drm-fixes-4.13' of git://people.freedesktop.org/~agd5f/linux ↵Dave Airlie3-21/+24
into drm-fixes Just a few small fixes for 4.13. * 'drm-fixes-4.13' of git://people.freedesktop.org/~agd5f/linux: drm/amdgpu: Use list_del_init in amdgpu_mn_unregister drm/amdgpu: Fix undue fallthroughs in golden registers initialization drm/amdgpu: fix header on gfx9 clear state
2017-08-04Merge branch 'topic-arcpgu-updates' of ↵Dave Airlie2-28/+36
https://github.com/foss-for-synopsys-dwc-arc-processors/linux into drm-next arcgpu minor updates. * 'topic-arcpgu-updates' of https://github.com/foss-for-synopsys-dwc-arc-processors/linux: drm: arcpgu: Allow some clock deviation in crtc->mode_valid() callback drm: arcpgu: Fix module unload drm: arcpgu: Fix mmap() callback arcpgu: Simplify driver name drm/arcpgu: Opt in debugfs
2017-08-04Merge tag 'drm-next-du-20170803' of git://linuxtv.org/pinchartl/media into ↵Dave Airlie11-172/+405
drm-next rcar-du updates, contains vsp1 updates as well. * tag 'drm-next-du-20170803' of git://linuxtv.org/pinchartl/media: (24 commits) drm: rcar-du: Use new iterator macros drm: rcar-du: Repair vblank for DRM page flips using the VSP drm: rcar-du: Fix race condition when disabling planes at CRTC stop drm: rcar-du: Wait for flip completion instead of vblank in commit tail drm: rcar-du: Use the VBK interrupt for vblank events drm: rcar-du: Add HDMI outputs to R8A7796 device description drm: rcar-du: Remove an unneeded NULL check drm: rcar-du: Setup planes before enabling CRTC to avoid flicker drm: rcar-du: Configure DPAD0 routing through last group on Gen3 drm: rcar-du: Restrict DPLL duty cycle workaround to H3 ES1.x drm: rcar-du: Support multiple sources from the same VSP drm: rcar-du: Fix comments to comply with the kernel coding style drm: rcar-du: Use of_graph_get_remote_endpoint() v4l: vsp1: Add support for header display lists in continuous mode v4l: vsp1: Add support for multiple DRM pipelines v4l: vsp1: Add support for multiple LIF instances v4l: vsp1: Add support for new VSP2-BS, VSP2-DL and VSP2-D instances v4l: vsp1: Add support for the BRS entity v4l: vsp1: Add pipe index argument to the VSP-DU API v4l: vsp1: Don't create links for DRM pipeline ...
2017-08-03drm/i915: enable WaDisableDopClkGating for sklPraveen Paneri1-0/+6
This WA is required when decoupled frequencies for slice and unslice are enabled. This disables DOP clock gating for skl. v2: enable the WA for all gen9 platforms (not just for SKL GT4 where the hang issue is originally reported) to avoid rare hangs (David) v3: as per WaDatabase, enable it only for SKL (Rodrigo) Cc: David Weinehall <[email protected]> Reviewed-by: David Weinehall <[email protected]> Signed-off-by: Praveen Paneri <[email protected]> Signed-off-by: Rodrigo Vivi <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-08-03drm/i915: Fix PCH names for KBP and CNP.Rodrigo Vivi2-5/+5
No functional change. KBP was based on SPT and spec wasn't clear about the full name. There was the initial point of the "Point" confusion. Later the split with Coffee Lake and Cannon Lake both using CNP and also some uncertainty from the specs we had at that time made us to propagated the mistake along. So, let's fix this now and avoid propagating these wrong "points". Cc: Anusha Srivatsa <[email protected]> Cc: Paulo Zanoni <[email protected]> Signed-off-by: Rodrigo Vivi <[email protected]> Reviewed-by: Anusha Srivatsa <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-08-03drm/fb-helper: add new drm_setup_crtcs_fb() functionDavid Lechner1-12/+18
This adds a new drm_setup_crtcs_fb() function to handle the parts of drm_setup_crtcs() that touch fb_helper->fb and fb_helper->fbdev. When drm_setup_crtcs() is called during initialization, these fields are NULL because they have not been allocated yet. There is currently a hack at the end of drm_fb_helper_single_fb_probe() that sets fb_helper->fb, so it is moved to the new drm_setup_crtcs_fb() function. This is also done in preparation for addition setup that requires access to fb_helper->fbdev. Signed-off-by: David Lechner <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-08-03drm/i915/perf: Implement I915_PERF_ADD/REMOVE_CONFIG interfaceLionel Landwerlin4-17/+573
The motivation behind this new interface is expose at runtime the creation of new OA configs which can be used as part of the i915 perf open interface. This will enable the kernel to learn new configs which may be experimental, or otherwise not part of the core set currently available through the i915 perf interface. v2: Drop DRM_ERROR for userspace errors (Matthew) Add padding to userspace structure (Matthew) s/guid/uuid/ (Matthew) v3: Use u32 instead of int to iterate through registers (Matthew) v4: Lock access to dynamic config list (Lionel) v5: by Matthew: Fix uninitialized error values Fix incorrect unwiding when opening perf stream Use kmalloc_array() to store register Use uuid_is_valid() to valid config uuids Declare ioctls as write only Check padding members are set to 0 by Lionel: Return ENOENT rather than EINVAL when trying to remove non existing config v6: by Chris: Use ref counts for OA configs Store UUID in drm_i915_perf_oa_config rather then using pointer Shuffle fields of drm_i915_perf_oa_config to avoid padding v7: by Chris Rename uapi pointers fields to end with '_ptr' v8: by Andrzej, Marek, Sebastian Update register whitelisting by Lionel Add more register names for documentation Allow configuration programming in non-paranoid mode Add support for value filter for a couple of registers already programmed in other part of the kernel v9: Documentation fix (Lionel) Allow writing WAIT_FOR_RC6_EXIT only on Gen8+ (Andrzej) v10: Perform read access_ok() on register pointers (Lionel) Signed-off-by: Matthew Auld <[email protected]> Signed-off-by: Lionel Landwerlin <[email protected]> Signed-off-by: Andrzej Datczuk <[email protected]> Reviewed-by: Andrzej Datczuk <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-08-03drm/i915: reorder NOA register definition to follow addressesLionel Landwerlin1-106/+106
It makes things easier to read when implementing whitelisting in the following patches. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Matthew Auld <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-08-03drm/i915/perf: disable NOA logic when not usedLionel Landwerlin1-0/+4
We already do it on Haswell and the documentation says it saves power. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Matthew Auld <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-08-03drm/i915/perf: leave GDT_CHICKEN_BITS programming in configsLionel Landwerlin11-7/+12
There will be a need for userspaces configurations to set this register. We can apply the same model inside the kernel for test configs. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Matthew Auld <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-08-03drm/i915/perf: prune OA configsLionel Landwerlin22-29415/+364
In the following commit we'll introduce loadable userspace configs. This change reworks how configurations are handled in the perf driver and retains only the test configurations in kernel space. We now store the test config in dev_priv and resolve the id only once when opening the perf stream. The OA config is then handled through a pointer to the structure holding the configuration details. v2: Rework how test configs are handled (Lionel) v3: Use u32 to hold number of register (Matthew) v4: Removed unused dev_priv->perf.oa.current_config variable (Matthew) v5: Lock device when accessing exclusive_stream (Lionel) v6: Ensure OACTXCONTROL is always reprogrammed (Lionel) v7: Switch a couple of index variable from int to u32 (Matthew) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Matthew Auld <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-08-03drm/i915/perf: fix flex eu registers programmingLionel Landwerlin1-2/+2
We were reserving fewer dwords in the ring than necessary. Indeed we're always writing all registers once, so discard the actual number of registers given by the user and just program the whitelisted ones once. Fixes: 19f81df2859e ("drm/i915/perf: Add OA unit support for Gen 8+") Reported-by: Matthew Auld <[email protected]> Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Matthew Auld <[email protected]> Cc: <[email protected]> # v4.12+ Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-08-03drm/atmel-hlcdc: switch to drm_*{get,put} helpersCihangir Akturk1-4/+4
drm_*_reference() and drm_*_unreference() functions are just compatibility alias for drm_*_get() and drm_*_put() and should not be used by new code. So convert all users of compatibility functions to use the new APIs. Signed-off-by: Cihangir Akturk <[email protected]> Acked-by: Boris Brezillon <[email protected]> Signed-off-by: Boris Brezillon <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-08-03drm/atmel-hlcdc : constify drm_plane_helper_funcs and drm_plane_funcs.Arvind Yadav1-2/+2
drm_plane_helper_funcs and drm_plane_funcsare not supposed to change at runtime. All functions working with drm_plane_helper_funcs and drm_plane_funcs work with const. So mark the non-const structs as const. File size before: text data bss dec hex filename 6072 596 0 6668 1a0c atmel_hlcdc_plane.o File size After adding 'const': text data bss dec hex filename 6218 436 0 6654 19fe atmel_hlcdc_plane.o Signed-off-by: Arvind Yadav <[email protected]> Signed-off-by: Boris Brezillon <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/646415a3b2e62182f85254115e8491e5caf4b2c7.1499098826.git.arvind.yadav.cs@gmail.com
2017-08-03drm: rcar-du: Use new iterator macrosMaarten Lankhorst1-34/+38
for_each_obj_in_state is about to be removed, so use the correct new iterator macros. Also look at new_plane_state instead of plane->state when looking up the hw planes in use. They should be the same except when reallocating, (in which case this code is skipped) and we should really stop looking at obj->state whenever possible. Signed-off-by: Maarten Lankhorst <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]>
2017-08-03drm: rcar-du: Repair vblank for DRM page flips using the VSPKieran Bingham3-5/+13
The driver recently switched from handling page flip completion in the DU vertical blanking handler to the VSP frame end handler to fix a race condition. This unfortunately resulted in incorrect timestamps in the vertical blanking events sent to userspace as vertical blanking is now handled after sending the event. To fix this we must reverse the order of the two operations. The easiest way is to handle vertical blanking in the VSP frame end handler before sending the event. The VSP frame end interrupt occurs approximately 50µs earlier than the DU frame end interrupt, but this should not cause any undue harm. As we need to handle vertical blanking even when page flip completion is delayed, the VSP driver now needs to call the frame end completion callback unconditionally, with a new argument to report whether page flip has completed. With this new scheme the DU vertical blanking interrupt isn't needed anymore, so we can stop enabling it. Fixes: d503a43ac06a ("drm: rcar-du: Register a completion callback with VSP1") Signed-off-by: Kieran Bingham <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Acked-by: Mauro Carvalho Chehab <[email protected]>
2017-08-03drm: rcar-du: Fix race condition when disabling planes at CRTC stopLaurent Pinchart2-6/+60
When stopping the CRTC the driver must disable all planes and wait for the change to take effect at the next vblank. Merely calling drm_crtc_wait_one_vblank() is not enough, as the function doesn't include any mechanism to handle the race with vblank interrupts. Replace the drm_crtc_wait_one_vblank() call with a manual mechanism that handles the vblank interrupt race. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Kieran Bingham <[email protected]>
2017-08-03drm: rcar-du: Wait for flip completion instead of vblank in commit tailLaurent Pinchart1-1/+1
Page flips can take more than one vertical blanking to complete if arming the page flips races with the vertical blanking interrupt. Waiting for one vblank to complete the atomic commit in the commit tail handler is thus incorrect, and can lead to framebuffers being released while still being scanned out. Fix this by waiting for flip completion instead, using the drm_atomic_helper_wait_for_flip_done() helper. Fixes: 0d230422d256 ("drm: rcar-du: Register a completion callback with VSP1") Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Kieran Bingham <[email protected]>
2017-08-03drm: rcar-du: Use the VBK interrupt for vblank eventsLaurent Pinchart1-1/+1
When implementing support for interlaced modes, the driver switched from reporting vblank events on the vertical blanking (VBK) interrupt to the frame end interrupt (FRM). This incorrectly divided the reported refresh rate by two. Fix it by moving back to the VBK interrupt. Fixes: 906eff7fcada ("drm: rcar-du: Implement support for interlaced modes") Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Kieran Bingham <[email protected]>
2017-08-03drm: rcar-du: Add HDMI outputs to R8A7796 device descriptionLaurent Pinchart1-2/+7
Update the device description with the HDMI output. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Kieran Bingham <[email protected]>
2017-08-03drm: rcar-du: Remove an unneeded NULL checkDan Carpenter1-1/+1
"params" can't be NULL here. The next lines assume that we either hit the break statement of "params->mpixelclock == ~0UL". The inconsistent NULL checking makes static checkers complain. I've just removed the test. Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]>
2017-08-03drm: rcar-du: Setup planes before enabling CRTC to avoid flickerLaurent Pinchart3-29/+43
Commit 52055bafa1ff ("drm: rcar-du: Move plane commit code from CRTC start to CRTC resume") changed the order of the plane commit and CRTC enable operations to accommodate the runtime PM requirements. However, this introduced corruption in the first displayed frame, as the CRTC is now enabled without any plane configured. On Gen2 hardware the first frame will be black and likely unnoticed, but on Gen3 hardware we end up starting the display before the VSP compositor, which is more noticeable. To fix this, revert the order of the commit operations back, and handle runtime PM requirements in the CRTC .atomic_begin() and .atomic_enable() helper operation handlers. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Kieran Bingham <[email protected]>
2017-08-03drm: rcar-du: Configure DPAD0 routing through last group on Gen3Laurent Pinchart1-6/+14
On Gen3 SoCs DPAD0 routing is configured through the last CRTC group, unlike on Gen2 where it is configured through the first CRTC group. Fix the driver accordingly. Fixes: 2427b3037710 ("drm: rcar-du: Add R8A7795 device support") Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Kieran Bingham <[email protected]>
2017-08-03drm: rcar-du: Restrict DPLL duty cycle workaround to H3 ES1.xLaurent Pinchart1-10/+27
The H3 ES1.x exhibits dot clock duty cycle stability issues. We can work around them by configuring the DPLL to twice the desired frequency, coupled with a /2 post-divider. This isn't needed on other SoCs and breaks HDMI output on M3-W for a currently unknown reason, so restrict the workaround to H3 ES1.x. From an implementation point of view, move work around handling outside of the rcar_du_dpll_divider() function by requesting a x2 DPLL output frequency explicitly. The existing post-divider calculation mechanism will then take care of dividing the clock by two automatically. While at it, print a more useful debugging message to ease debugging clock rate issues. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Kieran Bingham <[email protected]>
2017-08-03drm: rcar-du: Support multiple sources from the same VSPLaurent Pinchart5-33/+108
On R-Car H3 ES2.0, DU channels 0 and 3 are served by two separate pipelines from the same VSP. Support this in the DU driver. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Kieran Bingham <[email protected]>
2017-08-03drm: rcar-du: Fix comments to comply with the kernel coding styleLaurent Pinchart8-48/+96
To avoid mixing comment styles when new comments complying with the kernel coding style are introduced, fix all multiline comments in one go. Signed-off-by: Laurent Pinchart <[email protected]> Acked-by: Kieran Bingham <[email protected]>
2017-08-03drm: rcar-du: Use of_graph_get_remote_endpoint()Kuninori Morimoto1-1/+1
Now, we can use of_graph_get_remote_endpoint(). Let's use it. Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]>
2017-08-03drm/i915: add const to bin_attributeBhumika Goyal1-3/+3
Add const to bin_attribute structures as they are only passed to the functions sysfs_{remove/create}_bin_file or device_{remove/create}_bin_file. The corresponding arguments are of type const, so declare the structures to be const. Signed-off-by: Bhumika Goyal <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-08-03drm/fb: Fix pointer dereference before null check.David Lechner1-1/+1
fb_crtc is used before a null check, so move the use after the null check. This was just identified by inspection. I haven't actually observed a crash here, so it is possible that the null check could be unnecessary. Signed-off-by: David Lechner <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-08-03drm: arcpgu: Allow some clock deviation in crtc->mode_valid() callbackJose Abreu1-3/+4
Currently we expect that clock driver produces the exact same value as we are requiring. There can, and will, be some deviation however so we need to take that into account instead of just rejecting the mode. According to the HDMI spec we have a max of +-0.5% for the pixel clock frequency deviation. Lets take that into an advantage and use it to calculate how much deviation we can support. Signed-off-by: Jose Abreu <[email protected]> Acked-by: Alexey Brodkin <[email protected]> Cc: Carlos Palminha <[email protected]> Cc: Alexey Brodkin <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Dave Airlie <[email protected]> Signed-off-by: Alexey Brodkin <[email protected]>
2017-08-03drm: arcpgu: Fix module unloadJose Abreu1-1/+1
At module unload we are expecting a struct drm_device but at probing we are not setting it right. Fix this and correct the arcpgu module unload. Signed-off-by: Jose Abreu <[email protected]> Fixes: 0c4250e7b15e ("drm: Add support of ARC PGU display controller") Cc: Carlos Palminha <[email protected]> Cc: Alexey Brodkin <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Dave Airlie <[email protected]> Signed-off-by: Alexey Brodkin <[email protected]>
2017-08-03drm: arcpgu: Fix mmap() callbackJose Abreu1-23/+1
Now that ARC properly supports DMA mmap() we can use the standard CMA helper to map dumb buffers. This makes ARC PGU works with standard DRM consumer applications like, for example, mpv/mplayer via DRM. While at it, use the DEFINE_DRM_GEM_CMA_FOPS() helper. This fixes the use of dumb buffers. Signed-off-by: Jose Abreu <[email protected]> Fixes: 0c4250e7b15e ("drm: Add support of ARC PGU display controller") Cc: Carlos Palminha <[email protected]> Cc: Alexey Brodkin <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Dave Airlie <[email protected]> Signed-off-by: Alexey Brodkin <[email protected]>
2017-08-03arcpgu: Simplify driver nameAlexey Brodkin1-1/+1
This very minor change is still useful because it aligns ARC PGU driver name with other DRM drivers and makes usage of that driver name a bit easier. For example in libdrm's test app we'll use "arcpgu" instead of a bit more ugly "drm-arcpgu". Signed-off-by: Alexey Brodkin <[email protected]> Cc: Daniel Vetter <[email protected]>
2017-08-03drm/arcpgu: Opt in debugfsAlexey Brodkin1-0/+29
This change adopts debugfs usage for outputting useful data. As of today we print: * Mode and real HW clock values * Standard FB info Code is heavily borrowed from ARM's HDLCD thus adding Liviu in Cc. Signed-off-by: Alexey Brodkin <[email protected]> Reviewed-by: Liviu Dudau <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: David Airlie <[email protected]> Cc: Jose Abreu <[email protected]>
2017-08-02drm/amdgpu: Use list_del_init in amdgpu_mn_unregisterFelix Kuehling1-1/+1
Otherwise bo->shadow_list (which is aliased by bo->mn_list) will not appear empty in amdgpu_ttm_bo_destroy and cause an oops when freeing former userptr BOs. Signed-off-by: Felix Kuehling <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2017-08-02drm/amdgpu: Fix undue fallthroughs in golden registers initializationJean Delvare1-0/+2
As I was staring at the si_init_golden_registers code, I noticed that the Pitcairn initialization silently falls through the Cape Verde initialization, and the Oland initialization falls through the Hainan initialization. However there is no comment stating that this is intentional, and the radeon driver doesn't have any such fallthrough, so I suspect this is not supposed to happen. Signed-off-by: Jean Delvare <[email protected]> Fixes: 62a37553414a ("drm/amdgpu: add si implementation v10") Cc: Ken Wang <[email protected]> Cc: Alex Deucher <[email protected]> Cc: "Marek Olšák" <[email protected]> Cc: "Christian König" <[email protected]> Cc: Flora Cui <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]