baozhu.liu
2810a9c40b
drm/komeda: drop all currently held locks if deadlock happens
...
[ Upstream commit 19ecbe8325a2a7ffda5ff4790955b84eaccba49f ]
If komeda_pipeline_unbound_components() returns -EDEADLK,
it means that a deadlock happened in the locking context.
Currently, komeda is not dealing with the deadlock properly,producing the
following output when CONFIG_DEBUG_WW_MUTEX_SLOWPATH is enabled:
------------[ cut here ]------------
[ 26.103984] WARNING: CPU: 2 PID: 345 at drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c:1248
komeda_release_unclaimed_resources+0x13c/0x170
[ 26.117453] Modules linked in:
[ 26.120511] CPU: 2 PID: 345 Comm: composer@2.1-se Kdump: loaded Tainted: G W 5.10.110-SE-SDK1.8-dirty #16
[ 26.131374] Hardware name: Siengine Se1000 Evaluation board (DT)
[ 26.137379] pstate: 20400009 (nzCv daif +PAN -UAO -TCO BTYPE=--)
[ 26.143385] pc : komeda_release_unclaimed_resources+0x13c/0x170
[ 26.149301] lr : komeda_release_unclaimed_resources+0xbc/0x170
[ 26.155130] sp : ffff800017b8b8d0
[ 26.158442] pmr_save: 000000e0
[ 26.161493] x29: ffff800017b8b8d0 x28: ffff000cf2f96200
[ 26.166805] x27: ffff000c8f5a8800 x26: 0000000000000000
[ 26.172116] x25: 0000000000000038 x24: ffff8000116a0140
[ 26.177428] x23: 0000000000000038 x22: ffff000cf2f96200
[ 26.182739] x21: ffff000cfc300300 x20: ffff000c8ab77080
[ 26.188051] x19: 0000000000000003 x18: 0000000000000000
[ 26.193362] x17: 0000000000000000 x16: 0000000000000000
[ 26.198672] x15: b400e638f738ba38 x14: 0000000000000000
[ 26.203983] x13: 0000000106400a00 x12: 0000000000000000
[ 26.209294] x11: 0000000000000000 x10: 0000000000000000
[ 26.214604] x9 : ffff800012f80000 x8 : ffff000ca3308000
[ 26.219915] x7 : 0000000ff3000000 x6 : ffff80001084034c
[ 26.225226] x5 : ffff800017b8bc40 x4 : 000000000000000f
[ 26.230536] x3 : ffff000ca3308000 x2 : 0000000000000000
[ 26.235847] x1 : 0000000000000000 x0 : ffffffffffffffdd
[ 26.241158] Call trace:
[ 26.243604] komeda_release_unclaimed_resources+0x13c/0x170
[ 26.249175] komeda_crtc_atomic_check+0x68/0xf0
[ 26.253706] drm_atomic_helper_check_planes+0x138/0x1f4
[ 26.258929] komeda_kms_check+0x284/0x36c
[ 26.262939] drm_atomic_check_only+0x40c/0x714
[ 26.267381] drm_atomic_nonblocking_commit+0x1c/0x60
[ 26.272344] drm_mode_atomic_ioctl+0xa3c/0xb8c
[ 26.276787] drm_ioctl_kernel+0xc4/0x120
[ 26.280708] drm_ioctl+0x268/0x534
[ 26.284109] __arm64_sys_ioctl+0xa8/0xf0
[ 26.288030] el0_svc_common.constprop.0+0x80/0x240
[ 26.292817] do_el0_svc+0x24/0x90
[ 26.296132] el0_svc+0x20/0x30
[ 26.299185] el0_sync_handler+0xe8/0xf0
[ 26.303018] el0_sync+0x1a4/0x1c0
[ 26.306330] irq event stamp: 0
[ 26.309384] hardirqs last enabled at (0): [<0000000000000000>] 0x0
[ 26.315650] hardirqs last disabled at (0): [<ffff800010056d34>] copy_process+0x5d0/0x183c
[ 26.323825] softirqs last enabled at (0): [<ffff800010056d34>] copy_process+0x5d0/0x183c
[ 26.331997] softirqs last disabled at (0): [<0000000000000000>] 0x0
[ 26.338261] ---[ end trace 20ae984fa860184a ]---
[ 26.343021] ------------[ cut here ]------------
[ 26.347646] WARNING: CPU: 3 PID: 345 at drivers/gpu/drm/drm_modeset_lock.c:228 drm_modeset_drop_locks+0x84/0x90
[ 26.357727] Modules linked in:
[ 26.360783] CPU: 3 PID: 345 Comm: composer@2.1-se Kdump: loaded Tainted: G W 5.10.110-SE-SDK1.8-dirty #16
[ 26.371645] Hardware name: Siengine Se1000 Evaluation board (DT)
[ 26.377647] pstate: 20400009 (nzCv daif +PAN -UAO -TCO BTYPE=--)
[ 26.383649] pc : drm_modeset_drop_locks+0x84/0x90
[ 26.388351] lr : drm_mode_atomic_ioctl+0x860/0xb8c
[ 26.393137] sp : ffff800017b8bb10
[ 26.396447] pmr_save: 000000e0
[ 26.399497] x29: ffff800017b8bb10 x28: 0000000000000001
[ 26.404807] x27: 0000000000000038 x26: 0000000000000002
[ 26.410115] x25: ffff000cecbefa00 x24: ffff000cf2f96200
[ 26.415423] x23: 0000000000000001 x22: 0000000000000018
[ 26.420731] x21: 0000000000000001 x20: ffff800017b8bc10
[ 26.426039] x19: 0000000000000000 x18: 0000000000000000
[ 26.431347] x17: 0000000002e8bf2c x16: 0000000002e94c6b
[ 26.436655] x15: 0000000002ea48b9 x14: ffff8000121f0300
[ 26.441963] x13: 0000000002ee2ca8 x12: ffff80001129cae0
[ 26.447272] x11: ffff800012435000 x10: ffff000ed46b5e88
[ 26.452580] x9 : ffff000c9935e600 x8 : 0000000000000000
[ 26.457888] x7 : 000000008020001e x6 : 000000008020001f
[ 26.463196] x5 : ffff80001085fbe0 x4 : fffffe0033a59f20
[ 26.468504] x3 : 000000008020001e x2 : 0000000000000000
[ 26.473813] x1 : 0000000000000000 x0 : ffff000c8f596090
[ 26.479122] Call trace:
[ 26.481566] drm_modeset_drop_locks+0x84/0x90
[ 26.485918] drm_mode_atomic_ioctl+0x860/0xb8c
[ 26.490359] drm_ioctl_kernel+0xc4/0x120
[ 26.494278] drm_ioctl+0x268/0x534
[ 26.497677] __arm64_sys_ioctl+0xa8/0xf0
[ 26.501598] el0_svc_common.constprop.0+0x80/0x240
[ 26.506384] do_el0_svc+0x24/0x90
[ 26.509697] el0_svc+0x20/0x30
[ 26.512748] el0_sync_handler+0xe8/0xf0
[ 26.516580] el0_sync+0x1a4/0x1c0
[ 26.519891] irq event stamp: 0
[ 26.522943] hardirqs last enabled at (0): [<0000000000000000>] 0x0
[ 26.529207] hardirqs last disabled at (0): [<ffff800010056d34>] copy_process+0x5d0/0x183c
[ 26.537379] softirqs last enabled at (0): [<ffff800010056d34>] copy_process+0x5d0/0x183c
[ 26.545550] softirqs last disabled at (0): [<0000000000000000>] 0x0
[ 26.551812] ---[ end trace 20ae984fa860184b ]---
According to the call trace information,it can be located to be
WARN_ON(IS_ERR(c_st)) in the komeda_pipeline_unbound_components function;
Then follow the function.
komeda_pipeline_unbound_components
-> komeda_component_get_state_and_set_user
-> komeda_pipeline_get_state_and_set_crtc
-> komeda_pipeline_get_state
->drm_atomic_get_private_obj_state
-> drm_atomic_get_private_obj_state
-> drm_modeset_lock
komeda_pipeline_unbound_components
-> komeda_component_get_state_and_set_user
-> komeda_component_get_state
-> drm_atomic_get_private_obj_state
-> drm_modeset_lock
ret = drm_modeset_lock(&obj->lock, state->acquire_ctx); if (ret)
return ERR_PTR(ret);
Here it return -EDEADLK.
deal with the deadlock as suggested by [1], using the
function drm_modeset_backoff().
[1] https://docs.kernel.org/gpu/drm-kms.html?highlight=kms#kms-locking
Therefore, handling this problem can be solved
by adding return -EDEADLK back to the drm_modeset_backoff processing flow
in the drm_mode_atomic_ioctl function.
Signed-off-by: baozhu.liu <lucas.liu@siengine.com >
Signed-off-by: menghui.huang <menghui.huang@siengine.com >
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com >
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230804013117.6870-1-menghui.huang@siengine.com
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-11-28 16:54:50 +00:00
Miaoqian Lin
a5bbea50d6
malidp: Fix NULL vs IS_ERR() checking
...
commit 15342f930ebebcfe36f2415049736a77d7d2e045 upstream.
The get_sg_table() function does not return NULL.
It returns error pointers.
Signed-off-by: Miaoqian Lin <linmq006@gmail.com >
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com >
Link: https://lore.kernel.org/dri-devel/20211213072115.18098-1-linmq006@gmail.com/
Signed-off-by: Stefan Ghinea <stefan.ghinea@windriver.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-03-11 16:40:21 +01:00
Jiasheng Jiang
b4c7dd0037
drm: mali-dp: potential dereference of null pointer
...
[ Upstream commit 73c3ed7495c67b8fbdc31cf58e6ca8757df31a33 ]
The return value of kzalloc() needs to be checked.
To avoid use of null pointer '&state->base' in case of the
failure of alloc.
Fixes: 99665d0721
("drm: mali-dp: add malidp_crtc_state struct")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn >
Reviewed-by: Brian Starkey <brian.starkey@arm.com >
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20211214100837.46912-1-jiasheng@iscas.ac.cn
Signed-off-by: Sasha Levin <sashal@kernel.org >
2022-06-09 10:21:01 +02:00
Zhou Qingyang
78a3e9fcdb
drm/komeda: Fix an undefined behavior bug in komeda_plane_add()
...
[ Upstream commit f5e284bb74ab296f98122673c7ecd22028b2c200 ]
In komeda_plane_add(), komeda_get_layer_fourcc_list() is assigned to
formats and used in drm_universal_plane_init().
drm_universal_plane_init() passes formats to
__drm_universal_plane_init(). __drm_universal_plane_init() further
passes formats to memcpy() as src parameter, which could lead to an
undefined behavior bug on failure of komeda_get_layer_fourcc_list().
Fix this bug by adding a check of formats.
This bug was found by a static analyzer. The analysis employs
differential checking to identify inconsistent security operations
(e.g., checks or kfrees) between two code paths and confirms that the
inconsistent operations are not recovered in the current function or
the callers, so they constitute bugs.
Note that, as a bug found by static analysis, it can be a false
positive or hard to trigger. Multiple researchers have cross-reviewed
the bug.
Builds with CONFIG_DRM_KOMEDA=m show no new warnings,
and our static analyzer no longer warns about this code.
Fixes: 61f1c4a8ab
("drm/komeda: Attach komeda_dev to DRM-KMS")
Signed-off-by: Zhou Qingyang <zhou1615@umn.edu >
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com >
Link: https://lore.kernel.org/dri-devel/20211201033704.32054-1-zhou1615@umn.edu
Signed-off-by: Sasha Levin <sashal@kernel.org >
2022-06-09 10:21:01 +02:00
Liviu Dudau
c977d63b8c
drm/komeda: return early if drm_universal_plane_init() fails.
...
[ Upstream commit c8f76c37cc3668ee45e081e76a15f24a352ebbdd ]
If drm_universal_plane_init() fails early we jump to the common cleanup code
that calls komeda_plane_destroy() which in turn could access the uninitalised
drm_plane and crash. Return early if an error is detected without going through
the common code.
Reported-by: Steven Price <steven.price@arm.com >
Reviewed-by: Steven Price <steven.price@arm.com >
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com >
Link: https://lore.kernel.org/dri-devel/20211203100946.2706922-1-liviu.dudau@arm.com
Signed-off-by: Sasha Levin <sashal@kernel.org >
2022-06-09 10:20:50 +02:00
Daniel Vetter
42a333ea4b
drm/arm/malidp: Always list modifiers
...
commit 26c3e7fd5a3499e408915dadae5d5360790aae9a upstream.
Even when all we support is linear, make that explicit. Otherwise the
uapi is rather confusing.
Acked-by: Liviu Dudau <liviu.dudau@arm.com >
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Cc: stable@vger.kernel.org
Cc: Pekka Paalanen <pekka.paalanen@collabora.com >
Cc: Liviu Dudau <liviu.dudau@arm.com >
Cc: Brian Starkey <brian.starkey@arm.com >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20210427092018.832258-2-daniel.vetter@ffwll.ch
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-07-19 09:44:58 +02:00
Carsten Haitzler
7f9757005c
drm/komeda: Fix bit check to import to value of proper type
...
[ Upstream commit be3e477effba636ad25dcd244db264c6cd5c1f36 ]
KASAN found this problem. find_first_bit() expects to look at a
pointer pointing to a long, but we look at a u32 - this is going to be
an issue with endianness but, KSAN already flags this as out-of-bounds
stack reads. This fixes it by just importing inot a local long.
Signed-off-by: Carsten Haitzler <carsten.haitzler@arm.com >
Acked-by: Liviu Dudau <liviu.dudau@arm.com >
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20201218150812.68195-1-carsten.haitzler@foss.arm.com
Signed-off-by: Sasha Levin <sashal@kernel.org >
2021-05-11 14:47:26 +02:00
Dave Airlie
ce5c207c6b
Merge tag 'v5.9-rc4' into drm-next
...
Backmerge 5.9-rc4 as there is a nasty qxl conflict
that needs to be resolved.
Signed-off-by: Dave Airlie <airlied@redhat.com >
2020-09-08 14:41:40 +10:00
Gustavo A. R. Silva
df561f6688
treewide: Use fallthrough pseudo-keyword
...
Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
fall-through markings when it is the case.
[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org >
2020-08-23 17:36:59 -05:00
Thomas Zimmermann
d3d1bbe794
drm/malidp: Use struct drm_gem_object_funcs.get_sg_table internally
...
The malidp driver uses GEM object functions for callbacks. Fix it to
use them internally as well.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Daniel Vetter <daniel@ffwll.ch >
Fixes: ecdd647464
("drm/malidp: Use GEM CMA object functions")
Cc: Thomas Zimmermann <tzimmermann@suse.de >
Cc: Emil Velikov <emil.velikov@collabora.com >
Cc: Liviu Dudau <liviu.dudau@arm.com >
Cc: Brian Starkey <brian.starkey@arm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200807111022.12117-1-tzimmermann@suse.de
2020-08-18 15:26:32 +02:00
Daniel Vetter
51f644b40b
drm/atomic-helper: reset vblank on crtc reset
...
Only when vblanks are supported ofc.
Some drivers do this already, but most unfortunately missed it. This
opens up bugs after driver load, before the crtc is enabled for the
first time. syzbot spotted this when loading vkms as a secondary
output. Given how many drivers are buggy it's best to solve this once
and for all in shared helper code.
Aside from moving the few existing calls to drm_crtc_vblank_reset into
helpers (i915 doesn't use helpers, so keeps its own) I think the
regression risk is minimal: atomic helpers already rely on drivers
calling drm_crtc_vblank_on/off correctly in their hooks when they
support vblanks. And driver that's failing to handle vblanks after
this is missing those calls already, and vblanks could only work by
accident when enabling a CRTC for the first time right after boot.
Big thanks to Tetsuo for helping track down what's going wrong here.
There's only a few drivers which already had the necessary call and
needed some updating:
- komeda, atmel and tidss also needed to be changed to call
__drm_atomic_helper_crtc_reset() intead of open coding it
- tegra and msm even had it in the same place already, just code
motion, and malidp already uses __drm_atomic_helper_crtc_reset().
- Laurent noticed that rcar-du and omap open-code their crtc reset and
hence would actually be broken by this patch now. So fix them up by
reusing the helpers, which brings the drm_crtc_vblank_reset() back.
Only call left is in i915, which doesn't use drm_mode_config_reset,
but has its own fastboot infrastructure. So that's the only case where
we actually want this in the driver still.
I've also reviewed all other drivers which set up vblank support with
drm_vblank_init. After the previous patch fixing mxsfb all atomic
drivers do call drm_crtc_vblank_on/off as they should, the remaining
drivers are either legacy kms or legacy dri1 drivers, so not affected
by this change to atomic helpers.
v2: Use the drm_dev_has_vblank() helper.
v3: Laurent pointed out that omap and rcar-du used drm_crtc_vblank_off
instead of drm_crtc_vblank_reset. Adjust them too.
v4: Laurent noticed that rcar-du and omap open-code their crtc reset
and hence would actually be broken by this patch now. So fix them up
by reusing the helpers, which brings the drm_crtc_vblank_reset() back.
v5: also mention rcar-du and ompadrm in the proper commit message
above (Laurent).
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com >
Acked-by: Maxime Ripard <mripard@kernel.org >
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Acked-by: Liviu Dudau <liviu.dudau@arm.com >
Acked-by: Thierry Reding <treding@nvidia.com >
Link: https://syzkaller.appspot.com/bug?id=0ba17d70d062b2595e1f061231474800f076c7cb
Reported-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp >
Reported-by: syzbot+0871b14ca2e2fb64f6e3@syzkaller.appspotmail.com
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp >
Cc: "James (Qian) Wang" <james.qian.wang@arm.com >
Cc: Liviu Dudau <liviu.dudau@arm.com >
Cc: Mihail Atanassov <mihail.atanassov@arm.com >
Cc: Brian Starkey <brian.starkey@arm.com >
Cc: Sam Ravnborg <sam@ravnborg.org >
Cc: Boris Brezillon <bbrezillon@kernel.org >
Cc: Nicolas Ferre <nicolas.ferre@microchip.com >
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com >
Cc: Ludovic Desroches <ludovic.desroches@microchip.com >
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Cc: Maxime Ripard <mripard@kernel.org >
Cc: Thomas Zimmermann <tzimmermann@suse.de >
Cc: David Airlie <airlied@linux.ie >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: Thierry Reding <thierry.reding@gmail.com >
Cc: Jonathan Hunter <jonathanh@nvidia.com >
Cc: Jyri Sarha <jsarha@ti.com >
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com >
Cc: Rob Clark <robdclark@gmail.com >
Cc: Sean Paul <seanpaul@chromium.org >
Cc: Brian Masney <masneyb@onstation.org >
Cc: Emil Velikov <emil.velikov@collabora.com >
Cc: zhengbin <zhengbin13@huawei.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: linux-tegra@vger.kernel.org
Cc: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com >
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-renesas-soc@vger.kernel.org
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200612160056.2082681-1-daniel.vetter@ffwll.ch
2020-07-02 20:25:51 +02:00
Colin Ian King
5f368ddea6
drm/arm: fix unintentional integer overflow on left shift
...
Shifting the integer value 1 is evaluated using 32-bit arithmetic
and then used in an expression that expects a long value leads to
a potential integer overflow. Fix this by using the BIT macro to
perform the shift to avoid the overflow.
Addresses-Coverity: ("Unintentional integer overflow")
Fixes: ad49f8602f
("drm/arm: Add support for Mali Display Processors")
Signed-off-by: Colin Ian King <colin.king@canonical.com >
Acked-by: Liviu Dudau <liviu.dudau@arm.com >
Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200618100400.11464-1-colin.king@canonical.com
2020-06-19 13:40:06 +01:00
Emil Velikov
21d456a210
drm/malidp: convert platform driver to use dev_groups
...
Platform drivers now have the option to have the platform core create
and remove any needed sysfs attribute files. So take advantage of that
and do not register "by hand" a sysfs file.
Cc: Liviu Dudau <liviu.dudau@arm.com >
Cc: Brian Starkey <brian.starkey@arm.com >
Cc: Mali DP Maintainers <malidp@foss.arm.com >
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com >
Tested-by: Liviu Dudau <liviu.dudau@arm.com >
Acked-by: Liviu Dudau <liviu.dudau@arm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200517193655.3895087-2-emil.l.velikov@gmail.com
2020-06-15 14:56:09 +01:00
Emil Velikov
0f53f2da43
drm/arm: Kconfig annotate drivers as COMPILE_TEST
...
Add the COMPILE_TEST conditional, so that people can at least build test
the drivers.
Cc: Liviu Dudau <liviu.dudau@arm.com >
Cc: Brian Starkey <brian.starkey@arm.com >
Cc: Mali DP Maintainers <malidp@foss.arm.com >
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com >
Tested-by: Liviu Dudau <liviu.dudau@arm.com >
Acked-by: Liviu Dudau <liviu.dudau@arm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200517193655.3895087-1-emil.l.velikov@gmail.com
2020-06-15 14:55:21 +01:00
Thomas Zimmermann
7c70a1e500
drm/malidp: Set GEM CMA functions with DRM_GEM_CMA_DRIVER_OPS_WITH_DUMB_CREATE
...
DRM_GEM_CMA_DRIVER_OPS_WITH_DUMB_CREATE sets the functions in
struct drm_driver to their defaults. No functional changes are
made.
v2:
* update for DRM_GEM_CMA_DRIVER_OPS_WITH_DUMB_CREATE
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Emil Velikov <emil.velikov@collabora.com >
Acked-by: Liviu Dudau <liviu.dudau@arm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200605073247.4057-23-tzimmermann@suse.de
2020-06-10 09:04:08 +02:00
Thomas Zimmermann
ecdd647464
drm/malidp: Use GEM CMA object functions
...
Create GEM objects with drm_gem_cma_create_object_default_funcs(), which
allocates the object and sets CMA's default object functions. Corresponding
callbacks in struct drm_driver are cleared. No functional changes are made.
Driver and object-function instances use the same callback functions, with
the exception of vunmap. The implementation of vunmap is empty and left out
in CMA's default object functions.
v3:
* convert to DRIVER_OPS macro in a separate patch
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Emil Velikov <emil.velikov@collabora.com >
Acked-by: Liviu Dudau <liviu.dudau@arm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200605073247.4057-22-tzimmermann@suse.de
2020-06-10 09:04:01 +02:00
Thomas Zimmermann
fb1f7881a5
drm/komeda: Set GEM CMA functions with DRM_GEM_CMA_DRIVER_OPS_WITH_DUMB_CREATE
...
DRM_GEM_CMA_DRIVER_OPS_WITH_DUMB_CREATE sets the functions in
struct drm_driver to their defaults. No functional changes are
made.
v2:
* update for DRM_GEM_CMA_DRIVER_OPS_WITH_DUMB_CREATE
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Emil Velikov <emil.velikov@collabora.com >
Acked-by: Liviu Dudau <liviu.dudau@arm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200605073247.4057-21-tzimmermann@suse.de
2020-06-10 09:03:54 +02:00
Thomas Zimmermann
1ea528b096
drm/komeda: Use GEM CMA object functions
...
Create GEM objects with drm_gem_cma_create_object_default_funcs(), which
allocates the object and sets CMA's default object functions. Corresponding
callbacks in struct drm_driver are cleared. No functional changes are made.
Driver and object-function instances use the same callback functions, with
the exception of vunmap. The implementation of vunmap is empty and left out
in CMA's default object functions.
v3:
* convert to DRIVER_OPS macro in a separate patch
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Emil Velikov <emil.velikov@collabora.com >
Acked-by: Liviu Dudau <liviu.dudau@arm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200605073247.4057-20-tzimmermann@suse.de
2020-06-10 09:03:46 +02:00
Thomas Zimmermann
d9ec1d2c4a
drm/arm: Set GEM CMA functions with DRM_GEM_CMA_DRIVER_OPS
...
DRM_GEM_CMA_DRIVER_OPS sets the functions in struct drm_driver
to their defaults. No functional changes are made.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Emil Velikov <emil.velikov@collabora.com >
Acked-by: Liviu Dudau <liviu.dudau@arm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200605073247.4057-8-tzimmermann@suse.de
2020-06-10 09:02:21 +02:00
Thomas Zimmermann
7ca3aa3ef3
drm/arm: Use GEM CMA object functions
...
Create GEM objects with drm_gem_cma_create_object_default_funcs(), which
allocates the object and sets CMA's default object functions. Corresponding
callbacks in struct drm_driver are cleared. No functional changes are made.
Driver and object-function instances use the same callback functions, with
the exception of vunmap. The implementation of vunmap is empty and left out
in CMA's default object functions.
v3:
* convert to DRIVER_OPS macro in a separate patch
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Emil Velikov <emil.velikov@collabora.com >
Acked-by: Liviu Dudau <liviu.dudau@arm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200605073247.4057-7-tzimmermann@suse.de
2020-06-10 09:02:10 +02:00
Daniel Vetter
ba931cfd07
drm/hdlcd: Don't call drm_crtc_vblank_off on unbind
...
This is already taken care of by drm_atomic_helper_shutdown(), and
in that case only for the CRTC which are actually on.
Only tricky bit here is that we kill the interrupt handling before we
shut down crtc, so need to reorder that.
Acked-by: Liviu Dudau <liviu.dudau@arm.com >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: Liviu Dudau <liviu.dudau@arm.com >
Cc: Brian Starkey <brian.starkey@arm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200602095140.36678-3-daniel.vetter@ffwll.ch
2020-06-03 15:46:32 +02:00
Daniel Vetter
1c3ef4c5d1
drm/malidp: Don't call drm_crtc_vblank_off on unbind
...
This is already done as part of the drm_atomic_helper_shutdown(),
and in that case only for the crtc which are actually on.
v2: I overlooked that malidp also needs to have it's interrupt shut
down reordered.
Acked-by: Liviu Dudau <liviu.dudau@arm.com >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: Liviu Dudau <liviu.dudau@arm.com >
Cc: Brian Starkey <brian.starkey@arm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200602095505.37509-1-daniel.vetter@ffwll.ch
2020-06-03 15:46:12 +02:00
Emil Velikov
38e7abf7e9
drm/arm: remove _unlocked suffix in drm_gem_object_put_unlocked
...
Spelling out _unlocked for each and every driver is a annoying.
Especially if we consider how many drivers, do not know (or need to)
about the horror stories involving struct_mutex.
Just drop the suffix. It makes the API cleaner.
Done via the following script:
__from=drm_gem_object_put_unlocked
__to=drm_gem_object_put
for __file in $(git grep --name-only $__from); do
sed -i "s/$__from/$__to/g" $__file;
done
Cc: Liviu Dudau <liviu.dudau@arm.com >
Cc: Brian Starkey <brian.starkey@arm.com >
Cc: David Airlie <airlied@linux.ie >
Signed-off-by: Emil Velikov <emil.velikov@collabora.com >
Acked-by: Sam Ravnborg <sam@ravnborg.org >
Acked-by: Liviu Dudau <liviu.dudau@arm.com >
Acked-by: Thomas Zimmermann <tzimmermann@suse.de >
Link: https://patchwork.freedesktop.org/patch/msgid/20200515095118.2743122-16-emil.l.velikov@gmail.com
2020-05-19 22:31:31 +01:00
Daniel Vetter
843ef624a4
drm/komeda: use devm_drm_dev_alloc
...
Komeda uses the component framework, which does open/close a new
devres group around all the bind callbacks. Which means we can use
devm_ functions for managing the drm_device cleanup, with leaking
stuff in case of deferred probes or other reasons to unbind
components, or the component_master.
Also note that this fixes a double-free in the probe unroll code, bot
drm_dev_put and kfree(kms) result in the kms allocation getting freed.
Aside: komeda_bind could be cleaned up a lot, devm_kfree is a bit
redundant. Plus I'm not clear on why there's suballocations for
mdrv->mdev and mdrv->kms. Plus I'm not sure the lifetimes are correct
with all that devm_kzalloc usage ... That structure layout is also the
reason why komeda still uses drm_device->dev_private and can't easily
be replaced with a proper container_of upcasting. I'm pretty sure that
there's endless amounts of hotunplug/hotremove bugs in there with all
the unprotected dereferencing of drm_device->dev_private.
Reviewed-by: James Qian Wang <james.qian.wang@arm.com >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: "James (Qian) Wang" <james.qian.wang@arm.com >
Cc: Liviu Dudau <liviu.dudau@arm.com >
Cc: Mihail Atanassov <mihail.atanassov@arm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-33-daniel.vetter@ffwll.ch
2020-04-28 16:04:00 +02:00
Thomas Zimmermann
08d99b2c23
Merge drm/drm-next into drm-misc-next
...
Backmerging required to pull topic/phy-compliance.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
2020-04-17 08:12:22 +02:00
Daniel Vetter
780e41edf8
drm/<drivers>: Use drmm_add_final_kfree
...
These are the leftover drivers that didn't have a ->release hook that
needed to be updated.
Acked-by: Sam Ravnborg <sam@ravnborg.org >
Acked-by: Liviu Dudau <liviu.dudau@arm.com >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: "James (Qian) Wang" <james.qian.wang@arm.com >
Cc: Liviu Dudau <liviu.dudau@arm.com >
Cc: Mihail Atanassov <mihail.atanassov@arm.com >
Cc: Russell King <linux@armlinux.org.uk >
Cc: Hans de Goede <hdegoede@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-19-daniel.vetter@ffwll.ch
2020-03-26 15:26:52 +01:00
Wambui Karuga
7ce84471e3
drm: convert .debugfs_init() hook to return void.
...
As a result of commit 987d65d013
(drm: debugfs: make
drm_debugfs_create_files() never fail) and changes to various debugfs
functions in drm/core and across various drivers, there is no need for
the drm_driver.debugfs_init() hook to have a return value. Therefore,
declare it as void.
This also includes refactoring all users of the .debugfs_init() hook to
return void across the subsystem.
v2: include changes to the hook and drivers that use it in one patch to
prevent driver breakage and enable individual successful compilation of
this change.
References: https://lists.freedesktop.org/archives/dri-devel/2020-February/257183.html
Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com >
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: https://patchwork.freedesktop.org/patch/msgid/20200310133121.27913-18-wambui.karugax@gmail.com
2020-03-18 17:53:28 +01:00
Wambui Karuga
0bc40e1860
drm/arm: make hdlcd_debugfs_init() return 0
...
Since commit 987d65d013
(drm: debugfs: make
drm_debugfs_create_files() never fail), drm_debugfs_create_files() never
fails and should return void. Therefore, remove its use as the
return value of hdlcd_debugfs_init() and have the latter function return
0 directly.
v2: make hdlcd_debugfs_init() return 0 instead of void to ensure that
each patch compiles individually.
References: https://lists.freedesktop.org/archives/dri-devel/2020-February/257183.html
Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com >
Acked-by: Liviu Dudau <liviu.dudau@arm.com >
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: https://patchwork.freedesktop.org/patch/msgid/20200310133121.27913-7-wambui.karugax@gmail.com
2020-03-18 16:23:20 +01:00
Arnd Bergmann
9803aac7b5
drm/komeda: mark PM functions as __maybe_unused
...
Without this, we get a couple of warnings when CONFIG_PM
is disabled:
drivers/gpu/drm/arm/display/komeda/komeda_drv.c:156:12: error: 'komeda_rt_pm_resume' defined but not used [-Werror=unused-function]
static int komeda_rt_pm_resume(struct device *dev)
^~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/arm/display/komeda/komeda_drv.c:149:12: error: 'komeda_rt_pm_suspend' defined but not used [-Werror=unused-function]
static int komeda_rt_pm_suspend(struct device *dev)
^~~~~~~~~~~~~~~~~~~~
Fixes: efb4650885
("drm/komeda: Add runtime_pm support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de >
Reviewed-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com >
Signed-off-by: james qian wang (Arm Technology China) <james.qian.wang@arm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200107215327.1579195-1-arnd@arndb.de
2020-03-06 11:25:58 +08:00
Dave Airlie
3d4743131b
Backmerge v5.5-rc7 into drm-next
...
msm needs 5.5-rc4, go to the latest.
Signed-off-by: Dave Airlie <airlied@redhat.com >
2020-01-20 11:42:57 +10:00
Dave Airlie
f5c547efa1
Merge tag 'drm-misc-next-2020-01-02' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
...
drm-misc-next for v5.6:
UAPI Changes:
- Commandline parser: Add support for panel orientation, and per-mode options.
- Fix IOCTL naming for dma-buf heaps.
Cross-subsystem Changes:
- Rename DMA_HEAP_IOC_ALLOC to DMA_HEAP_IOCTL_ALLOC before it becomes abi.
- Change DMA-BUF system-heap's name to system.
- Fix leak in error handling in dma_heap_ioctl(), and make a symbol static.
- Fix udma-buf cpu access.
- Fix ti devicetree bindings.
Core Changes:
- Add CTA-861-G modes with VIC >= 193.
- Change error handling and remove bug_on in *drm_dev_init.
- Export drm_panel_of_backlight() correctly once more.
- Add support for lvds decoders.
- Convert drm/client and drm/(gem-,)fb-helper to drm-device based logging and update logging todo.
Driver Changes:
- Add support for dsi/px30 to rockchip.
- Add fb damage support to virtio.
- Use dma_resv locking wrappers in vc4, msm, etnaviv.
- Make functions in virtio static, and perform some simplifications.
- Add suspend support to sun4i.
- Add A64 mipi dsi support to sun4i.
- Add runtime pm suspend to komeda.
- Associated driver fixes.
Signed-off-by: Dave Airlie <airlied@redhat.com >
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/efc11139-1653-86bc-1b0f-0aefde219850@linux.intel.com
2020-01-03 11:43:44 +10:00
james qian wang (Arm Technology China)
efb4650885
drm/komeda: Add runtime_pm support
...
- Add pm_runtime_get/put to crtc_enable/disable along with the real
display usage
- Add runtime_get/put to register_show, since register_show() will
access register, need to wakeup HW.
- For the case that PM is not enabled or configured, manually wakeup HW
Signed-off-by: james qian wang (Arm Technology China) <james.qian.wang@arm.com >
Reviewed-by: Mihail Atanassov <mihail.atanassov@arm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191212074756.14678-1-james.qian.wang@arm.com
2019-12-27 13:45:44 +08:00
james qian wang (Arm Technology China)
8f902dbd6e
drm/komeda: Add event handling for EMPTY/FULL
...
EMPTY/FULL are HW input/output FIFO condition identifer, which are
useful information for addressing the problem, so expose them.
Signed-off-by: james qian wang (Arm Technology China) <james.qian.wang@arm.com >
Reviewed-by: Mihail Atanassov <mihail.atanassov@arm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191212072737.30116-1-james.qian.wang@arm.com
2019-12-27 11:38:44 +08:00
Ben Dooks (Codethink)
ac2917b019
drm/arm/mali: make malidp_mw_connector_helper_funcs static
...
The malidp_mw_connector_helper_funcs is not referenced by name
outside of the file it is in, so make it static to avoid the
following warning:
drivers/gpu/drm/arm/malidp_mw.c:59:41: warning: symbol 'malidp_mw_connector_helper_funcs' was not declared. Should it be static?
Signed-off-by: Ben Dooks (Codethink) <ben.dooks@codethink.co.uk >
Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191217115309.2133503-1-ben.dooks@codethink.co.uk
2019-12-20 15:23:51 +00:00
Daniel Vetter
e529878e4b
drm/malidp: plane_state->fb iff plane_state->crtc
...
Checking both is one too much, so wrap a WARN_ON around it to stope
the copypasta.
Acked-by: Liviu Dudau <liviu.dudau@arm.com >
Acked-by: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: Liviu Dudau <liviu.dudau@arm.com >
Cc: Brian Starkey <brian.starkey@arm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191213172612.1514842-2-daniel.vetter@ffwll.ch
2019-12-17 17:26:08 +01:00
Daniel Vetter
6c56e8adc0
Merge tag 'drm-misc-next-2019-12-16' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
...
drm-misc-next for v5.6:
UAPI Changes:
- Add support for DMA-BUF HEAPS.
Cross-subsystem Changes:
- mipi dsi definition updates, pulled into drm-intel as well.
- Add lockdep annotations for dma_resv vs mmap_sem and fs_reclaim.
- Remove support for dma-buf kmap/kunmap.
- Constify fb_ops in all fbdev drivers, including drm drivers and drm-core, and media as well.
Core Changes:
- Small cleanups to ttm.
- Fix SCDC definition.
- Assorted cleanups to core.
- Add todo to remove load/unload hooks, and use generic fbdev emulation.
- Assorted documentation updates.
- Use blocking ww lock in ttm fault handler.
- Remove drm_fb_helper_fbdev_setup/teardown.
- Warning fixes with W=1 for atomic.
- Use drm_debug_enabled() instead of drm_debug flag testing in various drivers.
- Fallback to nontiled mode in fbdev emulation when not all tiles are present. (Later on reverted)
- Various kconfig indentation fixes in core and drivers.
- Fix freeing transactions in dp-mst correctly.
- Sean Paul is steping down as core maintainer. :-(
- Add lockdep annotations for atomic locks vs dma-resv.
- Prevent use-after-free for a bad job in drm_scheduler.
- Fill out all block sizes in the P01x and P210 definitions.
- Avoid division by zero in drm/rect, and fix bounds.
- Add drm/rect selftests.
- Add aspect ratio and alternate clocks for HDMI 4k modes.
- Add todo for drm_framebuffer_funcs and fb_create cleanup.
- Drop DRM_AUTH for prime import/export ioctls.
- Clear DP-MST payload id tables downstream when initializating.
- Fix for DSC throughput definition.
- Add extra FEC definitions.
- Fix fake offset in drm_gem_object_funs.mmap.
- Stop using encoder->bridge in core directly
- Handle bridge chaining slightly better.
- Add backlight support to drm/panel, and use it in many panel drivers.
- Increase max number of y420 modes from 128 to 256, as preparation to add the new modes.
Driver Changes:
- Small fixes all over.
- Fix documentation in vkms.
- Fix mmap_sem vs dma_resv in nouveau.
- Small cleanup in komeda.
- Add page flip support in gma500 for psb/cdv.
- Add ddc symlink in the connector sysfs directory for many drivers.
- Add support for analogic an6345, and fix small bugs in it.
- Add atomic modesetting support to ast.
- Fix radeon fault handler VMA race.
- Switch udl to use generic shmem helpers.
- Unconditional vblank handling for mcde.
- Miscellaneous fixes to mcde.
- Tweak debug output from komeda using debugfs.
- Add gamma and color transform support to komeda for DOU-IPS.
- Add support for sony acx424AKP panel.
- Various small cleanups to gma500.
- Use generic fbdev emulation in udl, and replace udl_framebuffer with generic implementation.
- Add support for Logic PD Type 28 panel.
- Use drm_panel_* wrapper functions in exynos/tegra/msm.
- Add devicetree bindings for generic DSI panels.
- Don't include drm_pci.h directly in many drivers.
- Add support for begin/end_cpu_access in udmabuf.
- Stop using drm_get_pci_dev in gma500 and mga200.
- Fixes to UDL damage handling, and use dma_buf_begin/end_cpu_access.
- Add devfreq thermal support to panfrost.
- Fix hotplug with daisy chained monitors by removing VCPI when disabling topology manager.
- meson: Add support for OSD1 plane AFBC commit.
- Stop displaying garbage when toggling ast primary plane on/off.
- More cleanups and fixes to UDL.
- Add D32 suport to komeda.
- Remove globle copy of drm_dev in gma500.
- Add support for Boe Himax8279d MIPI-DSI LCD panel.
- Add support for ingenic JZ4770 panel.
- Small null pointer deference fix in ingenic.
- Remove support for the special tfp420 driver, as there is a generic way to do it.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch >
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/ba73535a-9334-5302-2e1f-5208bd7390bd@linux.intel.com
2019-12-17 13:57:54 +01:00
james qian wang (Arm Technology China)
17cfcb68af
drm/komeda: Enable new product D32 support
...
D32 is simple version of D71, the difference is:
- Only has one pipeline
- Drop the periph block and merge it to GCU
v2: Rebase.
v3: Isolate the block counting fix to a new patch
Signed-off-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com >
Reviewed-by: Mihail Atanassov <mihail.atanassov@arm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191210084828.19664-3-james.qian.wang@arm.com
2019-12-12 14:54:19 +08:00
james qian wang (Arm Technology China)
b25bc78f8a
drm/komeda: Update the chip identify
...
1. Drop komeda-CORE product id comparison and put it into the d71_identify
2. Update pipeline node DT-binding:
(a). Skip the needless pipeline DT node.
(b). Return fail if the essential pipeline DT node is missing.
With these changes, for chips in same family no need to change the DT.
v2: Rebase
v3: Address Mihail's comments.
Signed-off-by: james qian wang (Arm Technology China) <james.qian.wang@arm.com >
Reviewed-by: Mihail Atanassov <mihail.atanassov@arm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191210084828.19664-2-james.qian.wang@arm.com
2019-12-12 14:54:18 +08:00
james qian wang (Arm Technology China)
6fd70eab49
drm/komeda: Correct d71 register block counting
...
Per HW, d71->num_blocks includes reserved blocks but no PERIPH block,
correct the block counting accordingly.
D71 happens to only have one reserved block and periph block, which
hides this counting error.
Signed-off-by: james qian wang (Arm Technology China) <james.qian.wang@arm.com >
Reviewed-by: Mihail Atanassov <mihail.atanassov@arm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191210061015.25905-1-james.qian.wang@arm.com
2019-12-12 14:44:29 +08:00
james qian wang (Arm Technology China)
81fa149b2d
drm/komeda: Clean warnings: candidate for 'gnu_printf’ format attribute
...
komeda/komeda_event.c: In function ‘komeda_sprintf’:
komeda/komeda_event.c:31:2: warning: function ‘komeda_sprintf’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
num = vsnprintf(str->str + str->len, free_sz, fmt, args);
v2: Update the comment msg.
Reviewed-by: Mihail Atanassov <mihail.atanassov@arm.com >
Signed-off-by: james qian wang (Arm Technology China) <james.qian.wang@arm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191114100421.30510-1-james.qian.wang@arm.com
2019-11-19 16:11:47 +08:00
Lowry Li (Arm Technology China)
db9cd76d09
drm/komeda: Adds gamma and color-transform support for DOU-IPS
...
Adds gamma and color-transform support for DOU-IPS.
Adds two caps members fgamma_coeffs and ctm_coeffs to komeda_improc_state.
If color management changed, set gamma and color-transform accordingly.
v5: Rebase with drm-misc-next
Signed-off-by: Lowry Li (Arm Technology China) <lowry.li@arm.com >
Signed-off-by: james qian wang (Arm Technology China) <james.qian.wang@arm.com >
Reviewed-by: Mihail Atanassov <mihail.atanassov@arm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191112110927.20931-5-james.qian.wang@arm.com
2019-11-14 10:39:00 +08:00
james qian wang (Arm Technology China)
bb346b6642
drm/komeda: Add drm_ctm_to_coeffs()
...
This function is for converting drm_color_ctm matrix to komeda hardware
required required Q2.12 2's complement CSC matrix.
v2:
Move the fixpoint conversion function s31_32_to_q2_12() to drm core
as a shared helper.
Signed-off-by: james qian wang (Arm Technology China) <james.qian.wang@arm.com >
Reviewed-by: Mihail Atanassov <mihail.atanassov@arm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191112110927.20931-4-james.qian.wang@arm.com
2019-11-14 10:31:27 +08:00
james qian wang (Arm Technology China)
c2b13c650f
drm/komeda: Add drm_lut_to_fgamma_coeffs()
...
This function is used to convert drm color lut to komeda HW required curve
coeffs values.
Signed-off-by: james qian wang (Arm Technology China) <james.qian.wang@arm.com >
Reviewed-by: Mihail Atanassov <mihail.atanassov@arm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191112110927.20931-3-james.qian.wang@arm.com
2019-11-14 10:29:51 +08:00
Dave Airlie
77e0723bd2
Merge v5.4-rc7 into drm-next
...
We have the i915 security fixes to backmerge, but first
let's clear the decks for other drivers to avoid a bigger
mess.
Signed-off-by: Dave Airlie <airlied@redhat.com >
2019-11-14 05:53:10 +10:00
james qian wang (Arm Technology China)
6958aa9092
drm/komeda: Fix komeda driver build error
...
Fix the build errors lead by
'commit 4039f0293b
("drm/komeda: Add option to print WARN- and INFO-level IRQ events")'
Signed-off-by: james qian wang (Arm Technology China) <james.qian.wang@arm.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: https://patchwork.freedesktop.org/patch/msgid/20191113013114.3013-1-james.qian.wang@arm.com
2019-11-13 16:21:14 +08:00
Mihail Atanassov
f8fbe33be7
drm/komeda: add rate limiting disable to err_verbosity
...
It's possible to get multiple events in a single frame/flip, so add an
option to print them all.
Reviewed-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com >
Acked-by: Liviu Dudau <liviu.dudau@arm.com >
Signed-off-by: Mihail Atanassov <mihail.atanassov@arm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191107114155.54307-6-mihail.atanassov@arm.com
2019-11-12 11:46:44 +00:00
Mihail Atanassov
4039f0293b
drm/komeda: Add option to print WARN- and INFO-level IRQ events
...
Extra detail (normally off) almost never hurts.
Reviewed-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com >
Acked-by: Liviu Dudau <liviu.dudau@arm.com >
Signed-off-by: Mihail Atanassov <mihail.atanassov@arm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191107114155.54307-5-mihail.atanassov@arm.com
2019-11-12 11:46:39 +00:00
Mihail Atanassov
393389347c
drm/komeda: Optionally dump DRM state on interrupts
...
It's potentially useful information when diagnosing error/warn IRQs, so
dump it to dmesg with a drm_info_printer. Hide this extra debug dumping
behind another komeda_dev->err_verbosity bit.
Note that there's not much sense in dumping it for INFO events,
since the VSYNC event will swamp the log.
Reviewed-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com >
Acked-by: Liviu Dudau <liviu.dudau@arm.com >
Signed-off-by: Mihail Atanassov <mihail.atanassov@arm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191107114155.54307-4-mihail.atanassov@arm.com
2019-11-12 11:46:35 +00:00
Mihail Atanassov
9a673215bd
drm/komeda: Remove CONFIG_KOMEDA_ERROR_PRINT
...
Now that there's a debugfs node to control the same, remove the
config option.
Reviewed-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com >
Acked-by: Liviu Dudau <liviu.dudau@arm.com >
Signed-off-by: Mihail Atanassov <mihail.atanassov@arm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191107114155.54307-3-mihail.atanassov@arm.com
2019-11-12 11:46:29 +00:00
Mihail Atanassov
8894cd5824
drm/komeda: Add debugfs node to control error verbosity
...
Named 'err_verbosity', currently with only 1 active bit in that
replicates the existing level - print error events once per flip.
Reviewed-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com >
Acked-by: Liviu Dudau <liviu.dudau@arm.com >
Signed-off-by: Mihail Atanassov <mihail.atanassov@arm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191107114155.54307-2-mihail.atanassov@arm.com
2019-11-12 11:45:57 +00:00