aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu
AgeCommit message (Collapse)AuthorFilesLines
2017-08-04drm/i915/shrinker: Wrap need_resched() inside preempt-disableChris Wilson1-3/+8
In order for us to successfully detect the end of a timeslice, preemption must be disabled. Otherwise, inside the loop we may be preempted many times without our noticing, and each time our timeslice will be reset, invalidating need_resched() Reported-by: Joonas Lahtinen <[email protected]> Reported-by: Tomi Sarvela <[email protected]> Fixes: 290271de34f6 ("drm/i915: Spin for struct_mutex inside shrinker") Signed-off-by: Chris Wilson <[email protected]> Cc: Mika Kuoppala <[email protected]> Cc: Joonas Lahtinen <[email protected]> Cc: <[email protected]> # v4.13-rc1+ Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Tested-by: Joonas Lahtinen <[email protected]> Reviewed-by: Joonas Lahtinen <[email protected]>
2017-08-04drm/i915/perf: Initialise the dynamic sysfs attrChris Wilson1-0/+1
Use sysfs_attr_init() to dynamically initialise the oa_config->sysfs_metric_id.attr as it has the important side-effect of setting the lockdep key. [ 4.971513] [drm] Initialized i915 1.6.0 20170731 for 0000:00:02.0 on minor 0 [ 4.973489] BUG: key ffff88026f6e7bb0 not in .data! [ 4.973506] DEBUG_LOCKS_WARN_ON(1) [ 4.973518] ------------[ cut here ]------------ [ 4.973547] WARNING: CPU: 1 PID: 258 at kernel/locking/lockdep.c:3156 lockdep_init_map+0x1b2/0x1c0 [ 4.973567] Modules linked in: i915(+) x86_pkg_temp_thermal intel_powerclamp coretemp crct10dif_pclmul crc32_pclmul ghash_clmulni_intel snd_hda_intel snd_hda_codec snd_hwdep snd_hda_core snd_pcm r8169 mei_me mii mei lpc_ich prime_numbers i2c_hid pinctrl_broxton pinctrl_intel [ 4.973645] CPU: 1 PID: 258 Comm: systemd-udevd Not tainted 4.13.0-rc3-CI-CI_DRM_2915+ #1 [ 4.973664] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./J4205-ITX, BIOS P1.10 09/29/2016 [ 4.973686] task: ffff8802704c2740 task.stack: ffffc90000224000 [ 4.973700] RIP: 0010:lockdep_init_map+0x1b2/0x1c0 [ 4.973712] RSP: 0018:ffffc90000227a10 EFLAGS: 00010282 [ 4.973726] RAX: 0000000000000016 RBX: ffff880262aac010 RCX: 0000000000000000 [ 4.973741] RDX: 0000000080000001 RSI: 0000000000000001 RDI: ffffffff810ed1ab [ 4.973757] RBP: ffffc90000227a30 R08: 0000000000000001 R09: 0000000000000000 [ 4.973774] R10: 0000000000000000 R11: 0000000000000000 R12: ffff88026f6e7bb0 [ 4.973789] R13: 0000000000000000 R14: ffff88026f6e7b98 R15: ffffffff81a24da0 [ 4.973805] FS: 00007f588d7f58c0(0000) GS:ffff88027fc80000(0000) knlGS:0000000000000000 [ 4.973823] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 4.973837] CR2: 00000082482e32a0 CR3: 0000000270531000 CR4: 00000000003406e0 [ 4.973852] Call Trace: [ 4.973864] __kernfs_create_file+0x71/0xe0 [ 4.973876] sysfs_add_file_mode_ns+0x85/0x1a0 [ 4.973890] internal_create_group+0xe5/0x2b0 [ 4.973903] sysfs_create_group+0xe/0x10 [ 4.973985] i915_perf_register+0xd9/0x220 [i915] [ 4.974044] i915_driver_load+0xa72/0x16b0 [i915] [ 4.974124] i915_pci_probe+0x32/0x90 [i915] Annoyingly detected by CI, but not reported due to it occurring during boot and disabling lockdep for later runs. Fixes: f89823c21224 ("drm/i915/perf: Implement I915_PERF_ADD/REMOVE_CONFIG interface") Signed-off-by: Chris Wilson <[email protected]> Cc: Matthew Auld <[email protected]> Cc: Lionel Landwerlin <[email protected]> Cc: Andrzej Datczuk <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Matthew Auld <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
2017-08-04drm/i915/gvt: Initialize MMIO Block with HW stateTina Zhang3-20/+39
MMIO block with tracked mmio, is introduced for the sake of performance of searching tracked mmio. All the tracked mmio needs to get the initial value from the HW state during vGPU being created. This patch is to initialize the tracked registers in MMIO block with the HW state. v2: Add "Fixes:" line for this patch (Zhenyu) Fixes: 65f9f6febf12 ("drm/i915/gvt: Optimize MMIO register handling for some large MMIO blocks") Signed-off-by: Tina Zhang <[email protected]> Signed-off-by: Zhenyu Wang <[email protected]>
2017-08-04drm: stm: remove dead code and pointless local lut storagePeter Rosin2-13/+0
The redundant fb helper .load_lut is no longer used, and can not work right without also providing the fb helpers .gamma_set and .gamma_get thus rendering the code in this driver suspect. Just 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: radeon: remove dead code and pointless local lut storagePeter Rosin6-53/+33
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: nouveau: remove dead code and pointless local lut storagePeter Rosin4-69/+22
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: mgag200: remove dead code and pointless local lut storagePeter Rosin3-54/+15
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: i915: remove dead code and pointless local lut storagePeter Rosin2-32/+0
The driver stores lut values from the fbdev interface, and is able to give them back, but does not appear to do anything with these lut values. The generic fb helpers have replaced this function, and may even have made the driver work for the C8 mode from the fbdev interface. But that is untested. Since the fb helpers .gamma_set and .gamma_get are obsolete, 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: gma500: remove dead code and pointless local lut storagePeter Rosin4-50/+12
The redundant fb helpers .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: 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]>