{"push_id":3866360601,"size":13,"distinct_size":13,"ref":"refs/heads/pie","head":"02a5ae80910ac20e033931b20a7b4a3174324d44","before":"9293482005c1d15021feb308f096637b8408e182","commits":[{"sha":"475debbecb00c196d7c1f49425398f24c564920c","author":{"name":"tanish2k09","email":"10d9addef400646940f39989d9848de586394155@gmail.com"},"message":"Introducing KLapse - A kernel level livedisplay module v4.0:\n\nAuthor: @tanish2k09 (email: tanish2k09.dev@gmail.com)\n\nWhat is it?\nKernel-based Lapse (\"K-Lapse\") is a linear RGB scaling module that 'shifts' RGB based on time (of the day/selected by user), or (since v2.0) brightness. This concept is inspired from\nLineageOS (formerly known as 'CyanogenMod') ROM's feature \"livedisplay\" which also changes the display settings (RGB, hue, temperature, etc) based on time.\n\nWhy did you decide to make this? (Tell me a story).\nI (personally) am a big fan of the livedisplay feature found on LineageOS ROM. I used it every single day, since Android Lollipop. Starting from Android Nougat, a native night mode\nsolution was added to AOSP and it felt like livedisplay was still way superior, thanks to its various options (you could say it spoiled me, sure). I also maintained a kernel (Venom\nkernel) for the device I was using at that time. It was all good until the OEM dropped support for the device at Android M, and XDA being XDA, was already working on N ROMs. The issue\nwas, these ROMs weren't LineageOS or based on it, so livedisplay was... gone. I decided I'll try to bring that feature to every other ROM. How would I do that? Of course! The kernel! It\nworked on every single ROM, it was the key! I started to work on it ASAP and here it is, up on GitHub, licensed under GPL (check klapse.c), open to everyone :)\n\nHow does it work?\nThink of it like a fancy night mode, but not really. Klapse is dependent on an RGB interface (like Gamma on MTK and KCAL on SD chipsets). It fetches time from the kernel, converts it to\nlocal time, and selects and RGB set based on the time. The result is really smooth shifting of RGB over time.\n\nHow does it really work (dev)?\nKlapse mode 1 (time-based scaling) uses a method void klapse_pulse(void) that should ideally be called every minute. This can be done by injecting a pulse call inside another method that\nis called repeatedly naturally, like cpufreq or atomic or frame commits. It can be anything, whatever you like, even a kthread, as long as it is called repeatedly naturally. To execute\nevery 60 seconds, use jiffies or ktime, or any similar method. The pulse function fetches the current time and makes calculations based on the current hour and the values of the tunables\nlisted down below.\n\nKlapse mode 2 (brightness-based scaling) uses a method void set_rgb_slider(<type> bl_lvl) where is the data type of the brightness level used in your kernel source. (OnePlus 6 uses u32\ndata type for bl_lvl) set_rgb_slider needs to be called/injected inside a function that sets brightness for your device. (OnePlus 6 uses dsi_panel.c for that, check out the diff for that\nfile in /op6)\n\nWhat all stuff can it do?\n\n1, Emulate night mode with the proper RGB settings\n2, Smoothly scale from one set of RGB to another set of RGB in integral intervals over time.\n3, Reduce perceived brightness using brightness_factor by reducing the amount of color on screen. Allows lower apparent brightness than system permits.\n4, Scale RGB based on brightness of display (low brightness usually implies a dark environment, where yellowness is probably useful).\n5, Automate the perceived brightness independent of whether klapse is enabled, using its own set of start and stop hours.\n6, Be more efficient,faster by residing inside the kernel instead of having to use the HWC HAL like android's night mode.\n7, (On older devices) Reduce stuttering or frame lags caused by native night mode.\n8, An easier solution against overlay-based apps that run as service in userspace/Android and sometimes block apps asking for permissions.\n9, Give you a Livedisplay alternative if it doesn't work in your ROM.\n10, Impress your crush so you can get a date (Hey, don't forget to credit me if it works).\n\nAlright, so this is a replacement for night mode?\nNO! Not at all. One can say this is merely an alternative for LineageOS' Livedisplay, but inside a kernel. Night mode is a sub-function of both Livedisplay and KLapse. Most comparisons\nhere were made with night mode because that's what an average user uses, and will relate to the most. There is absolutely no reason for your Android kernel to not have KLapse. Go ahead\nand add it or ask your kernel maintainer to. It's super-easy!\n\nWhat can it NOT do (yet)?\n\n1, Calculate scaling to the level of minutes, like \"Start from 5:37pm till 7:19am\". --TODO\n2, Make coffee for you.\n3, Fly you to the moon. Without a heavy suit.\n4, Get you a monthly subscription of free food, cereal included.\n\nAll these following tunables are found in their respective files in /sys/klapse/\n\n1. enable_klapse : A switch to enable or disable klapse. Values : 0 = off, 1 = on (since v2.0, 2 = brightness-dependent mode)\n2. klapse_start_hour : The hour at which klapse should start scaling the RGB values from daytime to target (see next points). Values : 0-23\n3. klapse_stop_hour : The hour by which klapse should scale back the RGB values from target to daytime (see next points). Values : 0-23\n4. daytime_rgb : The RGB set that must be used for all the time outside of start and stop hour range.\n5. target_rgb : The RGB set that must be scaled towards for all the time inside of start and stop hour range.\n6. klapse_scaling_rate : Controls how soon the RGB reaches from daytime to target inside of start and stop hour range. Once target is reached, it remains constant till 30 minutes before\n   stop hour, where target RGB scales back to daytime RGB.\n7. brightness_factor : From the name itself, this value has the ability to bend perception and make your display appear as if it is at a lesser brightness level than it actually is at.\n   It works by reducing the RGB values by the same factor. Values : 2-10, (10 means accurate brightness, 5 means 50% of current brightness, you get it)\n8. brightness_factor_auto : A switch that allows you to automatically set the brightness factor in a set time range. Value : 0 = off, 1 = on\n9. brightness_factor_auto_start_hour : The hour at which brightness_factor should be applied. Works only if #8 is 1. Values : 0-23\n10. brightness_factor_auto_stop_hour : The hour at which brightness_factor should be reverted to 10. Works only if #8 is 1. Values : 0-23\n11. backlight_range : The brightness range within which klapse should scale from daytime to target_rgb. Works only if #1 is 2. Values : MIN_BRIGHTNESS-MAX_BRIGHTNESS\n\nSigned-off-by: Eliminater74 <eliminater74@gmail.com>\nSigned-off-by: engstk <eng.stk@sapo.pt>\nSigned-off-by: Nanda Oktavera <codeharuka.yusa@gmail.com>","distinct":true,"url":"https://api.github.com/repos/okitavera/linux-xiaomi-grus/commits/475debbecb00c196d7c1f49425398f24c564920c"},{"sha":"099eaa8e5d9788927a3ac2f3004fd03730192cfc","author":{"name":"tanish2k09","email":"10d9addef400646940f39989d9848de586394155@gmail.com"},"message":"KLAPSE v4.1 : Add more dynamicity\n\n- Reverted daytime and target rgb sets back to original split r,g,b sysfs nodes for easier interaction in kernel managers\n- Added more dynamicity by renewing a pulse after any relevant variable update from sysfs\n- Fixed a bug where changing brightness_factor would need a pulse to apply effect\n- Tweaked default pulse_freq and fadeback_minutes values\n- Optimised an if condition in klapse_pulse\n\nSigned-off-by: engstk <eng.stk@sapo.pt>\nSigned-off-by: Nanda Oktavera <codeharuka.yusa@gmail.com>","distinct":true,"url":"https://api.github.com/repos/okitavera/linux-xiaomi-grus/commits/099eaa8e5d9788927a3ac2f3004fd03730192cfc"},{"sha":"dbe8613157eedc4f700a29aeb3402d6b54d5e04b","author":{"name":"tanish2k09","email":"10d9addef400646940f39989d9848de586394155@gmail.com"},"message":"KLAPSE : Update tmp sysfs vars to be same type as read from buffer, and the actual tunable itself\n\nSigned-off-by: engstk <eng.stk@sapo.pt>\nSigned-off-by: Nanda Oktavera <codeharuka.yusa@gmail.com>","distinct":true,"url":"https://api.github.com/repos/okitavera/linux-xiaomi-grus/commits/dbe8613157eedc4f700a29aeb3402d6b54d5e04b"},{"sha":"6afb779c14e91ab8c16242072a1fd6a46bde0261","author":{"name":"tanish2k09","email":"10d9addef400646940f39989d9848de586394155@gmail.com"},"message":"KLAPSE : Allow RGB to be same value as SCALE_VAL_MIN\n\nSigned-off-by: engstk <eng.stk@sapo.pt>\nSigned-off-by: Nanda Oktavera <codeharuka.yusa@gmail.com>","distinct":true,"url":"https://api.github.com/repos/okitavera/linux-xiaomi-grus/commits/6afb779c14e91ab8c16242072a1fd6a46bde0261"},{"sha":"8b628ed84b32add8f64de73706c443c6669dc98b","author":{"name":"tanish2k09","email":"10d9addef400646940f39989d9848de586394155@gmail.com"},"message":"KLAPSE : Allow fadeback_minutes to be greater than 0 instead of 2\n\nSigned-off-by: engstk <eng.stk@sapo.pt>\nSigned-off-by: Nanda Oktavera <codeharuka.yusa@gmail.com>","distinct":true,"url":"https://api.github.com/repos/okitavera/linux-xiaomi-grus/commits/8b628ed84b32add8f64de73706c443c6669dc98b"},{"sha":"a69bb7572b507976d01bd55e5493f278e681a438","author":{"name":"tanish2k09","email":"10d9addef400646940f39989d9848de586394155@gmail.com"},"message":"KLAPSE v4.2\n\n- Modify klapse_scaling_rate to use a minute value instead of a numeric factor, now more intuitive. Suggestion credit to @flar2\n- Fix an issue with brightness_factor where increasing the value would dim the colors further until the next pulse. (brightness_factor without pulse fixes it at the cost of a maximum error of 1 RGB value)\n\nSigned-off-by: engstk <eng.stk@sapo.pt>\nSigned-off-by: Nanda Oktavera <codeharuka.yusa@gmail.com>","distinct":true,"url":"https://api.github.com/repos/okitavera/linux-xiaomi-grus/commits/a69bb7572b507976d01bd55e5493f278e681a438"},{"sha":"b9d57506d138bbbd5185c1bc4517c4df8004899e","author":{"name":"tanish2k09","email":"10d9addef400646940f39989d9848de586394155@gmail.com"},"message":"KLAPSE : Fix compilation error, undeclared variable\n\nSigned-off-by: engstk <eng.stk@sapo.pt>\nSigned-off-by: Nanda Oktavera <codeharuka.yusa@gmail.com>","distinct":true,"url":"https://api.github.com/repos/okitavera/linux-xiaomi-grus/commits/b9d57506d138bbbd5185c1bc4517c4df8004899e"},{"sha":"e0cbd483be7470c476d67dc24eba27cfa4a33447","author":{"name":"tanish2k09","email":"10d9addef400646940f39989d9848de586394155@gmail.com"},"message":"KLAPSE v4.3 : Bug fixes and thread-safe improvements\n\n- Fixed the issue where brightness_factor_auto_enable would keep decreasing brightness on repeated switching, thanks to @flar2 for reporting\n- Fixed the issue with fadeback_minutes not taking into account enable_klapse\n- Made pretty much all tunables more thread-safe parallel to the kernel-timer by using flush and pulse where applicable\n\nSigned-off-by: engstk <eng.stk@sapo.pt>\nSigned-off-by: Nanda Oktavera <codeharuka.yusa@gmail.com>","distinct":true,"url":"https://api.github.com/repos/okitavera/linux-xiaomi-grus/commits/e0cbd483be7470c476d67dc24eba27cfa4a33447"},{"sha":"d586fe6d5e9ff2e84b2d3b022e87d5597c30d817","author":{"name":"flar2","email":"50cb9bee76fd6567c3233b8a89e4a594c545792f@gmail.com"},"message":"KLAPSE: Modernize sysfs to prevent CFI failure\n\nSigned-off-by: engstk <eng.stk@sapo.pt>\nSigned-off-by: Nanda Oktavera <codeharuka.yusa@gmail.com>","distinct":true,"url":"https://api.github.com/repos/okitavera/linux-xiaomi-grus/commits/d586fe6d5e9ff2e84b2d3b022e87d5597c30d817"},{"sha":"13299e3acd1421e462bbbc30903960d4b5835a6e","author":{"name":"tanish2k09","email":"10d9addef400646940f39989d9848de586394155@gmail.com"},"message":"KLAPSE : Refactor defines\n\nSigned-off-by: engstk <eng.stk@sapo.pt>\nSigned-off-by: Nanda Oktavera <codeharuka.yusa@gmail.com>","distinct":true,"url":"https://api.github.com/repos/okitavera/linux-xiaomi-grus/commits/13299e3acd1421e462bbbc30903960d4b5835a6e"},{"sha":"60f0645b55071172d44abc700e3b31a0eda58ce0","author":{"name":"tanish2k09","email":"10d9addef400646940f39989d9848de586394155@gmail.com"},"message":"K-lapse v5.0 :\n\n- Introducing k-lapse \"flow\", a brightness-based scaling mode QOL enhancement that scales RGB points by 1 smoothly instant of instantly taking effect\n- Major code refactor to better match the Linux Kernel coding style (huge thanks to kdrag0n for initial overall patch and general guidance)\n- Switched from SYS ATTR to module_param_cb and kernel param structs\n- Shortened the code from 1k lines to 0.6k without compromising any logic or feature\n- Changed tunable naming for sysfs to convey the idea of the function in a better way\n- Added minute-level support for automation. Yes, you can now start or stop at, say 16:49\n- Dimmer factor (previously known as brightness_factor) is now allowed to be set as a percentage value, ranging from 10 to 100\n- Updated README documentation to match v5.0 release\n- Integrated MDSS code with a switch in klapse.h (see kcal-mdss-demo branch for full implementation in older version)\n- Changed some default config values\n- Revised dimmer logic to fix \"dimmer value multiplicative effect\" for some users. The issue was changing brightness_factor values multiple times stacked them on top of each other, eventually causing the RGB to hit their minimum limit (usually 20 in KCAL), and not being able to restore full RGB without a pulse\n- (self tag for notification?) @tanish2k09\n\nSigned-off-by: engstk <eng.stk@sapo.pt>\nSigned-off-by: Nanda Oktavera <codeharuka.yusa@gmail.com>","distinct":true,"url":"https://api.github.com/repos/okitavera/linux-xiaomi-grus/commits/60f0645b55071172d44abc700e3b31a0eda58ce0"},{"sha":"7a780776d64ed5218e2d5ce41b754fe98db69a18","author":{"name":"engstk","email":"7c824bbbc38994ca63b791ce9f3dd6d22c18e8ad@sapo.pt"},"message":"KLAPSE: change path to build with new v5.0\n\nSigned-off-by: engstk <eng.stk@sapo.pt>\nSigned-off-by: Nanda Oktavera <codeharuka.yusa@gmail.com>","distinct":true,"url":"https://api.github.com/repos/okitavera/linux-xiaomi-grus/commits/7a780776d64ed5218e2d5ce41b754fe98db69a18"},{"sha":"02a5ae80910ac20e033931b20a7b4a3174324d44","author":{"name":"Nanda Oktavera","email":"d666270025c096cf3e306ac7ecb907c7481d1dc2@gmail.com"},"message":"defconfig: grus: enable K-lapse\n\nSigned-off-by: Nanda Oktavera <codeharuka.yusa@gmail.com>","distinct":true,"url":"https://api.github.com/repos/okitavera/linux-xiaomi-grus/commits/02a5ae80910ac20e033931b20a7b4a3174324d44"}]}
{"actor":{"display_login":"okitavera"}}