Some application(e.g Kwin) may use it as a default rotation.
We should set it a valid rotation here.
Change-Id: Idef8fa5097b54710e2ead32a197d5d1e6bf78d94
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Sometimes the vop line bandwidth is not high, the vop also report
buf empty err, and the frame bandwidth is high at this time, so change
ddr frequency according to frame bandwidth can fix the error.
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: Ia893a07def99aaaa4da421b6d619a8fd3eec9745
sc5239 have logic gain for analog, it can improve the image quality for
raw data.
Signed-off-by: Yiqing Zeng <zack.zeng@rock-chips.com>
Change-Id: I03a17f21d1457aa60a7438b4a4895493e879be28
After testing, if use previous hdmitx pll cfg , rk356x some
chips will appear 297M tmds clock output abnormal. After
signal testing, it was decided to update the vendor
recommended pll cfg.
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: If1ca2f9e5922c9b95b1d90055640daafcacc2301
create independent workqueqe to do auto refresh work
Signed-off-by: Zorro Liu <lyx@rock-chips.com>
Change-Id: I71421e4391fe9c1f85023b08057d75a4e11e9c85
The device must be registered last. If there is an error, the device
should not succeed.
Change-Id: Ie342c8bbf30e8a94822dcb2e0417fe1230e4482a
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
1. reduce buffer size to 128KB
2. invalidate buffer cache on demand
3. reduce scantimer interval to 100us
Can improve NPU fps from 45 to 95, the main reason is that
most of data packages of NPU less than 1MB, setting buffer
size to 128KB got a well result after testing.
Signed-off-by: Simon Xue <xxm@rock-chips.com>
Change-Id: Ib9e57b95a608110f4ec00c74a84cbe6deb63caf7
When devfreq initially fails, the device can still continue to execute,
but there is no devfreq function.
Change-Id: I2a39a77e0a85cb43854b6adbe0476905abcc9a3b
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
This reverts commit 75b31192fe.
The original purpose of customized pcm was to config prealloc buffer size
flexibly. but, we can do the same thing by soc-generic-dmaengine-pcm.
And the generic one can generated the better config by querying DMA
capabilities from dmaengine driver rather than the Hard-Coded one.
e.g.
the customized one:
static const struct snd_pcm_hardware snd_rockchip_hardware = {
.info = SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_PAUSE |
SNDRV_PCM_INFO_RESUME |
SNDRV_PCM_INFO_INTERLEAVED,
...
the generic one:
ret = dma_get_slave_caps(chan, &dma_caps);
if (ret == 0) {
if (dma_caps.cmd_pause && dma_caps.cmd_resume)
hw.info |= SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME;
if (dma_caps.residue_granularity <= DMA_RESIDUE_GRANULARITY_SEGMENT)
hw.info |= SNDRV_PCM_INFO_BATCH;
...
So, let's revert back to use the generic dmaengine pcm.
Change-Id: I30eee2e8047b69d7311fd6da0cfd2b5872b81e17
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Reviewed-by: John Keeping <john@metanate.com>
Link: https://lore.kernel.org/r/1632792957-80428-1-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 5ba8ecf227
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.16)
Currently, The fixed 512KB prealloc buffer size is too larger for
tiny memory kernel (such as 16MB memory). This patch adds the module
option "prealloc_buffer_size_kbytes" to specify prealloc buffer size.
It's suitable for cards which use the generic dmaengine pcm driver
with no config.
Change-Id: I76cc278f523d41083ba30b36d801d2839682d158
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1632394246-59341-1-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit b0e3b0a707
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.16)
Current policy:
If there are two pending config done vp, and one of them is
at critical time zone, wait for the one wich has long time
to vsync.
This may lead a very long wait, for example: VP0 is 3840 x 2160,
VP2 is 1920 x 1080, they are all have pending cfg done bits,
and the vcnt of VP0 is 1367, the vcnt of VP2 is 995, VP2 is
at the critical time zone, we will wait VP0 vsync(almost half frame time)
according to this policy. This lead a very long wait.
The new policy:
If there are two pending config done vp, and one of them is
at critical time zone, compare the left vcnt time of the
two vp:
if (first_vp_left_time > second_vp_left_time) {
if ((first_vp_left_time - second_vp_left_time) > first_vp_safe_time)
wait_vp = second_done_vp;
else
wait_vp = first_done_vp;
} else {
if ((second_vp_left_time - first_vp_left_time) > second_vp_safe_time)
wait_vp = first_done_vp;
else
wait_vp = second_done_vp;
}
Change-Id: I7154ad716841c6c28947ddfecc845c7271cc507a
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
If delayline can't get from DTB or invalid, don't enable delayline.
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I9769af42d02c67d2ea3fd24de5def45a1ec1cc17
On some platforms(such as px30), vepu and vdpu shared the
same mmu.So when registering the iommu handle function,
there will be overwriting.Results in the reported device mismatch
when page fault.
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Id07c7f3088c52fcb987797c689296154c670078c
The symbols is used for rockchip video codec driver,
which located driver/rockchip/video/mpp. When mpp is build
for module, it will be error.
Error message:
ERROR: "device_links_read_unlock"
[drivers/video/rockchip/mpp/rk_vcodec.ko] undefined!
ERROR: "device_links_read_lock" [drivers/video/rockchip/mpp/rk_vcodec.ko] undefined!
make[2]: *** [__modpost] Error 1
make[1]: *** [modules] Error 2
make: *** [kernel.img] Error 2
make: *** Deleting file `kernel.img'`
Change-Id: Ie412341c03ad71d257392a22249b62bedd0be58b
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
The dwc3 gadget call pm_runtime_get in the __dwc3_gadget_ep_queue()
to increment the device's usage count, and call pm_runtime_put in
the dwc3_gadget_giveback() to decrement the device's usage count
if the request is completed successfully or disconnection happens.
Test on RK3399 IND Type-C interface with HUSB311 (Type-C port
controller chip), if plug out the USB cable, the extcon notifier
from tcpm framework comes earlier than the dwc3 disconnect event.
This cause the dwc3 fails to enter the runtime suspend immediately
in the disconnection process of __dwc3_set_mode().
This patch waits for the dwc3 disconnect event done before doing
pm_runtime_put_sync_suspend. If it takes 1000ms to wait for the
disconnect event timeout, just print warning log and still do
the pm_runtime_put_sync_suspend, and then the dwc3 can also enter
runtime suspend automatically (DWC3_DEFAULT_AUTOSUSPEND_DELAY is
5000ms) after the disconnect event done.
Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: Ie6086d469b5d24f841532992e4e95f0c91c37022
rk817 int pin is connect to sleep pin on ebook hardware design,
cpu unable to pull high sleep pin to shutdown devices,
when pmic occurs interrupt, so we just disable pmic int
on shutdown process to avoid this.
TEST:Press the Power button frequently while shutting down ebook devices
Signed-off-by: Zorro Liu <lyx@rock-chips.com>
Change-Id: I2a3a45be371b78720a94b1380fbb101a5597cfc6
L0 may be detected just in time if Gen1 training is finished.
But if EP supports higher Gen mode, Gen switch just happen
there but we keep on accessing devices, which leads unstable
link state and fail to detect the device finally.
And a bit more time before accessing devices to avoid this risky
case.
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Change-Id: If7eddce430b4590922b5c8f765be8a240b562d92
Try to keep the same as develop-5.10 code for easily
compare files.
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I19bf821f17d06ad9d46d3319e33c2e3c7823fdce
The operation of reading back flash cache after programing is not
universal. At present, only ESMT devices are found to have this anomaly.
Change-Id: I3ec21eebc4aa7b8a259129ed2c036e1168553f27
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
For rk3568, ddr timings adjustment is no longer supported in dmc drive.
Signed-off-by: YouMin Chen <cym@rock-chips.com>
Change-Id: I63f0c5fea8c5acf8e6ef8f44b62968deb7bd823e
Add dmc_fsp node for initialize dmc frequency set point on U-Boot.
Signed-off-by: YouMin Chen <cym@rock-chips.com>
Change-Id: I9fcd1ae498a64b5a4698c42ad05af96740b59e61
Add ddr parameters for initialize dmc frequency set point.
Signed-off-by: YouMin Chen <cym@rock-chips.com>
Change-Id: I3445fa2dbabca5774306cc1052cd3c1d472b6867
Race detected between psi_trigger_destroy/create as shown below, which
cause panic by accessing invalid psi_system->poll_wait->wait_queue_entry
and psi_system->poll_timer->entry->next. Under this modification, the
race window is removed by initialising poll_wait and poll_timer in
group_init which are executed only once at beginning.
psi_trigger_destroy() psi_trigger_create()
mutex_lock(trigger_lock);
rcu_assign_pointer(poll_task, NULL);
mutex_unlock(trigger_lock);
mutex_lock(trigger_lock);
if (!rcu_access_pointer(group->poll_task)) {
timer_setup(poll_timer, poll_timer_fn, 0);
rcu_assign_pointer(poll_task, task);
}
mutex_unlock(trigger_lock);
synchronize_rcu();
del_timer_sync(poll_timer); <-- poll_timer has been reinitialized by
psi_trigger_create()
So, trigger_lock/RCU correctly protects destruction of
group->poll_task but misses this race affecting poll_timer and
poll_wait.
Change-Id: I256e7679052ff960683b096e6d804cd4719cfa12
Fixes: 461daba06b ("psi: eliminate kthread_worker from psi trigger scheduling mechanism")
Co-developed-by: ziwei.dai <ziwei.dai@unisoc.com>
Signed-off-by: ziwei.dai <ziwei.dai@unisoc.com>
Co-developed-by: ke.wang <ke.wang@unisoc.com>
Signed-off-by: ke.wang <ke.wang@unisoc.com>
Signed-off-by: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Suren Baghdasaryan <surenb@google.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Link: https://lkml.kernel.org/r/1623371374-15664-1-git-send-email-huangzhaoyang@gmail.com
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 8f91efd870)
Each psi group requires a dedicated kthread_delayed_work and
kthread_worker. Since no other work can be performed using psi_group's
kthread_worker, the same result can be obtained using a task_struct and
a timer directly. This makes psi triggering simpler by removing lists
and locks involved with kthread_worker usage and eliminates the need for
poll_scheduled atomic use in the hot path.
Change-Id: Ib28d84949de068a8bc97dccb187ac3e68980a319
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20200528195442.190116-1-surenb@google.com
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 461daba06b)
For RV1109/RV1126 platforms, it resizes the tx fifos for
all of the usb device endpoints by default, it aims to
support UVC composite device, so just only set 16 bytes
for the tx fifo of the intr endpoints. But for the other
USB functions, like MTP function, it requires 64 bytes
tx fifo for its intr endpoint.
Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: I27634dab473dad9a3e3d500cde7156c3eda514e8
Because the PM-runtime status of the device is not updated in
__rpm_callback(), attempts to suspend the suppliers of the given
device triggered by the rpm_put_suppliers() call in there may
cause a supplier to be suspended completely before the status of
the consumer is updated to RPM_SUSPENDED, which is confusing.
To avoid that (1) modify __rpm_callback() to only decrease the
PM-runtime usage counter of each supplier and (2) make rpm_suspend()
try to suspend the suppliers after changing the consumer's status to
RPM_SUSPENDED, in analogy with the device's parent.
Change-Id: I2dbdf3999bc8a06bbbe29f57eb9cc1c49ec1aeff
Link: https://lore.kernel.org/linux-pm/CAPDyKFqm06KDw_p8WXsM4dijDbho4bb6T4k50UqqvR1_COsp8g@mail.gmail.com/
Fixes: 21d5c57b37 ("PM / runtime: Use device links")
Reported-by: elaine.zhang <zhangqing@rock-chips.com>
Diagnosed-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit 5244f5e2d8)
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>