In some cases, there are too much userspace high priority RT threads, which
cause kernel RT threads or kworkers block too long time. This config separate
kernel and userspace RT threads into two priority regions, priority 0~49 for
kernel and priority 50~99 for userspace, so that kernel RT threads is always
higher priority than userspace. This config also set RT policy for kworkers.
Change-Id: I87e03915dc0dd03cbcd91d211d2ef56c301451f9
Signed-off-by: Liang Chen <cl@rock-chips.com>
Enable this config used in some old IP chips, e.g. rk3288/rk3399...Socs.
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Change-Id: I015ac9fdab94f23c8c6cd14b2696cfdf03cc0f18
gamma maybe enable at uboot, so we read dsp_lut state to adjust gamma
state is more correct.
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: Ie8893e6136009874c140933b10a77d532e019aa1
This patch fix following two cases dwc2 resume does not recognize
peripherals.
1. plug in device after system suspend, then press the power-on
button to wake up,at this time the dr_mode is OTG, op_state is
still Peripheral, the Bit[0] of GINTSTS is 1 and the port power
is off, dwc2 will not resume at this time.
2. plug in device then press the power-on button to put the system
to sleep, then we press the power-on button to wake up the system,
At this time, the dr_mode is OTG, op_state is still Host, the Bit[0]
of GINTSTS is 1, dwc2 will not resume and working abnormally.
To resolve the first exception, we should call the dwc2_hsotg_resume()
directly to resume dwc2. To resolve the second exception, if the dwc2
is lost power during suspend like RK3326S platform, wo should reinit
the core to device mode, and after do dwc2_hsotg_resume, it can trigger
the ID status change interrupt if the OTG cable is still connect. Then
we can init it for host mode in the ID status change interrupt handler.
We can use the power on bit of Hprt register to distinguish whether
it is lost power during suspend.
Signed-off-by: Jianwei Zheng <jianwei.zheng@rock-chips.com>
Change-Id: I7cd09bce993dcee8e5bfcaddd5fe884cdfab6b52
Some rockchip encoder (e.g RV1106/RV1103) support to reserve
UVC Header in the encoded image, this patch improve the uvc
driver to support zero copy for uvc formats MJPEG/H264/H265,
and no support zero copy for YUYV.
By default, the uvc driver disable the zero copy, you can
set the ${USB_FUNCTIONS_DIR}/uvc.gs*/uvc_zero_copy to 1
to enable the zero copy.
Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: I19be26170d51f209f3196f546515be665481b8b5
kernel_read()/kernel_write() are missing from GKI symbol list.
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Iad8f6749840d8fdc6c80c751a3d229e9f04359de
Maybe appear the following case:
-> set gamma
-> config done
-> atomic commit
--> update win format
--> update win address
---> here maybe meet vop hardware frame start, and triggle some config take affect.
---> as only some config take affect, this maybe lead to iommu pagefault.
--> update win size
--> update win other parameters
-> config done
so we add vop2_wait_for_fs_by_done_bit_status() to make sure the first config done take
effect and then to do next frame config.
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I6ec67b374b3afd2bed4a57aa1e7b729964df1736
Fix the following smatch warnings:
rockchip_drm_vop2.c:2892 rk3568_crtc_load_lut() warn: we tested 'vp->gamma_lut_active' before and it was 'true'
rockchip_drm_vop2.c:6995 vop2_setup_hdr10() warn: we tested 'vp->hdr_out' before and it was 'true'
rockchip_drm_vop2.c:7512 vop2_setup_dly_for_vp() warn: we tested 'vp->hdr_in' before and it was 'true'
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I239658d19924b12843efdee8edf89962df1dae0b
https://lkml.org/lkml/2016/9/14/208
Interactive governor has lived in Android sources for a very long time
and this commit is based on the code present in following branch:
https://android.googlesource.com/kernel/common android-4.4
The Interactive governor is designed for latency-sensitive workloads,
such as interactive user interfaces like the mobile phones and tablets.
The interactive governor aims to be significantly more responsive to
ramp CPU quickly up when CPU-intensive activity begins.
Existing governors sample CPU load at a particular rate, typically every
X ms and then update the frequency from a work-handler. This can lead
to under-powering UI threads for the period of time during which the
user begins interacting with a previously-idle system until the next
sample period happens.
The 'interactive' governor uses a different approach.
A real-time thread is used for scaling up, giving the remaining tasks
the CPU performance benefit, unlike existing governors which are more
likely to schedule ramp-up work to occur after your performance starved
tasks have completed.
The Android version of interactive governor also checks whether to scale
the CPU frequency up soon after coming out of idle. When the CPU comes
out of idle, the governor check if the CPU sampling is overdue or not.
If yes, it immediately starts the sampling. Otherwise, the utilization
hooks from the scheduler handle the sampling later. If the CPU is very
busy from exiting idle to when the evaluation happens, then it assumes
that the CPU is under-powered and ramps it to MAX speed.
If the CPU was not sufficiently busy to immediately ramp to MAX speed,
then the governor evaluates the CPU load since the last speed
adjustment, choosing the highest value between that longer-term load or
the short-term load since idle exit to determine the CPU speed to ramp
to.
The core of this code is written and maintained (in Android
repositories) by Mike Chan and Todd Poyner over a long period of time.
Vireshk has made changes to to the governor to align it with the current
practices followed with mainline governors, like using utilization hooks
from the scheduler and handling kobject (for governor's sysfs directory)
in a race free manner. And of course this included general cleanup of
the governor as well.
Signed-off-by: Mike Chan <mike@android.com>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Change-Id: Ib5e8d1dab0fa3cc5ba79b7a554c8dde35435cbdb
[AmitP: Cherry-picked this version from
https://git.kernel.org/cgit/linux/kernel/git/vireshk/pm.git/log/?h=cpufreq/interactive-idle-notifier.
Also refactored and folded https://lkml.org/lkml/2016/9/14/209
patch into this unified patch.]
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Liang Chen <cl@rock-chips.com>
(cherry picked from https://android.googlesource.com/kernel/msm
commit 33f7a05d4e82c81841af20e6a944a4c3f9b2973e)
When CPU idle is enabled, the idle call should also notify the
idle_notifier_call_chain of the change in status. Otherwise some
processes will think the CPU is always active.
CRs-Fixed: 677525
Change-Id: Iabd6f617d6835688cf8b482ac1321e5c1deafffd
Signed-off-by: Patrick Cain <pcain@codeaurora.org>
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
Signed-off-by: Liang Chen <cl@rock-chips.com>
(cherry picked from https://android.googlesource.com/kernel/msm
commit e7f65ab439125bdc29a7a0ca7345ff746d014119)
Use IS_ERR() instead of checking for a NULL pointer when calling for
drm_atomic_helper_duplicate_state() failures.
drm_atomic_helper_duplicate_state() return an ERR_PTR()-encoded error
code on failure.
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I95388698239a7e1bd2bfbedd2bd921bbf52372f0
hdmi_sound compatible to rockchip,hdmi for jack function
Signed-off-by: Jiajian Wu <jair.wu@rock-chips.com>
Change-Id: Ib54304cfed2ad8fe5b6c87a559a827a56b82a4c2
RK809 compatible to rockchip,multicodecs-card for jack function
Signed-off-by: Jiajian Wu <jair.wu@rock-chips.com>
Change-Id: Ia430978a4239dc072f92d5de514285035e1159f7
Current policy:
If there are two pending config done vp, and one of them is
at critical time zone, wait for the one which 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>
drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_common.c:7852:50: warning: format specifies type 'int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
DHD_ERROR(("fw->size = %d, *length = %d\n", fw->size, *length));
~~ ^~~~~~~~
%lu
Fixes: 6513b9fbdd ("net: wireless: update bcmdhd driver to 101.10.361.20")
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Ia2cce87e3392174f8a6165494e1c7962ae07bd93
color_key is passed by atomic_set_property with a uint64_t val.
Change-Id: Idc66dc1632f3c00f353d05016aa79f362506fef5
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
The normal hardware has not changed, and the rx delayline does not need
to be changed, but the value is different if the realteak PHY driver is
turned on by default.
[root@buildroot:/]# echo 1000 > ./sys/devices/platform/fe300000.ethernet/phy_lb_
scan
rx_delay = 0x23
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Change-Id: If42019a8c17b24d6df72a30f4f7377e5f6feafe0
1) add hub_reset signal for V14 boards
As the previous version boards, USB3.0 hub has stability problems.
In order to solve this issue, The reset pin of USB3.0 hub is controlled
by GPIO and reset USB3.0 hub through software on v14 board.
2) fix the order for hdmi_sound
3) enable i2s1
The i2s1 is used by rk809 codec.
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Change-Id: I2a1ccba30705f83884b8284d418dd0cb6cb481fc
some product will use gpio to instead of TE, so we add soft TE for all vp.
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: Idb2d8b6a63c17308519761ae986f853b2baf0bc4
Providing a interface for hdcp controller to load key.
Signed-off-by: Zhang Yubing <yubing.zhang@rock-chips.com>
Change-Id: I205c54e2ce1abc394761fc49724b76b25b2947bf
In order to make GKI work.
Fixes: 365ee62df1 ("PCI: rockchip: Add ACPI support")
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Change-Id: I46a696b5e69c858d660eab975bd24431f149c303