summaryrefslogtreecommitdiff
path: root/drivers/gpu
AgeCommit message (Collapse)AuthorFilesLines
2023-11-06drm/i915: Drop the irqs_disabled() checkSebastian Andrzej Siewior1-2/+0
The !irqs_disabled() check triggers on PREEMPT_RT even with i915_sched_engine::lock acquired. The reason is the lock is transformed into a sleeping lock on PREEMPT_RT and does not disable interrupts. There is no need to check for disabled interrupts. The lockdep annotation below already check if the lock has been acquired by the caller and will yell if the interrupts are not disabled. Remove the !irqs_disabled() check. Reported-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
2023-11-06drm/i915/gt: Use spin_lock_irq() instead of local_irq_disable() + spin_lock()Sebastian Andrzej Siewior1-12/+5
execlists_dequeue() is invoked from a function which uses local_irq_disable() to disable interrupts so the spin_lock() behaves like spin_lock_irq(). This breaks PREEMPT_RT because local_irq_disable() + spin_lock() is not the same as spin_lock_irq(). execlists_dequeue_irq() and execlists_dequeue() has each one caller only. If intel_engine_cs::active::lock is acquired and released with the _irq suffix then it behaves almost as if execlists_dequeue() would be invoked with disabled interrupts. The difference is the last part of the function which is then invoked with enabled interrupts. I can't tell if this makes a difference. From looking at it, it might work to move the last unlock at the end of the function as I didn't find anything that would acquire the lock again. Reported-by: Clark Williams <williams@redhat.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2023-11-06drm/i915/gt: Queue and wait for the irq_work item.Sebastian Andrzej Siewior1-3/+2
Disabling interrupts and invoking the irq_work function directly breaks on PREEMPT_RT. PREEMPT_RT does not invoke all irq_work from hardirq context because some of the user have spinlock_t locking in the callback function. These locks are then turned into a sleeping locks which can not be acquired with disabled interrupts. Using irq_work_queue() has the benefit that the irqwork will be invoked in the regular context. In general there is "no" delay between enqueuing the callback and its invocation because the interrupt is raised right away on architectures which support it (which includes x86). Use irq_work_queue() + irq_work_sync() instead invoking the callback directly. Reported-by: Clark Williams <williams@redhat.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2023-11-06drm/i915: skip DRM_I915_LOW_LEVEL_TRACEPOINTS with NOTRACESebastian Andrzej Siewior1-1/+1
The order of the header files is important. If this header file is included after tracepoint.h was included then the NOTRACE here becomes a nop. Currently this happens for two .c files which use the tracepoitns behind DRM_I915_LOW_LEVEL_TRACEPOINTS. Cc: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2023-11-06drm/i915: Disable tracing points on PREEMPT_RTSebastian Andrzej Siewior1-0/+4
Luca Abeni reported this: | BUG: scheduling while atomic: kworker/u8:2/15203/0x00000003 | CPU: 1 PID: 15203 Comm: kworker/u8:2 Not tainted 4.19.1-rt3 #10 | Call Trace: | rt_spin_lock+0x3f/0x50 | gen6_read32+0x45/0x1d0 [i915] | g4x_get_vblank_counter+0x36/0x40 [i915] | trace_event_raw_event_i915_pipe_update_start+0x7d/0xf0 [i915] The tracing events use trace_i915_pipe_update_start() among other events use functions acquire spinlock_t locks which are transformed into sleeping locks on PREEMPT_RT. A few trace points use intel_get_crtc_scanline(), others use ->get_vblank_counter() wich also might acquire a sleeping locks on PREEMPT_RT. At the time the arguments are evaluated within trace point, preemption is disabled and so the locks must not be acquired on PREEMPT_RT. Based on this I don't see any other way than disable trace points on PREMPT_RT. Reported-by: Luca Abeni <lucabe72@gmail.com> Cc: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
2023-11-06drm/i915: Don't check for atomic context on PREEMPT_RTSebastian Andrzej Siewior1-1/+1
The !in_atomic() check in _wait_for_atomic() triggers on PREEMPT_RT because the uncore::lock is a spinlock_t and does not disable preemption or interrupts. Changing the uncore:lock to a raw_spinlock_t doubles the worst case latency on an otherwise idle testbox during testing. Therefore I'm currently unsure about changing this. Link: https://lore.kernel.org/all/20211006164628.s2mtsdd2jdbfyf7g@linutronix.de/ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
2023-11-06drm/i915: Don't disable interrupts on PREEMPT_RT during atomic updatesMike Galbraith1-5/+10
Commit 8d7849db3eab7 ("drm/i915: Make sprite updates atomic") started disabling interrupts across atomic updates. This breaks on PREEMPT_RT because within this section the code attempt to acquire spinlock_t locks which are sleeping locks on PREEMPT_RT. According to the comment the interrupts are disabled to avoid random delays and not required for protection or synchronisation. If this needs to happen with disabled interrupts on PREEMPT_RT, and the whole section is restricted to register access then all sleeping locks need to be acquired before interrupts are disabled and some function maybe moved after enabling interrupts again. This includes: - prepare_to_wait() + finish_wait() due its wake queue. - drm_crtc_vblank_put() -> vblank_disable_fn() drm_device::vbl_lock. - skl_pfit_enable(), intel_update_plane(), vlv_atomic_update_fifo() and maybe others due to intel_uncore::lock - drm_crtc_arm_vblank_event() due to drm_device::event_lock and drm_device::vblank_time_lock. Don't disable interrupts on PREEMPT_RT during atomic updates. [bigeasy: drop local locks, commit message] Signed-off-by: Mike Galbraith <umgwanakikbuti@gmail.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
2023-11-06drm/i915: Use preempt_disable/enable_rt() where recommendedMike Galbraith1-2/+4
Mario Kleiner suggest in commit ad3543ede630f ("drm/intel: Push get_scanout_position() timestamping into kms driver.") a spots where preemption should be disabled on PREEMPT_RT. The difference is that on PREEMPT_RT the intel_uncore::lock disables neither preemption nor interrupts and so region remains preemptible. The area covers only register reads and writes. The part that worries me is: - __intel_get_crtc_scanline() the worst case is 100us if no match is found. - intel_crtc_scanlines_since_frame_timestamp() not sure how long this may take in the worst case. It was in the RT queue for a while and nobody complained. Disable preemption on PREEPMPT_RT during timestamping. [bigeasy: patch description.] Cc: Mario Kleiner <mario.kleiner.de@gmail.com> Signed-off-by: Mike Galbraith <umgwanakikbuti@gmail.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
2023-11-06drm/i915: Don't disable interrupts and pretend a lock as been acquired in ↵Sebastian Andrzej Siewior4-38/+7
__timeline_mark_lock(). This is a revert of commits d67739268cf0e ("drm/i915/gt: Mark up the nested engine-pm timeline lock as irqsafe") 6c69a45445af9 ("drm/i915/gt: Mark context->active_count as protected by timeline->mutex") The existing code leads to a different behaviour depending on whether lockdep is enabled or not. Any following lock that is acquired without disabling interrupts (but needs to) will not be noticed by lockdep. This it not just a lockdep annotation but is used but an actual mutex_t that is properly used as a lock but in case of __timeline_mark_lock() lockdep is only told that it is acquired but no lock has been acquired. It appears that its purpose is just satisfy the lockdep_assert_held() check in intel_context_mark_active(). The other problem with disabling interrupts is that on PREEMPT_RT interrupts are also disabled which leads to problems for instance later during memory allocation. Add a CONTEXT_IS_PARKED bit to intel_engine_cs and set_bit/clear_bit it instead of mutex_acquire/mutex_release. Use test_bit in the two identified spots which relied on the lockdep annotation. Cc: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
2023-10-26Merge tag 'JH7110_515_SDK_v5.8.2' into vf2-515-develAndy Hu1-38/+5
2023-10-24Revert to original code to avoid possible mosaic problem.Windsome Zeng1-38/+5
Signed-off-by: Windsome Zeng <windsome.zeng@starfivetech.com>
2023-09-22Merge tag 'JH7110_515_SDK_v5.7.5' into vf2-515-develVF2_v3.7.5Andy Hu1-0/+1
2023-09-22Enlarge flush cache size to avoid flick on console/modetest and UVC 1080P ↵Windsome Zeng1-0/+1
camera. Signed-off-by: Windsome Zeng <windsome.zeng@starfivetech.com>
2023-09-21Merge tag 'JH7110_515_SDK_v5.7.4' into vf2-515-develAndy Hu3-8/+57
2023-09-21Merge branch 'CR_6347_linux_hdmi_hotplug_keith.zhao' into 'jh7110-5.15.y-devel'andy.hu1-1/+10
CR_6347 display : hdmi: fix hotplug hang See merge request sdk/linux!960
2023-09-21Mosaic cursor: Revert commit 30289b2ca780bcaf7acb1ffe88125a65b7e34577 as it ↵Windsome Zeng2-7/+47
will drop 50% performance. Just do real flush data while cursor is about to change. Other plane: According to the behavior of L2 cache controller in U74, only the last 2MB data is needed to be flushed. For 4K resolution, it will reduce flush loops from 518400 to 32768 on each frame update. Signed-off-by: Windsome Zeng <windsome.zeng@starfivetech.com>
2023-09-20display : hdmi: fix hotplug hangkeith.zhao1-1/+10
Fixed the probability of hdmi crash after repeated insertion and removal Signed-off-by: keith.zhao <keith.zhao@starfivetech.com>
2023-09-12riscv: drm: panel: update radxa panel startup process and support ↵shengyang.chen2-50/+177
accelerator-sc7a20 mention: this patch is to solve the problem that radxa 8inch use i2c addr 0x19 which conflict with accelerator-sc7a20. Then enable accelerator-sc7a20 1.update radxa panel startup process to support both radxa 10inch and radxa 8inch in one driver 2.add accelerator-sc7a20 i2c probe process into radxa panel driver Signed-off-by: Shengyang Chen <shengyang.chen@starfivetech.com>
2023-08-22Merge branch 'CR_7073_vf2_515_newrd10_shengyang.chen' into 'vf2-515-devel'VF2_v3.6.1andy.hu3-8/+8
CR 7073 vf2 515: riscv: drm: panel: mass production radxa 10inch panel support See merge request sbc/linux!164
2023-08-22Merge tag 'JH7110_515_SDK_v5.6.1' into vf2-515-develAndy Hu1-3/+4
2023-08-22riscv: drm: panel: mass production radxa 10inch panel supportshengyang.chen3-8/+8
change radxa 10inch support from sample to mass production Signed-off-by: Shengyang Chen <shengyang.chen@starfivetech.com>
2023-08-18display : hdmi: fix hibernationKeith Zhao1-3/+4
When echo disk > /sys/power/state , do reset the hdmi will fail to show the console log. it is caused by a reset used share way to get and it will fail to set the reset hardware fix this by use reset_control_get_exclusive Signed-off-by: Keith Zhao <keith.zhao@starfivetech.com>
2023-08-07Merge tag 'JH7110_515_SDK_v5.5.0' into vf2-515-develAndy Hu1-1/+1
2023-08-07driver:gpu: remove the condition check of fencesshanlong.li1-1/+1
run gl-marke-es2-wayland will trigger warning, to fix up it, we remove fences check Signed-off-by: shanlong.li <shanlong.li@starfivetech.com>
2023-07-13Merge tag 'JH7110_515_SDK_v5.4.0' into vf2-515-develAndy Hu1-0/+2
2023-07-10vout:riscv:driver fix vout compile warningshengyang.chen1-0/+2
fix vout compile warning Signed-off-by: Shengyang Chen <shengyang.chen@starfivetech.com>
2023-07-06Merge tag 'JH7110_515_SDK_v5.3.1' into vf2-515-develAndy Hu1-0/+5
2023-07-05riscv: linux: vout: add 1600x720 resolution for hdmishengyang.chen1-0/+1
add 1600x720 resolution for hdmi Signed-off-by: Shengyang Chen shengyang.chen@starfivetech.com
2023-06-29riscv: linux: vout: add 2560x1080 resolution for hdmishengyang.chen1-0/+4
add 2560x1080 resolution for hdmi Signed-off-by: Shengyang Chen <shengyang.chen@starfivetech.com>
2023-06-19Merge tag 'JH7110_515_SDK_v5.2.0' into vf2-515-develVF2_v3.1.5Andy Hu506-13605/+87826
Note: From this version, the IMG DDK will be upgraded to 1.19.
2023-06-19Turn off PVRSRV_NEED_PVR_ASSERT in imagination codeClement1-1/+1
For production use case, we should turn off PVRSRV_NEED_PVR_ASSERT Signed-off-by: Clement <clement@starfivetech.com>
2023-06-19Upgrade Imagination DDK source to 1.19Clement506-13604/+87825
Signed-off-by: Clement <clement@starfivetech.com>
2023-06-10Merge tag 'JH7110_515_SDK_v5.0.5' into vf2-515-devel-v3.0.xAndy Hu1-1/+1
2023-06-07riscv:linux:vout:dc8200Keith Zhao1-1/+1
replace the condition to avoid kernel panic Signed-off-by: Keith Zhao <keith.zhao@starfivetech.com>
2023-05-29Merge tag 'JH7110_515_SDK_v5.0.3' into vf2-515-devel-v3.0.xVF2_v3.0.4Andy Hu1-0/+4
2023-05-29riscv:linux:vout:hdmikeith.zhao1-0/+1
after wake up hdmi , need wait 500ms to read the hdmi connect status or it will read a error value Signed-off-by: keith <keith.zhao@starfivetech.com>
2023-05-29vout:riscv:driver fix 4k console bugshengyang.chen1-0/+3
fix 4k console bug by disabling pixclk mode larger then 297M Signed-off-by: Shengyang Chen <shengyang.chen@starfivetech.com>
2023-05-24Merge tag 'JH7110_515_SDK_v5.0.1' into vf2-515-devel-v3.0.xAndy Hu1-0/+2
2023-05-24drm/dc8200: disable gamma lut nowshengyang.chen1-0/+2
It seems to have dependency issue. Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
2023-05-19Merge tag 'JH7110_515_SDK_v4.9.1' into vf2-515-develAndy Hu2-134/+180
2023-05-15riscv:linux:vout:hdmikeith.zhao2-134/+180
1、use the gpio15 as a irq to wake up hdmi 2、Expand the hdmi resolution range with dynamic parameter configuration Signed-off-by: keith <keith.zhao@starfivetech.com>
2023-05-09vout:riscv:linux: add radxa 10inch driver for vf2shengyang.chen4-60/+517
add radxa 10inch driver for vf2 Signed-off-by: keith <keith.zhao@starfivetech.com> Signed-off-by: Shengyang Chen <shengyang.chen@starfivetech.com>
2023-04-20Merge tag 'JH7110_515_SDK_v4.8.1' into vf2-515-develAndy Hu1-7/+8
version JH7110_515_SDK_v4.8.1 for JH7110 EVB board 1. linux: Merge branch 'CR_4844_PCIe_515_Kevin.xie' into 'jh7110-5.15.y-devel' Merge branch 'CR_4874_Copyright_515_william.qiu' into 'jh7110-5.15.y-devel' Merge branch 'CR_4450_vout_515_changhuang.liang' into 'jh7110-5.15.y-devel' Merge branch 'CR_4114_thermal_5.15_ziv.xu' into 'jh7110-5.15.y-devel' Merge branch 'CR_4657_SDK_keep_the_same_host_driver_code_5.15_ziv.xu' into 'jh7110-5.15.y-devel'
2023-04-19riscv:linux:vout: modetest failChanghuang Liang1-7/+8
after the kernel start , run modetest to display will fail fix this issue Signed-off-by: keith <keith.zhao@starfivetech.com>
2023-04-14Merge tag 'JH7110_515_SDK_v4.8.0' into vf2-515-develAndy Hu3-12/+2
version JH7110_515_SDK_v4.8.0 for JH7110 EVB board 1. linux: Merge branch 'CR_4802_EVB_VOUT_buildWarning_keith.zhao' into 'jh7110-5.15.y-devel'
2023-04-12vout: build warningkeith.zhao3-12/+2
fix the warning message during the vout build Signed-off-by: keith <keith.zhao@starfivetech.com>
2023-04-07Merge tag 'JH7110_515_SDK_v4.7.0' into vf2-515-develah6-30/+64
version JH7110_515_SDK_v4.7.0 for JH7110 EVB board 1. #4284: linux: enable cached memory for IMG GPU driver 2. #4563: linux: optimized memcpy Write a C version of memcpy function 3. #4617: linux: support sensor imx708
2023-03-31gpu: drm: img: Enable cache for VisionFive v2 BoardsTien Hock Loh6-30/+64
For vf2 platform, pgprot table does not support cacheable bit. This patch worksaround the bit by allocating cacheable when pvr driver request cacheable memory map without the pgprot table bit set. Signed-off-by: Tien Hock Loh <tienhock.loh@starfivetech.com>
2023-03-20gpu: drm: img: disable PDUMPjoyce.ooi3-4/+4
PDUMP is disabled to improve performance of GPU as PDUMP is used for debugging purposes. Signed-off-by: joyce.ooi <joyce.ooi@starfivetech.com>
2023-03-20gpu: drm: img: disable PDUMPjoyce.ooi3-4/+4
PDUMP is disabled to improve performance of GPU as PDUMP is used for debugging purposes. Signed-off-by: joyce.ooi <joyce.ooi@starfivetech.com>