Compare commits
100 Commits
Author | SHA1 | Date | |
---|---|---|---|
150ff1420d | |||
0086aaa705 | |||
a9c2bbd947 | |||
|
b04ee84468 | ||
|
e0e4fab3e9 | ||
|
3a479a45d8 | ||
|
40fa3144c4 | ||
|
727b576154 | ||
|
f228835581 | ||
|
7377130b67 | ||
4e89828fe6 | |||
b312871354 | |||
99d43bd6f2 | |||
1306e2a66e | |||
3d63dc26a3 | |||
26ec5eff64 | |||
f65cfa4585 | |||
fa8b9120d2 | |||
3d2b2725d3 | |||
1f88b2fc25 | |||
8580833649 | |||
03a3f1ae51 | |||
ce8bc2024e | |||
463145fd97 | |||
2e79984ef1 | |||
0299c8b1ea | |||
|
dc067eaadb | ||
c9379765ae | |||
2fd49cc475 | |||
4d54435985 | |||
71c1b13c3b | |||
|
08d40ea432 | ||
|
6066bc4fb2 | ||
|
169be065dc | ||
|
7ec6356373 | ||
|
78c47f0a09 | ||
|
c2762bc519 | ||
|
a1bf107ddc | ||
|
f7701af36c | ||
99aec1aac0 | |||
4ca8231a39 | |||
0098258fb6 | |||
0a58162bad | |||
761475e029 | |||
4e54307971 | |||
2320adf1c3 | |||
e837bf13af | |||
0d91ae66d1 | |||
ac1b61d8bd | |||
60dc452fb5 | |||
9ec4cbb0e4 | |||
6e71e0f1db | |||
88eaaf7a8a | |||
c2d82bf955 | |||
6dc67ea0fa | |||
e1489c7f35 | |||
c411cdebcc | |||
98b9aff1e7 | |||
7ebf74a1d6 | |||
6ec49865ea | |||
72cbaaa285 | |||
aa7d9d711d | |||
8d2dce6509 | |||
db5f561c54 | |||
81d49a418d | |||
e027961441 | |||
ddc3f2ba15 | |||
7f0d92efa7 | |||
a637c27596 | |||
4b7accafbf | |||
3ad8571d9c | |||
5ff12f2678 | |||
ded36eca1d | |||
e340252341 | |||
942d73248c | |||
fbcd8aed5a | |||
9bf66f764f | |||
f2b5283ae1 | |||
0e7014ad1d | |||
b056089870 | |||
0233badc89 | |||
5e6115edc0 | |||
2b07df848b | |||
47f1d43f8d | |||
0ee463fa1b | |||
2f9cedee75 | |||
22e99d6027 | |||
|
8d7ed18c6a | ||
|
6de4509074 | ||
|
ab0f945581 | ||
|
1fc1972030 | ||
3e7036b67d | |||
c348d3c2ca | |||
d6524224bf | |||
2c2ab8c6ca | |||
ac04591315 | |||
5dd635f711 | |||
6e909a7554 | |||
e1fa14f72e | |||
ec972992a9 |
1
.github/build-canary-v3
vendored
Normal file
1
.github/build-canary-v3
vendored
Normal file
@ -0,0 +1 @@
|
||||
1
|
1
.github/build-nest-v3
vendored
Normal file
1
.github/build-nest-v3
vendored
Normal file
@ -0,0 +1 @@
|
||||
1
|
1
.github/release-canary-v3
vendored
Normal file
1
.github/release-canary-v3
vendored
Normal file
@ -0,0 +1 @@
|
||||
1
|
1
.github/release-nest-v3
vendored
Normal file
1
.github/release-nest-v3
vendored
Normal file
@ -0,0 +1 @@
|
||||
1
|
34
.github/workflows/build-canaryv3.yml
vendored
Normal file
34
.github/workflows/build-canaryv3.yml
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
name: PikaOS Package Build Only (Canary) (amd64-v3)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- '.github/build-canary-v3'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ghcr.io/pikaos-linux/pikaos-builder:canaryv3
|
||||
volumes:
|
||||
- /proc:/proc
|
||||
options: --privileged -it
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install SSH key
|
||||
uses: shimataro/ssh-key-action@v2
|
||||
with:
|
||||
key: ${{ secrets.SSH_KEY }}
|
||||
name: id_rsa
|
||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
||||
if_key_exists: replace
|
||||
|
||||
- name: Update APT Cache
|
||||
run: apt-get update -y
|
||||
|
||||
- name: Build Package
|
||||
run: ./main.sh
|
34
.github/workflows/build-nestv3.yml
vendored
Normal file
34
.github/workflows/build-nestv3.yml
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
name: PikaOS Package Build Only (amd64-v3)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- '.github/build-nest-v3'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ghcr.io/pikaos-linux/pikaos-builder:nestv3
|
||||
volumes:
|
||||
- /proc:/proc
|
||||
options: --privileged -it
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install SSH key
|
||||
uses: shimataro/ssh-key-action@v2
|
||||
with:
|
||||
key: ${{ secrets.SSH_KEY }}
|
||||
name: id_rsa
|
||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
||||
if_key_exists: replace
|
||||
|
||||
- name: Update APT Cache
|
||||
run: apt-get update -y
|
||||
|
||||
- name: Build Package
|
||||
run: ./main.sh
|
28
.github/workflows/build.yml
vendored
28
.github/workflows/build.yml
vendored
@ -1,28 +0,0 @@
|
||||
|
||||
name: PikaOS Kernel Build Only
|
||||
|
||||
on:
|
||||
workflow_dispatch
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: self-hosted
|
||||
container:
|
||||
image: ubuntu:latest
|
||||
volumes:
|
||||
- /proc:/proc
|
||||
options: --privileged -it
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install needed packages
|
||||
run: apt update && apt install bc bison build-essential ccache cpio fakeroot flex git kmod libelf-dev libncurses5-dev libssl-dev debhelper lz4 qtbase5-dev rsync schedtool wget zstd tar -y
|
||||
|
||||
- name: Build Kernel
|
||||
run: ./main.sh
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: PikaOS Kernel
|
||||
path: output/
|
37
.github/workflows/release-canaryv3.yml
vendored
Normal file
37
.github/workflows/release-canaryv3.yml
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
name: PikaOS Package Build & Release (Canary) (amd64-v3)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- '.github/release-canary-v3'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ghcr.io/pikaos-linux/pikaos-builder:canaryv3
|
||||
volumes:
|
||||
- /proc:/proc
|
||||
options: --privileged -it
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install SSH key
|
||||
uses: shimataro/ssh-key-action@v2
|
||||
with:
|
||||
key: ${{ secrets.SSH_KEY }}
|
||||
name: id_rsa
|
||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
||||
if_key_exists: replace
|
||||
|
||||
- name: Update APT Cache
|
||||
run: apt-get update -y
|
||||
|
||||
- name: Build Package
|
||||
run: ./main.sh
|
||||
|
||||
- name: Release Package
|
||||
run: ./release.sh
|
37
.github/workflows/release-nestv3.yml
vendored
Normal file
37
.github/workflows/release-nestv3.yml
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
name: PikaOS Package Build & Release (amd64-v3)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- '.github/release-nest-v3'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ghcr.io/pikaos-linux/pikaos-builder:nestv3
|
||||
volumes:
|
||||
- /proc:/proc
|
||||
options: --privileged -it
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install SSH key
|
||||
uses: shimataro/ssh-key-action@v2
|
||||
with:
|
||||
key: ${{ secrets.SSH_KEY }}
|
||||
name: id_rsa
|
||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
||||
if_key_exists: replace
|
||||
|
||||
- name: Update APT Cache
|
||||
run: apt-get update -y
|
||||
|
||||
- name: Build Package
|
||||
run: ./main.sh
|
||||
|
||||
- name: Release Package
|
||||
run: ./release.sh
|
40
.github/workflows/release.yml
vendored
40
.github/workflows/release.yml
vendored
@ -1,40 +0,0 @@
|
||||
name: PikaOS Kernel Build And Release
|
||||
|
||||
on:
|
||||
workflow_dispatch
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: self-hosted
|
||||
container:
|
||||
image: ubuntu:latest
|
||||
volumes:
|
||||
- /proc:/proc
|
||||
options: --privileged -it
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install needed packages
|
||||
run: apt update && apt install bc gpg gpg-agent bison build-essential ccache cpio fakeroot flex git kmod libelf-dev debhelper libncurses5-dev libssl-dev lz4 qtbase5-dev rsync schedtool wget zstd tar reprepro dpkg-sig -y
|
||||
|
||||
- name: Import GPG key
|
||||
id: import_gpg
|
||||
uses: crazy-max/ghaction-import-gpg@v5
|
||||
with:
|
||||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||
passphrase: ${{ secrets.PASSPHRASE }}
|
||||
|
||||
- name: Install SSH key
|
||||
uses: shimataro/ssh-key-action@v2
|
||||
with:
|
||||
key: ${{ secrets.SSH_KEY }}
|
||||
name: id_rsa
|
||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
||||
if_key_exists: replace
|
||||
|
||||
- name: Build Kernel
|
||||
run: ./main.sh
|
||||
|
||||
- name: Release Kernel
|
||||
run: ./scripts/release.sh
|
24
LICENSE.md
Normal file
24
LICENSE.md
Normal file
@ -0,0 +1,24 @@
|
||||
MIT License (With DPKG packaging compatibility)
|
||||
|
||||
Copyright (c) 2024 PikaOS
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
Notes:
|
||||
The files covered by this license are any files and directories in the root of this repository (including but not limited to: `main.sh`, `release.sh`, and `.github`), with the exception of the `debian` directory and its contents if `debian/copyright` exists, and declares any files or directories as a different LICENSE/COPYRIGHT.
|
5
main.sh
5
main.sh
@ -1,4 +1,7 @@
|
||||
#!/bin/bash
|
||||
#! /bin/bash
|
||||
|
||||
# Move the debs to output
|
||||
mkdir -p ./output
|
||||
|
||||
. ./scripts/source.sh
|
||||
. ../scripts/patch.sh
|
||||
|
@ -1,30 +0,0 @@
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
|
||||
mQENBGPJoigBCADZ8tDzkO2LlWIzXZLLyRLIaRnaNHG6P9xx0ABSFsqU+X+p9qDS
|
||||
eQW6SmeCN+PauqAHlzrJ7p3XZi07E+h69PEk5R5n7qhVECW35Y1sB9EfC2nqVRxd
|
||||
RcWtwQsipEHQmjvWIsD4hR5uhq62p7grSkQxv13SGLqyJkKIpkic2vZEgqubfZd4
|
||||
KLPFvaQZar6QWa3urfYnUZzc1TNkEYxghr/dQuCFSfYPM+yHT70MXrlPOgfslGgL
|
||||
YtoN1YauF04wzAg1RFfrWX2AdHE792fVHrkHRsvQg1Pvw4KjPnM6jX2V8W8n7C++
|
||||
yxpiMUU2h9FqBWfHrqNLWtKdn6+lgHUq2Oj3ABEBAAG0IWZlcnJlbyA8aGFyZGVy
|
||||
dGhhbmZpcmVAZ21haWwuY29tPokBTgQTAQoAOBYhBIvETfAmQkhf8fPMBKt4xg37
|
||||
WBYDBQJjyaIoAhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEKt4xg37WBYD
|
||||
4/oH/2LRW4FwLHCsWeJfRx5Z7BwKrGqWIF2VujkvEjlFOGYO7aN5HxeX/QKeN+Wy
|
||||
901hv4CO7T7aSye0qjaYz0I6ZUmr9CaINdXTH7fok3CXQYBfluaLiyxMPSm+Fe5o
|
||||
vfiUiSMZ488uaUkFSww/TEP8wi5H02yqGJcx3yB54OTsVb8eUHLPXno0T4tooWvX
|
||||
EOMUKkpj3tEylJoqL5d2iz2ZrkMdX9tVXOkKY3iJD2El0TPITrTIuRuurqzc4CWU
|
||||
laV7bmZ1Mq5r21S7ISOhhzvEMwsiWylIFXmXNPvbU7DC43uT3+nKhBca8VESzvmu
|
||||
r7zC6CcQAR5IVHMjd8weFfrnGXm5AQ0EY8miKAEIALnnC+U4gx0m0yLEVOHBoccb
|
||||
T7CvhmBYer2shxe5o7zUZ5V4y1iJdzSSJksbQkZH4+JDwi7Hp3/lqI2EsxQ9TR+A
|
||||
OdRvETfz88aK/e2vJ0j7Bt3Dr0u0mgoo9kSx6rLq1oH9Nha9ReOljmEfDtuINR86
|
||||
QGEd8PyvNDcUap+6QQa6/RBEDiH1zYBYtxv4rbuciKsh+e6r6C8TJb43nKr3YBGu
|
||||
/GE1aDlGaKvFgUOZmaapgoQVdpXcg7ZtTpI8sNKdnLVEChIKk35n52XfQDZPVvAt
|
||||
bsUIr77B4hi+GsjGli7ihr+JJEiHwOyCMZvV95ZWq2ThrXxRWA8mHqCLhz7oTV8A
|
||||
EQEAAYkBNgQYAQoAIBYhBIvETfAmQkhf8fPMBKt4xg37WBYDBQJjyaIoAhsMAAoJ
|
||||
EKt4xg37WBYDdwAIAI3yJwOa6P6wz3ddLt/4FTlCSnlJ8C904RDwtJEO/C/y9qZv
|
||||
yE0qitUi7mntzYE6G7SES3Zn6b9HhdTS9kQv6VUg75TjD/WGPVju5cB11mte95Z9
|
||||
6iW5u65kxpawxiTUhaO+O4RO6fZ29rZyCQDfa7ESudkVE/yktAA5umnAbGpgxGa6
|
||||
8egCGiZ0LKUqcHxMAsoUUhlOTk3LR4yS6nKE1Q8Dr6E7NYlrWcoGDSQzKvXLqf8e
|
||||
9eJLGckePwHDzhgO9LKGW3meTV6ldLehTsxm/ycHqXL7/wYjYy6ZXj/5Px3CGLPg
|
||||
DH9mVj8ERsz096eQA+53gmcTsNtq/FLWS2MhtCc=
|
||||
=+26V
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
@ -1,8 +0,0 @@
|
||||
Origin: ppa.pika-os.com
|
||||
Label: apt repository
|
||||
Codename: kinetic
|
||||
Architectures: source i386 amd64
|
||||
Components: main
|
||||
Description: pika-os kernel repo
|
||||
SignWith: AB78C60DFB581603
|
||||
Pull: kinetic
|
File diff suppressed because it is too large
Load Diff
@ -1,257 +0,0 @@
|
||||
From 498e88ae626be4f523063c8a7027b4b02eca31d2 Mon Sep 17 00:00:00 2001
|
||||
From: GloriousEggroll <gloriouseggroll@gmail.com>
|
||||
Date: Tue, 17 Jan 2023 12:08:46 -0700
|
||||
Subject: [PATCH] Allow to set custom USB pollrate for specific devices like
|
||||
so: usbcore.interrupt_interval_override=045e:00db:16,1bcf:0005:1
|
||||
|
||||
---
|
||||
.../admin-guide/kernel-parameters.txt | 8 +
|
||||
drivers/usb/core/config.c | 170 +++++++++++++++++-
|
||||
drivers/usb/core/usb.c | 1 +
|
||||
drivers/usb/core/usb.h | 1 +
|
||||
4 files changed, 179 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
|
||||
index dbd26fde4..c9b8b80af 100644
|
||||
--- a/Documentation/admin-guide/kernel-parameters.txt
|
||||
+++ b/Documentation/admin-guide/kernel-parameters.txt
|
||||
@@ -6552,6 +6552,14 @@
|
||||
delay after resetting its port);
|
||||
Example: quirks=0781:5580:bk,0a5c:5834:gij
|
||||
|
||||
+ usbcore.interrupt_interval_override=
|
||||
+ [USB] A list of USB devices for which a different polling
|
||||
+ interval than the default shall be used on all interrupt-type
|
||||
+ endpoints. The format is VendorID:ProductID:interval, with
|
||||
+ the vendor and product ids specified hexadecimally, and the
|
||||
+ interval decimally in milliseconds.
|
||||
+ Example: interrupt_interval_override=045e:00db:16,1bcf:0005:2
|
||||
+
|
||||
usbhid.mousepoll=
|
||||
[USBHID] The interval which mice are to be polled at.
|
||||
|
||||
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
|
||||
index 48bc8a481..84bd550ad 100644
|
||||
--- a/drivers/usb/core/config.c
|
||||
+++ b/drivers/usb/core/config.c
|
||||
@@ -19,6 +19,149 @@
|
||||
#define USB_MAXCONFIG 8 /* Arbitrary limit */
|
||||
|
||||
|
||||
+/* A struct associated with the interrupt_interval_override module parameter, representing
|
||||
+ an user's choice to force a specific interrupt interval upon all interrupt endpoints of
|
||||
+ a certain device. */
|
||||
+struct interrupt_interval_override {
|
||||
+ /* The vendor ID of the device of which the interrupt interval shall be overridden */
|
||||
+ u16 vendor;
|
||||
+ /* The product ID of the device of which the interrupt interval shall be overridden */
|
||||
+ u16 product;
|
||||
+ /* The new interval measured in milliseconds that shall be given to all endpoints of type interrupt on said device */
|
||||
+ unsigned int interval;
|
||||
+};
|
||||
+
|
||||
+static DEFINE_MUTEX(interrupt_interval_override_mutex);
|
||||
+static char interrupt_interval_override_param[128];
|
||||
+static struct interrupt_interval_override *interrupt_interval_override_list = NULL;
|
||||
+static size_t interrupt_interval_override_count = 0;
|
||||
+
|
||||
+static int interrupt_interval_override_param_set(const char *value, const struct kernel_param *kp)
|
||||
+{
|
||||
+ const char *p;
|
||||
+ unsigned short vendor, product;
|
||||
+ unsigned int interval;
|
||||
+ struct interrupt_interval_override* list;
|
||||
+ struct interrupt_interval_override param;
|
||||
+ size_t count, max_count, i, len;
|
||||
+ int err, res;
|
||||
+
|
||||
+ mutex_lock(&interrupt_interval_override_mutex);
|
||||
+
|
||||
+ if (!value || !*value) {
|
||||
+ /* Unset the current variable. */
|
||||
+ kfree(interrupt_interval_override_list);
|
||||
+ interrupt_interval_override_list = NULL;
|
||||
+ interrupt_interval_override_count = 0;
|
||||
+ param_set_copystring(value, kp); /* Does not fail: the empty string is short enough to fit. */
|
||||
+ mutex_unlock(&interrupt_interval_override_mutex);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ /* Compute an upper bound on the amount of entries we need. */
|
||||
+ for (max_count = 1, i = 0; value[i]; i++) {
|
||||
+ if (value[i] == ',')
|
||||
+ max_count++;
|
||||
+ }
|
||||
+
|
||||
+ /* Ensure we can allocate enough memory before overwriting the global variables. */
|
||||
+ list = kcalloc(max_count,
|
||||
+ sizeof(struct interrupt_interval_override),
|
||||
+ GFP_KERNEL);
|
||||
+
|
||||
+ if (!list) {
|
||||
+ mutex_unlock(&interrupt_interval_override_mutex);
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ err = param_set_copystring(value, kp);
|
||||
+ if (err) {
|
||||
+ kfree(list);
|
||||
+ mutex_unlock(&interrupt_interval_override_mutex);
|
||||
+ return err;
|
||||
+ }
|
||||
+
|
||||
+ /* Parse the parameter. Example of a valid parameter: 045e:00db:16,1bcf:0005:2 */
|
||||
+ for (count = 0, p = (const char*)value; p && *p;) {
|
||||
+ res = sscanf(p, "%hx:%hx:%d%zn", &vendor, &product, &interval, &len);
|
||||
+
|
||||
+ /* Check whether all variables (vendor, product, interval, len) were assigned.
|
||||
+ %zn does not increase the assignment count, so we need to check for value 3 instead of 4.
|
||||
+ %zn does not consume input either, so setting len shouldn't fail if interval has been properly set. */
|
||||
+ if (res != 3) {
|
||||
+ pr_warn("Error while parsing USB interrupt interval override parameter %s.\n", value);
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ param.vendor = (u16)vendor;
|
||||
+ param.product = (u16)product;
|
||||
+ param.interval = interval;
|
||||
+ list[count++] = param;
|
||||
+
|
||||
+ p += len;
|
||||
+ if (*p == ',' && *(p+1) != '\0') {
|
||||
+ p++;
|
||||
+ continue;
|
||||
+ } else if(*p == '\0' || (*p == '\n' && *(p+1) == '\0')) {
|
||||
+ break;
|
||||
+ } else {
|
||||
+ pr_warn("Error while parsing USB interrupt interval override parameter %s.\n", value);
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* Overwrite the global variables with the local ones. */
|
||||
+ kfree(interrupt_interval_override_list);
|
||||
+ interrupt_interval_override_list = list;
|
||||
+ interrupt_interval_override_count = count;
|
||||
+ mutex_unlock(&interrupt_interval_override_mutex);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static const struct kernel_param_ops interrupt_interval_override_param_ops = {
|
||||
+ .set = interrupt_interval_override_param_set,
|
||||
+ .get = param_get_string,
|
||||
+};
|
||||
+
|
||||
+static struct kparam_string interrupt_interval_override_param_string = {
|
||||
+ .maxlen = sizeof(interrupt_interval_override_param),
|
||||
+ .string = interrupt_interval_override_param,
|
||||
+};
|
||||
+
|
||||
+device_param_cb(interrupt_interval_override,
|
||||
+ &interrupt_interval_override_param_ops,
|
||||
+ &interrupt_interval_override_param_string,
|
||||
+ 0644);
|
||||
+MODULE_PARM_DESC(interrupt_interval_override,
|
||||
+ "Override the polling interval of all interrupt-type endpoints of a specific USB"
|
||||
+ " device by specifying interrupt_interval_override=vendorID:productID:interval.");
|
||||
+
|
||||
+/* Given an USB device, this checks whether the user has specified they want to override the interrupt
|
||||
+ polling interval on all interrupt-type endpoints of said device.
|
||||
+
|
||||
+ This function returns the user-desired amount of milliseconds between interrupts on said endpoint.
|
||||
+ If this function returns zero, the device-requested interrupt interval should be used. */
|
||||
+static unsigned int usb_check_interrupt_interval_override(struct usb_device* udev)
|
||||
+{
|
||||
+ size_t i;
|
||||
+ unsigned int res;
|
||||
+ u16 vendor = le16_to_cpu(udev->descriptor.idVendor);
|
||||
+ u16 product = le16_to_cpu(udev->descriptor.idProduct);
|
||||
+
|
||||
+ mutex_lock(&interrupt_interval_override_mutex);
|
||||
+ for (i = 0; i < interrupt_interval_override_count; i++) {
|
||||
+ if (interrupt_interval_override_list[i].vendor == vendor
|
||||
+ && interrupt_interval_override_list[i].product == product) {
|
||||
+
|
||||
+ res = interrupt_interval_override_list[i].interval;
|
||||
+ mutex_unlock(&interrupt_interval_override_mutex);
|
||||
+ return res;
|
||||
+ }
|
||||
+ }
|
||||
+ mutex_unlock(&interrupt_interval_override_mutex);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static inline const char *plural(int n)
|
||||
{
|
||||
return (n == 1 ? "" : "s");
|
||||
@@ -261,7 +404,7 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno,
|
||||
struct usb_endpoint_descriptor *d;
|
||||
struct usb_host_endpoint *endpoint;
|
||||
int n, i, j, retval;
|
||||
- unsigned int maxp;
|
||||
+ unsigned int maxp, ival;
|
||||
const unsigned short *maxpacket_maxes;
|
||||
|
||||
d = (struct usb_endpoint_descriptor *) buffer;
|
||||
@@ -386,6 +529,23 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno,
|
||||
endpoint->desc.bInterval = n;
|
||||
}
|
||||
|
||||
+ /* Override the interrupt polling interval if a module parameter tells us to do so. */
|
||||
+ if (usb_endpoint_xfer_int(d)) {
|
||||
+ ival = usb_check_interrupt_interval_override(udev);
|
||||
+ if (ival > 0) {
|
||||
+ switch (udev->speed) {
|
||||
+ case USB_SPEED_SUPER_PLUS:
|
||||
+ case USB_SPEED_SUPER:
|
||||
+ case USB_SPEED_HIGH:
|
||||
+ endpoint->desc.bInterval = fls(ival) + 3;
|
||||
+ break;
|
||||
+ default: /* USB_SPEED_FULL or _LOW */
|
||||
+ endpoint->desc.bInterval = ival;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
/* Some buggy low-speed devices have Bulk endpoints, which is
|
||||
* explicitly forbidden by the USB spec. In an attempt to make
|
||||
* them usable, we will try treating them as Interrupt endpoints.
|
||||
@@ -1092,3 +1252,11 @@ int usb_get_bos_descriptor(struct usb_device *dev)
|
||||
usb_release_bos_descriptor(dev);
|
||||
return ret;
|
||||
}
|
||||
+
|
||||
+void usb_release_interrupt_interval_override_list(void)
|
||||
+{
|
||||
+ mutex_lock(&interrupt_interval_override_mutex);
|
||||
+ kfree(interrupt_interval_override_list);
|
||||
+ interrupt_interval_override_list = NULL;
|
||||
+ mutex_unlock(&interrupt_interval_override_mutex);
|
||||
+}
|
||||
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
|
||||
index 11b15d7b3..ec52c6322 100644
|
||||
--- a/drivers/usb/core/usb.c
|
||||
+++ b/drivers/usb/core/usb.c
|
||||
@@ -1066,6 +1066,7 @@ static void __exit usb_exit(void)
|
||||
return;
|
||||
|
||||
usb_release_quirk_list();
|
||||
+ usb_release_interrupt_interval_override_list();
|
||||
usb_deregister_device_driver(&usb_generic_driver);
|
||||
usb_major_cleanup();
|
||||
usb_deregister(&usbfs_driver);
|
||||
diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h
|
||||
index 82538daac..b6faa897c 100644
|
||||
--- a/drivers/usb/core/usb.h
|
||||
+++ b/drivers/usb/core/usb.h
|
||||
@@ -37,6 +37,7 @@ extern void usb_authorize_interface(struct usb_interface *);
|
||||
extern void usb_detect_quirks(struct usb_device *udev);
|
||||
extern void usb_detect_interface_quirks(struct usb_device *udev);
|
||||
extern void usb_release_quirk_list(void);
|
||||
+extern void usb_release_interrupt_interval_override_list(void);
|
||||
extern bool usb_endpoint_is_ignored(struct usb_device *udev,
|
||||
struct usb_host_interface *intf,
|
||||
struct usb_endpoint_descriptor *epd);
|
||||
--
|
||||
2.39.0
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,912 +0,0 @@
|
||||
From 9cab14aa7f6828572f808d1bea60def5f883522c Mon Sep 17 00:00:00 2001
|
||||
From: Peter Jung <admin@ptr1337.dev>
|
||||
Date: Sun, 22 Jan 2023 23:10:03 +0100
|
||||
Subject: [PATCH 08/16] hdr
|
||||
|
||||
Signed-off-by: Peter Jung <admin@ptr1337.dev>
|
||||
---
|
||||
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 110 ++++++++---
|
||||
.../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 57 ++++++
|
||||
.../gpu/drm/amd/display/dc/core/dc_resource.c | 100 ++++------
|
||||
drivers/gpu/drm/amd/display/dc/dc_stream.h | 2 +-
|
||||
drivers/gpu/drm/amd/display/dc/dc_types.h | 14 --
|
||||
drivers/gpu/drm/display/drm_hdmi_helper.c | 8 +-
|
||||
drivers/gpu/drm/drm_atomic.c | 2 +
|
||||
drivers/gpu/drm/drm_connector.c | 181 ++++++++++--------
|
||||
.../gpu/drm/i915/display/intel_connector.c | 4 +-
|
||||
drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +-
|
||||
include/drm/display/drm_dp.h | 2 +-
|
||||
include/drm/drm_connector.h | 57 +++---
|
||||
12 files changed, 327 insertions(+), 212 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
|
||||
index 93dee3d1a483..b5eb33a97590 100644
|
||||
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
|
||||
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
|
||||
@@ -5172,21 +5172,46 @@ get_aspect_ratio(const struct drm_display_mode *mode_in)
|
||||
}
|
||||
|
||||
static enum dc_color_space
|
||||
-get_output_color_space(const struct dc_crtc_timing *dc_crtc_timing)
|
||||
+get_output_color_space(const struct dc_crtc_timing *dc_crtc_timing,
|
||||
+ const struct drm_connector_state *connector_state)
|
||||
{
|
||||
enum dc_color_space color_space = COLOR_SPACE_SRGB;
|
||||
|
||||
- switch (dc_crtc_timing->pixel_encoding) {
|
||||
- case PIXEL_ENCODING_YCBCR422:
|
||||
- case PIXEL_ENCODING_YCBCR444:
|
||||
- case PIXEL_ENCODING_YCBCR420:
|
||||
- {
|
||||
+ switch (connector_state->colorspace) {
|
||||
+ case DRM_MODE_COLORIMETRY_BT601_YCC:
|
||||
+ if (dc_crtc_timing->flags.Y_ONLY)
|
||||
+ color_space = COLOR_SPACE_YCBCR601_LIMITED;
|
||||
+ else
|
||||
+ color_space = COLOR_SPACE_YCBCR601;
|
||||
+ break;
|
||||
+ case DRM_MODE_COLORIMETRY_BT709_YCC:
|
||||
+ if (dc_crtc_timing->flags.Y_ONLY)
|
||||
+ color_space = COLOR_SPACE_YCBCR709_LIMITED;
|
||||
+ else
|
||||
+ color_space = COLOR_SPACE_YCBCR709;
|
||||
+ break;
|
||||
+ case DRM_MODE_COLORIMETRY_OPRGB:
|
||||
+ color_space = COLOR_SPACE_ADOBERGB;
|
||||
+ break;
|
||||
+ case DRM_MODE_COLORIMETRY_BT2020_RGB:
|
||||
+ if (dc_crtc_timing->pixel_encoding == PIXEL_ENCODING_RGB)
|
||||
+ color_space = COLOR_SPACE_2020_RGB_FULLRANGE;
|
||||
+ else
|
||||
+ color_space = COLOR_SPACE_2020_YCBCR;
|
||||
+ break;
|
||||
+ case DRM_MODE_COLORIMETRY_BT2020_YCC:
|
||||
+ color_space = COLOR_SPACE_2020_YCBCR;
|
||||
+ break;
|
||||
+ case DRM_MODE_COLORIMETRY_DEFAULT: // ITU601
|
||||
+ default:
|
||||
+ if (dc_crtc_timing->pixel_encoding == PIXEL_ENCODING_RGB) {
|
||||
+ color_space = COLOR_SPACE_SRGB;
|
||||
/*
|
||||
* 27030khz is the separation point between HDTV and SDTV
|
||||
* according to HDMI spec, we use YCbCr709 and YCbCr601
|
||||
* respectively
|
||||
*/
|
||||
- if (dc_crtc_timing->pix_clk_100hz > 270300) {
|
||||
+ } else if (dc_crtc_timing->pix_clk_100hz > 270300) {
|
||||
if (dc_crtc_timing->flags.Y_ONLY)
|
||||
color_space =
|
||||
COLOR_SPACE_YCBCR709_LIMITED;
|
||||
@@ -5199,21 +5224,30 @@ get_output_color_space(const struct dc_crtc_timing *dc_crtc_timing)
|
||||
else
|
||||
color_space = COLOR_SPACE_YCBCR601;
|
||||
}
|
||||
-
|
||||
- }
|
||||
- break;
|
||||
- case PIXEL_ENCODING_RGB:
|
||||
- color_space = COLOR_SPACE_SRGB;
|
||||
- break;
|
||||
-
|
||||
- default:
|
||||
- WARN_ON(1);
|
||||
break;
|
||||
}
|
||||
|
||||
return color_space;
|
||||
}
|
||||
|
||||
+static enum display_content_type
|
||||
+get_output_content_type(const struct drm_connector_state *connector_state)
|
||||
+{
|
||||
+ switch (connector_state->content_type) {
|
||||
+ default:
|
||||
+ case DRM_MODE_CONTENT_TYPE_NO_DATA:
|
||||
+ return DISPLAY_CONTENT_TYPE_NO_DATA;
|
||||
+ case DRM_MODE_CONTENT_TYPE_GRAPHICS:
|
||||
+ return DISPLAY_CONTENT_TYPE_GRAPHICS;
|
||||
+ case DRM_MODE_CONTENT_TYPE_PHOTO:
|
||||
+ return DISPLAY_CONTENT_TYPE_PHOTO;
|
||||
+ case DRM_MODE_CONTENT_TYPE_CINEMA:
|
||||
+ return DISPLAY_CONTENT_TYPE_CINEMA;
|
||||
+ case DRM_MODE_CONTENT_TYPE_GAME:
|
||||
+ return DISPLAY_CONTENT_TYPE_GAME;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static bool adjust_colour_depth_from_display_info(
|
||||
struct dc_crtc_timing *timing_out,
|
||||
const struct drm_display_info *info)
|
||||
@@ -5307,6 +5341,7 @@ static void fill_stream_properties_from_drm_display_mode(
|
||||
if (stream->signal == SIGNAL_TYPE_HDMI_TYPE_A) {
|
||||
drm_hdmi_avi_infoframe_from_display_mode(&avi_frame, (struct drm_connector *)connector, mode_in);
|
||||
timing_out->vic = avi_frame.video_code;
|
||||
+ drm_hdmi_avi_infoframe_colorimetry(&avi_frame, connector_state);
|
||||
drm_hdmi_vendor_infoframe_from_display_mode(&hv_frame, (struct drm_connector *)connector, mode_in);
|
||||
timing_out->hdmi_vic = hv_frame.vic;
|
||||
}
|
||||
@@ -5346,7 +5381,8 @@ static void fill_stream_properties_from_drm_display_mode(
|
||||
}
|
||||
}
|
||||
|
||||
- stream->output_color_space = get_output_color_space(timing_out);
|
||||
+ stream->output_color_space = get_output_color_space(timing_out, connector_state);
|
||||
+ stream->content_type = get_output_content_type(connector_state);
|
||||
}
|
||||
|
||||
static void fill_audio_info(struct audio_info *audio_info,
|
||||
@@ -5786,15 +5822,14 @@ create_stream_for_sink(struct amdgpu_dm_connector *aconnector,
|
||||
{
|
||||
struct drm_display_mode *preferred_mode = NULL;
|
||||
struct drm_connector *drm_connector;
|
||||
- const struct drm_connector_state *con_state =
|
||||
- dm_state ? &dm_state->base : NULL;
|
||||
+ const struct drm_connector_state *con_state = &dm_state->base;
|
||||
struct dc_stream_state *stream = NULL;
|
||||
struct drm_display_mode mode;
|
||||
struct drm_display_mode saved_mode;
|
||||
struct drm_display_mode *freesync_mode = NULL;
|
||||
bool native_mode_found = false;
|
||||
bool recalculate_timing = false;
|
||||
- bool scale = dm_state ? (dm_state->scaling != RMX_OFF) : false;
|
||||
+ bool scale = dm_state->scaling != RMX_OFF;
|
||||
int mode_refresh;
|
||||
int preferred_refresh = 0;
|
||||
enum color_transfer_func tf = TRANSFER_FUNC_UNKNOWN;
|
||||
@@ -5875,7 +5910,7 @@ create_stream_for_sink(struct amdgpu_dm_connector *aconnector,
|
||||
|
||||
if (recalculate_timing)
|
||||
drm_mode_set_crtcinfo(&saved_mode, 0);
|
||||
- else if (!dm_state)
|
||||
+ else
|
||||
drm_mode_set_crtcinfo(&mode, 0);
|
||||
|
||||
/*
|
||||
@@ -6404,7 +6439,9 @@ enum drm_mode_status amdgpu_dm_connector_mode_valid(struct drm_connector *connec
|
||||
goto fail;
|
||||
}
|
||||
|
||||
- stream = create_validate_stream_for_sink(aconnector, mode, NULL, NULL);
|
||||
+ stream = create_validate_stream_for_sink(aconnector, mode,
|
||||
+ to_dm_connector_state(connector->state),
|
||||
+ NULL);
|
||||
if (stream) {
|
||||
dc_stream_release(stream);
|
||||
result = MODE_OK;
|
||||
@@ -6498,6 +6535,14 @@ amdgpu_dm_connector_atomic_check(struct drm_connector *conn,
|
||||
if (!crtc)
|
||||
return 0;
|
||||
|
||||
+ if (new_con_state->colorspace != old_con_state->colorspace) {
|
||||
+ new_crtc_state = drm_atomic_get_crtc_state(state, crtc);
|
||||
+ if (IS_ERR(new_crtc_state))
|
||||
+ return PTR_ERR(new_crtc_state);
|
||||
+
|
||||
+ new_crtc_state->mode_changed = true;
|
||||
+ }
|
||||
+
|
||||
if (!drm_connector_atomic_hdr_metadata_equal(old_con_state, new_con_state)) {
|
||||
struct dc_info_packet hdr_infopacket;
|
||||
|
||||
@@ -6520,7 +6565,7 @@ amdgpu_dm_connector_atomic_check(struct drm_connector *conn,
|
||||
* set is permissible, however. So only force a
|
||||
* modeset if we're entering or exiting HDR.
|
||||
*/
|
||||
- new_crtc_state->mode_changed =
|
||||
+ new_crtc_state->mode_changed = new_crtc_state->mode_changed ||
|
||||
!old_con_state->hdr_output_metadata ||
|
||||
!new_con_state->hdr_output_metadata;
|
||||
}
|
||||
@@ -7041,6 +7086,12 @@ static int amdgpu_dm_connector_get_modes(struct drm_connector *connector)
|
||||
return amdgpu_dm_connector->num_modes;
|
||||
}
|
||||
|
||||
+static const u32 supported_colorspaces =
|
||||
+ BIT(DRM_MODE_COLORIMETRY_BT709_YCC) |
|
||||
+ BIT(DRM_MODE_COLORIMETRY_OPRGB) |
|
||||
+ BIT(DRM_MODE_COLORIMETRY_BT2020_RGB) |
|
||||
+ BIT(DRM_MODE_COLORIMETRY_BT2020_YCC);
|
||||
+
|
||||
void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm,
|
||||
struct amdgpu_dm_connector *aconnector,
|
||||
int connector_type,
|
||||
@@ -7109,7 +7160,7 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm,
|
||||
drm_connector_attach_max_bpc_property(&aconnector->base, 8, 16);
|
||||
|
||||
/* This defaults to the max in the range, but we want 8bpc for non-edp. */
|
||||
- aconnector->base.state->max_bpc = (connector_type == DRM_MODE_CONNECTOR_eDP) ? 16 : 8;
|
||||
+ aconnector->base.state->max_bpc = 16;
|
||||
aconnector->base.state->max_requested_bpc = aconnector->base.state->max_bpc;
|
||||
|
||||
if (connector_type == DRM_MODE_CONNECTOR_eDP &&
|
||||
@@ -7118,6 +7169,17 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm,
|
||||
adev->mode_info.abm_level_property, 0);
|
||||
}
|
||||
|
||||
+ drm_connector_attach_content_type_property(&aconnector->base);
|
||||
+
|
||||
+ if (connector_type == DRM_MODE_CONNECTOR_HDMIA) {
|
||||
+ if (!drm_mode_create_hdmi_colorspace_property(&aconnector->base, supported_colorspaces))
|
||||
+ drm_connector_attach_colorspace_property(&aconnector->base);
|
||||
+ } else if (connector_type == DRM_MODE_CONNECTOR_DisplayPort ||
|
||||
+ connector_type == DRM_MODE_CONNECTOR_eDP) {
|
||||
+ if (!drm_mode_create_dp_colorspace_property(&aconnector->base, supported_colorspaces))
|
||||
+ drm_connector_attach_colorspace_property(&aconnector->base);
|
||||
+ }
|
||||
+
|
||||
if (connector_type == DRM_MODE_CONNECTOR_HDMIA ||
|
||||
connector_type == DRM_MODE_CONNECTOR_DisplayPort ||
|
||||
connector_type == DRM_MODE_CONNECTOR_eDP) {
|
||||
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
|
||||
index 461037a3dd75..d95d1c9f4805 100644
|
||||
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
|
||||
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
|
||||
@@ -935,6 +935,61 @@ static int amdgpu_current_bpc_show(struct seq_file *m, void *data)
|
||||
}
|
||||
DEFINE_SHOW_ATTRIBUTE(amdgpu_current_bpc);
|
||||
|
||||
+/*
|
||||
+ * Returns the current bpc for the crtc.
|
||||
+ * Example usage: cat /sys/kernel/debug/dri/0/crtc-0/amdgpu_current_colorspace
|
||||
+ */
|
||||
+static int amdgpu_current_colorspace_show(struct seq_file *m, void *data)
|
||||
+{
|
||||
+ struct drm_crtc *crtc = m->private;
|
||||
+ struct drm_device *dev = crtc->dev;
|
||||
+ struct dm_crtc_state *dm_crtc_state = NULL;
|
||||
+ int res = -ENODEV;
|
||||
+
|
||||
+ mutex_lock(&dev->mode_config.mutex);
|
||||
+ drm_modeset_lock(&crtc->mutex, NULL);
|
||||
+ if (crtc->state == NULL)
|
||||
+ goto unlock;
|
||||
+
|
||||
+ dm_crtc_state = to_dm_crtc_state(crtc->state);
|
||||
+ if (dm_crtc_state->stream == NULL)
|
||||
+ goto unlock;
|
||||
+
|
||||
+ switch (dm_crtc_state->stream->output_color_space) {
|
||||
+ case COLOR_SPACE_SRGB:
|
||||
+ seq_printf(m, "RGB");
|
||||
+ break;
|
||||
+ case COLOR_SPACE_YCBCR601:
|
||||
+ case COLOR_SPACE_YCBCR601_LIMITED:
|
||||
+ seq_printf(m, "BT601_YCC");
|
||||
+ break;
|
||||
+ case COLOR_SPACE_YCBCR709:
|
||||
+ case COLOR_SPACE_YCBCR709_LIMITED:
|
||||
+ seq_printf(m, "BT709_YCC");
|
||||
+ break;
|
||||
+ case COLOR_SPACE_ADOBERGB:
|
||||
+ seq_printf(m, "opRGB");
|
||||
+ break;
|
||||
+ case COLOR_SPACE_2020_RGB_FULLRANGE:
|
||||
+ seq_printf(m, "BT2020_RGB");
|
||||
+ break;
|
||||
+ case COLOR_SPACE_2020_YCBCR:
|
||||
+ seq_printf(m, "BT2020_YCC");
|
||||
+ break;
|
||||
+ default:
|
||||
+ goto unlock;
|
||||
+ }
|
||||
+ res = 0;
|
||||
+
|
||||
+unlock:
|
||||
+ drm_modeset_unlock(&crtc->mutex);
|
||||
+ mutex_unlock(&dev->mode_config.mutex);
|
||||
+
|
||||
+ return res;
|
||||
+}
|
||||
+DEFINE_SHOW_ATTRIBUTE(amdgpu_current_colorspace);
|
||||
+
|
||||
+
|
||||
/*
|
||||
* Example usage:
|
||||
* Disable dsc passthrough, i.e.,: have dsc decoding at converver, not external RX
|
||||
@@ -3326,6 +3381,8 @@ void crtc_debugfs_init(struct drm_crtc *crtc)
|
||||
#endif
|
||||
debugfs_create_file("amdgpu_current_bpc", 0644, crtc->debugfs_entry,
|
||||
crtc, &amdgpu_current_bpc_fops);
|
||||
+ debugfs_create_file("amdgpu_current_colorspace", 0644, crtc->debugfs_entry,
|
||||
+ crtc, &amdgpu_current_colorspace_fops);
|
||||
}
|
||||
|
||||
/*
|
||||
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
|
||||
index da164685547d..e00fadf9d0ff 100644
|
||||
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
|
||||
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
|
||||
@@ -2943,14 +2943,9 @@ static void set_avi_info_frame(
|
||||
uint32_t pixel_encoding = 0;
|
||||
enum scanning_type scan_type = SCANNING_TYPE_NODATA;
|
||||
enum dc_aspect_ratio aspect = ASPECT_RATIO_NO_DATA;
|
||||
- bool itc = false;
|
||||
- uint8_t itc_value = 0;
|
||||
- uint8_t cn0_cn1 = 0;
|
||||
- unsigned int cn0_cn1_value = 0;
|
||||
uint8_t *check_sum = NULL;
|
||||
uint8_t byte_index = 0;
|
||||
union hdmi_info_packet hdmi_info;
|
||||
- union display_content_support support = {0};
|
||||
unsigned int vic = pipe_ctx->stream->timing.vic;
|
||||
unsigned int rid = pipe_ctx->stream->timing.rid;
|
||||
unsigned int fr_ind = pipe_ctx->stream->timing.fr_index;
|
||||
@@ -3010,23 +3005,32 @@ static void set_avi_info_frame(
|
||||
hdmi_info.bits.S0_S1 = scan_type;
|
||||
|
||||
/* C0, C1 : Colorimetry */
|
||||
- if (color_space == COLOR_SPACE_YCBCR709 ||
|
||||
- color_space == COLOR_SPACE_YCBCR709_LIMITED)
|
||||
+ switch (color_space) {
|
||||
+ case COLOR_SPACE_YCBCR709:
|
||||
+ case COLOR_SPACE_YCBCR709_LIMITED:
|
||||
hdmi_info.bits.C0_C1 = COLORIMETRY_ITU709;
|
||||
- else if (color_space == COLOR_SPACE_YCBCR601 ||
|
||||
- color_space == COLOR_SPACE_YCBCR601_LIMITED)
|
||||
+ break;
|
||||
+ case COLOR_SPACE_YCBCR601:
|
||||
+ case COLOR_SPACE_YCBCR601_LIMITED:
|
||||
hdmi_info.bits.C0_C1 = COLORIMETRY_ITU601;
|
||||
- else {
|
||||
- hdmi_info.bits.C0_C1 = COLORIMETRY_NO_DATA;
|
||||
- }
|
||||
- if (color_space == COLOR_SPACE_2020_RGB_FULLRANGE ||
|
||||
- color_space == COLOR_SPACE_2020_RGB_LIMITEDRANGE ||
|
||||
- color_space == COLOR_SPACE_2020_YCBCR) {
|
||||
+ break;
|
||||
+ case COLOR_SPACE_2020_RGB_FULLRANGE:
|
||||
+ case COLOR_SPACE_2020_RGB_LIMITEDRANGE:
|
||||
hdmi_info.bits.EC0_EC2 = COLORIMETRYEX_BT2020RGBYCBCR;
|
||||
hdmi_info.bits.C0_C1 = COLORIMETRY_EXTENDED;
|
||||
- } else if (color_space == COLOR_SPACE_ADOBERGB) {
|
||||
+ break;
|
||||
+ case COLOR_SPACE_2020_YCBCR:
|
||||
+ hdmi_info.bits.EC0_EC2 = COLORIMETRYEX_BT2020YCC;
|
||||
+ hdmi_info.bits.C0_C1 = COLORIMETRY_EXTENDED;
|
||||
+ break;
|
||||
+ case COLOR_SPACE_ADOBERGB:
|
||||
hdmi_info.bits.EC0_EC2 = COLORIMETRYEX_ADOBERGB;
|
||||
hdmi_info.bits.C0_C1 = COLORIMETRY_EXTENDED;
|
||||
+ break;
|
||||
+ case COLOR_SPACE_SRGB:
|
||||
+ default:
|
||||
+ hdmi_info.bits.C0_C1 = COLORIMETRY_NO_DATA;
|
||||
+ break;
|
||||
}
|
||||
|
||||
if (pixel_encoding && color_space == COLOR_SPACE_2020_YCBCR &&
|
||||
@@ -3054,49 +3058,27 @@ static void set_avi_info_frame(
|
||||
/* Active Format Aspect ratio - same as Picture Aspect Ratio. */
|
||||
hdmi_info.bits.R0_R3 = ACTIVE_FORMAT_ASPECT_RATIO_SAME_AS_PICTURE;
|
||||
|
||||
- /* TODO: un-hardcode cn0_cn1 and itc */
|
||||
-
|
||||
- cn0_cn1 = 0;
|
||||
- cn0_cn1_value = 0;
|
||||
-
|
||||
- itc = true;
|
||||
- itc_value = 1;
|
||||
-
|
||||
- support = stream->content_support;
|
||||
-
|
||||
- if (itc) {
|
||||
- if (!support.bits.valid_content_type) {
|
||||
- cn0_cn1_value = 0;
|
||||
- } else {
|
||||
- if (cn0_cn1 == DISPLAY_CONTENT_TYPE_GRAPHICS) {
|
||||
- if (support.bits.graphics_content == 1) {
|
||||
- cn0_cn1_value = 0;
|
||||
- }
|
||||
- } else if (cn0_cn1 == DISPLAY_CONTENT_TYPE_PHOTO) {
|
||||
- if (support.bits.photo_content == 1) {
|
||||
- cn0_cn1_value = 1;
|
||||
- } else {
|
||||
- cn0_cn1_value = 0;
|
||||
- itc_value = 0;
|
||||
- }
|
||||
- } else if (cn0_cn1 == DISPLAY_CONTENT_TYPE_CINEMA) {
|
||||
- if (support.bits.cinema_content == 1) {
|
||||
- cn0_cn1_value = 2;
|
||||
- } else {
|
||||
- cn0_cn1_value = 0;
|
||||
- itc_value = 0;
|
||||
- }
|
||||
- } else if (cn0_cn1 == DISPLAY_CONTENT_TYPE_GAME) {
|
||||
- if (support.bits.game_content == 1) {
|
||||
- cn0_cn1_value = 3;
|
||||
- } else {
|
||||
- cn0_cn1_value = 0;
|
||||
- itc_value = 0;
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
- hdmi_info.bits.CN0_CN1 = cn0_cn1_value;
|
||||
- hdmi_info.bits.ITC = itc_value;
|
||||
+ switch (stream->content_type) {
|
||||
+ case DISPLAY_CONTENT_TYPE_NO_DATA:
|
||||
+ hdmi_info.bits.CN0_CN1 = 0;
|
||||
+ hdmi_info.bits.ITC = 0;
|
||||
+ break;
|
||||
+ case DISPLAY_CONTENT_TYPE_GRAPHICS:
|
||||
+ hdmi_info.bits.CN0_CN1 = 0;
|
||||
+ hdmi_info.bits.ITC = 1;
|
||||
+ break;
|
||||
+ case DISPLAY_CONTENT_TYPE_PHOTO:
|
||||
+ hdmi_info.bits.CN0_CN1 = 1;
|
||||
+ hdmi_info.bits.ITC = 1;
|
||||
+ break;
|
||||
+ case DISPLAY_CONTENT_TYPE_CINEMA:
|
||||
+ hdmi_info.bits.CN0_CN1 = 2;
|
||||
+ hdmi_info.bits.ITC = 1;
|
||||
+ break;
|
||||
+ case DISPLAY_CONTENT_TYPE_GAME:
|
||||
+ hdmi_info.bits.CN0_CN1 = 3;
|
||||
+ hdmi_info.bits.ITC = 1;
|
||||
+ break;
|
||||
}
|
||||
|
||||
if (stream->qs_bit == 1) {
|
||||
diff --git a/drivers/gpu/drm/amd/display/dc/dc_stream.h b/drivers/gpu/drm/amd/display/dc/dc_stream.h
|
||||
index dfd3df1d2f7e..f78d49e33a6e 100644
|
||||
--- a/drivers/gpu/drm/amd/display/dc/dc_stream.h
|
||||
+++ b/drivers/gpu/drm/amd/display/dc/dc_stream.h
|
||||
@@ -182,7 +182,6 @@ struct dc_stream_state {
|
||||
*/
|
||||
struct link_encoder *link_enc;
|
||||
struct dc_panel_patch sink_patches;
|
||||
- union display_content_support content_support;
|
||||
struct dc_crtc_timing timing;
|
||||
struct dc_crtc_timing_adjust adjust;
|
||||
struct dc_info_packet vrr_infopacket;
|
||||
@@ -205,6 +204,7 @@ struct dc_stream_state {
|
||||
struct dc_csc_transform csc_color_matrix;
|
||||
|
||||
enum dc_color_space output_color_space;
|
||||
+ enum display_content_type content_type;
|
||||
enum dc_dither_option dither_option;
|
||||
|
||||
enum view_3d_format view_format;
|
||||
diff --git a/drivers/gpu/drm/amd/display/dc/dc_types.h b/drivers/gpu/drm/amd/display/dc/dc_types.h
|
||||
index dc78e2404b48..fdf58a2e3a75 100644
|
||||
--- a/drivers/gpu/drm/amd/display/dc/dc_types.h
|
||||
+++ b/drivers/gpu/drm/amd/display/dc/dc_types.h
|
||||
@@ -174,18 +174,6 @@ struct dc_edid {
|
||||
|
||||
#define AUDIO_INFO_DISPLAY_NAME_SIZE_IN_CHARS 20
|
||||
|
||||
-union display_content_support {
|
||||
- unsigned int raw;
|
||||
- struct {
|
||||
- unsigned int valid_content_type :1;
|
||||
- unsigned int game_content :1;
|
||||
- unsigned int cinema_content :1;
|
||||
- unsigned int photo_content :1;
|
||||
- unsigned int graphics_content :1;
|
||||
- unsigned int reserved :27;
|
||||
- } bits;
|
||||
-};
|
||||
-
|
||||
struct dc_panel_patch {
|
||||
unsigned int dppowerup_delay;
|
||||
unsigned int extra_t12_ms;
|
||||
@@ -218,8 +206,6 @@ struct dc_edid_caps {
|
||||
uint32_t audio_latency;
|
||||
uint32_t video_latency;
|
||||
|
||||
- union display_content_support content_support;
|
||||
-
|
||||
uint8_t qs_bit;
|
||||
uint8_t qy_bit;
|
||||
|
||||
diff --git a/drivers/gpu/drm/display/drm_hdmi_helper.c b/drivers/gpu/drm/display/drm_hdmi_helper.c
|
||||
index 0264abe55278..c1e6851b2606 100644
|
||||
--- a/drivers/gpu/drm/display/drm_hdmi_helper.c
|
||||
+++ b/drivers/gpu/drm/display/drm_hdmi_helper.c
|
||||
@@ -44,10 +44,8 @@ int drm_hdmi_infoframe_set_hdr_metadata(struct hdmi_drm_infoframe *frame,
|
||||
|
||||
/* Sink EOTF is Bit map while infoframe is absolute values */
|
||||
if (!is_eotf_supported(hdr_metadata->hdmi_metadata_type1.eotf,
|
||||
- connector->hdr_sink_metadata.hdmi_type1.eotf)) {
|
||||
- DRM_DEBUG_KMS("EOTF Not Supported\n");
|
||||
- return -EINVAL;
|
||||
- }
|
||||
+ connector->hdr_sink_metadata.hdmi_type1.eotf))
|
||||
+ DRM_DEBUG_KMS("Unknown EOTF %d\n", hdr_metadata->hdmi_metadata_type1.eotf);
|
||||
|
||||
err = hdmi_drm_infoframe_init(frame);
|
||||
if (err < 0)
|
||||
@@ -105,7 +103,7 @@ EXPORT_SYMBOL(drm_hdmi_infoframe_set_hdr_metadata);
|
||||
#define HDMI_COLORIMETRY_DCI_P3_RGB_THEATER (C(3) | EC(7) | ACE(1))
|
||||
|
||||
static const u32 hdmi_colorimetry_val[] = {
|
||||
- [DRM_MODE_COLORIMETRY_NO_DATA] = HDMI_COLORIMETRY_NO_DATA,
|
||||
+ [DRM_MODE_COLORIMETRY_DEFAULT] = HDMI_COLORIMETRY_NO_DATA,
|
||||
[DRM_MODE_COLORIMETRY_SMPTE_170M_YCC] = HDMI_COLORIMETRY_SMPTE_170M_YCC,
|
||||
[DRM_MODE_COLORIMETRY_BT709_YCC] = HDMI_COLORIMETRY_BT709_YCC,
|
||||
[DRM_MODE_COLORIMETRY_XVYCC_601] = HDMI_COLORIMETRY_XVYCC_601,
|
||||
diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
|
||||
index f197f59f6d99..d6d04c4ccfc0 100644
|
||||
--- a/drivers/gpu/drm/drm_atomic.c
|
||||
+++ b/drivers/gpu/drm/drm_atomic.c
|
||||
@@ -1070,6 +1070,8 @@ static void drm_atomic_connector_print_state(struct drm_printer *p,
|
||||
drm_printf(p, "connector[%u]: %s\n", connector->base.id, connector->name);
|
||||
drm_printf(p, "\tcrtc=%s\n", state->crtc ? state->crtc->name : "(null)");
|
||||
drm_printf(p, "\tself_refresh_aware=%d\n", state->self_refresh_aware);
|
||||
+ drm_printf(p, "\tmax_requested_bpc=%d\n", state->max_requested_bpc);
|
||||
+ drm_printf(p, "\tcolorspace=%s\n", drm_get_colorspace_name(state->colorspace));
|
||||
|
||||
if (connector->connector_type == DRM_MODE_CONNECTOR_WRITEBACK)
|
||||
if (state->writeback_job && state->writeback_job->fb)
|
||||
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
|
||||
index 547356e00341..e99d397cd228 100644
|
||||
--- a/drivers/gpu/drm/drm_connector.c
|
||||
+++ b/drivers/gpu/drm/drm_connector.c
|
||||
@@ -1016,64 +1016,72 @@ static const struct drm_prop_enum_list drm_dp_subconnector_enum_list[] = {
|
||||
DRM_ENUM_NAME_FN(drm_get_dp_subconnector_name,
|
||||
drm_dp_subconnector_enum_list)
|
||||
|
||||
-static const struct drm_prop_enum_list hdmi_colorspaces[] = {
|
||||
- /* For Default case, driver will set the colorspace */
|
||||
- { DRM_MODE_COLORIMETRY_DEFAULT, "Default" },
|
||||
- /* Standard Definition Colorimetry based on CEA 861 */
|
||||
- { DRM_MODE_COLORIMETRY_SMPTE_170M_YCC, "SMPTE_170M_YCC" },
|
||||
- { DRM_MODE_COLORIMETRY_BT709_YCC, "BT709_YCC" },
|
||||
- /* Standard Definition Colorimetry based on IEC 61966-2-4 */
|
||||
- { DRM_MODE_COLORIMETRY_XVYCC_601, "XVYCC_601" },
|
||||
- /* High Definition Colorimetry based on IEC 61966-2-4 */
|
||||
- { DRM_MODE_COLORIMETRY_XVYCC_709, "XVYCC_709" },
|
||||
- /* Colorimetry based on IEC 61966-2-1/Amendment 1 */
|
||||
- { DRM_MODE_COLORIMETRY_SYCC_601, "SYCC_601" },
|
||||
- /* Colorimetry based on IEC 61966-2-5 [33] */
|
||||
- { DRM_MODE_COLORIMETRY_OPYCC_601, "opYCC_601" },
|
||||
- /* Colorimetry based on IEC 61966-2-5 */
|
||||
- { DRM_MODE_COLORIMETRY_OPRGB, "opRGB" },
|
||||
- /* Colorimetry based on ITU-R BT.2020 */
|
||||
- { DRM_MODE_COLORIMETRY_BT2020_CYCC, "BT2020_CYCC" },
|
||||
- /* Colorimetry based on ITU-R BT.2020 */
|
||||
- { DRM_MODE_COLORIMETRY_BT2020_RGB, "BT2020_RGB" },
|
||||
- /* Colorimetry based on ITU-R BT.2020 */
|
||||
- { DRM_MODE_COLORIMETRY_BT2020_YCC, "BT2020_YCC" },
|
||||
- /* Added as part of Additional Colorimetry Extension in 861.G */
|
||||
- { DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65, "DCI-P3_RGB_D65" },
|
||||
- { DRM_MODE_COLORIMETRY_DCI_P3_RGB_THEATER, "DCI-P3_RGB_Theater" },
|
||||
+static const char * const colorspace_names[] = {
|
||||
+ [DRM_MODE_COLORIMETRY_DEFAULT] = "Default",
|
||||
+ [DRM_MODE_COLORIMETRY_SMPTE_170M_YCC] = "SMPTE_170M_YCC",
|
||||
+ [DRM_MODE_COLORIMETRY_BT709_YCC] = "BT709_YCC",
|
||||
+ [DRM_MODE_COLORIMETRY_XVYCC_601] = "XVYCC_601",
|
||||
+ [DRM_MODE_COLORIMETRY_XVYCC_709] = "XVYCC_709",
|
||||
+ [DRM_MODE_COLORIMETRY_SYCC_601] = "SYCC_601",
|
||||
+ [DRM_MODE_COLORIMETRY_OPYCC_601] = "opYCC_601",
|
||||
+ [DRM_MODE_COLORIMETRY_OPRGB] = "opRGB",
|
||||
+ [DRM_MODE_COLORIMETRY_BT2020_CYCC] = "BT2020_CYCC",
|
||||
+ [DRM_MODE_COLORIMETRY_BT2020_RGB] = "BT2020_RGB",
|
||||
+ [DRM_MODE_COLORIMETRY_BT2020_YCC] = "BT2020_YCC",
|
||||
+ [DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65] = "P3_RGB_D65",
|
||||
+ [DRM_MODE_COLORIMETRY_DCI_P3_RGB_THEATER] = "P3_RGB_Theater",
|
||||
+ [DRM_MODE_COLORIMETRY_RGB_WIDE_FIXED] = "RGB_WIDE_FIXED",
|
||||
+ [DRM_MODE_COLORIMETRY_RGB_WIDE_FLOAT] = "RGB_WIDE_FLOAT",
|
||||
+ [DRM_MODE_COLORIMETRY_BT601_YCC] = "BT601_YCC",
|
||||
};
|
||||
|
||||
+/**
|
||||
+ * drm_get_color_encoding_name - return a string for color encoding
|
||||
+ * @encoding: color encoding to compute name of
|
||||
+ *
|
||||
+ * In contrast to the other drm_get_*_name functions this one here returns a
|
||||
+ * const pointer and hence is threadsafe.
|
||||
+ */
|
||||
+const char *drm_get_colorspace_name(enum drm_colorspace colorspace)
|
||||
+{
|
||||
+ if (WARN_ON(colorspace >= ARRAY_SIZE(colorspace_names)))
|
||||
+ return "unknown";
|
||||
+
|
||||
+ return colorspace_names[colorspace];
|
||||
+}
|
||||
+
|
||||
+static const u32 hdmi_colorspaces =
|
||||
+ BIT(DRM_MODE_COLORIMETRY_SMPTE_170M_YCC) |
|
||||
+ BIT(DRM_MODE_COLORIMETRY_BT709_YCC) |
|
||||
+ BIT(DRM_MODE_COLORIMETRY_XVYCC_601) |
|
||||
+ BIT(DRM_MODE_COLORIMETRY_XVYCC_709) |
|
||||
+ BIT(DRM_MODE_COLORIMETRY_SYCC_601) |
|
||||
+ BIT(DRM_MODE_COLORIMETRY_OPYCC_601) |
|
||||
+ BIT(DRM_MODE_COLORIMETRY_OPRGB) |
|
||||
+ BIT(DRM_MODE_COLORIMETRY_BT2020_CYCC) |
|
||||
+ BIT(DRM_MODE_COLORIMETRY_BT2020_RGB) |
|
||||
+ BIT(DRM_MODE_COLORIMETRY_BT2020_YCC) |
|
||||
+ BIT(DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65) |
|
||||
+ BIT(DRM_MODE_COLORIMETRY_DCI_P3_RGB_THEATER);
|
||||
+
|
||||
/*
|
||||
* As per DP 1.4a spec, 2.2.5.7.5 VSC SDP Payload for Pixel Encoding/Colorimetry
|
||||
* Format Table 2-120
|
||||
*/
|
||||
-static const struct drm_prop_enum_list dp_colorspaces[] = {
|
||||
- /* For Default case, driver will set the colorspace */
|
||||
- { DRM_MODE_COLORIMETRY_DEFAULT, "Default" },
|
||||
- { DRM_MODE_COLORIMETRY_RGB_WIDE_FIXED, "RGB_Wide_Gamut_Fixed_Point" },
|
||||
- /* Colorimetry based on scRGB (IEC 61966-2-2) */
|
||||
- { DRM_MODE_COLORIMETRY_RGB_WIDE_FLOAT, "RGB_Wide_Gamut_Floating_Point" },
|
||||
- /* Colorimetry based on IEC 61966-2-5 */
|
||||
- { DRM_MODE_COLORIMETRY_OPRGB, "opRGB" },
|
||||
- /* Colorimetry based on SMPTE RP 431-2 */
|
||||
- { DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65, "DCI-P3_RGB_D65" },
|
||||
- /* Colorimetry based on ITU-R BT.2020 */
|
||||
- { DRM_MODE_COLORIMETRY_BT2020_RGB, "BT2020_RGB" },
|
||||
- { DRM_MODE_COLORIMETRY_BT601_YCC, "BT601_YCC" },
|
||||
- { DRM_MODE_COLORIMETRY_BT709_YCC, "BT709_YCC" },
|
||||
- /* Standard Definition Colorimetry based on IEC 61966-2-4 */
|
||||
- { DRM_MODE_COLORIMETRY_XVYCC_601, "XVYCC_601" },
|
||||
- /* High Definition Colorimetry based on IEC 61966-2-4 */
|
||||
- { DRM_MODE_COLORIMETRY_XVYCC_709, "XVYCC_709" },
|
||||
- /* Colorimetry based on IEC 61966-2-1/Amendment 1 */
|
||||
- { DRM_MODE_COLORIMETRY_SYCC_601, "SYCC_601" },
|
||||
- /* Colorimetry based on IEC 61966-2-5 [33] */
|
||||
- { DRM_MODE_COLORIMETRY_OPYCC_601, "opYCC_601" },
|
||||
- /* Colorimetry based on ITU-R BT.2020 */
|
||||
- { DRM_MODE_COLORIMETRY_BT2020_CYCC, "BT2020_CYCC" },
|
||||
- /* Colorimetry based on ITU-R BT.2020 */
|
||||
- { DRM_MODE_COLORIMETRY_BT2020_YCC, "BT2020_YCC" },
|
||||
-};
|
||||
+static const u32 dp_colorspaces =
|
||||
+ BIT(DRM_MODE_COLORIMETRY_RGB_WIDE_FIXED) |
|
||||
+ BIT(DRM_MODE_COLORIMETRY_RGB_WIDE_FLOAT) |
|
||||
+ BIT(DRM_MODE_COLORIMETRY_OPRGB) |
|
||||
+ BIT(DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65) |
|
||||
+ BIT(DRM_MODE_COLORIMETRY_BT2020_RGB) |
|
||||
+ BIT(DRM_MODE_COLORIMETRY_BT601_YCC) |
|
||||
+ BIT(DRM_MODE_COLORIMETRY_BT709_YCC) |
|
||||
+ BIT(DRM_MODE_COLORIMETRY_XVYCC_601) |
|
||||
+ BIT(DRM_MODE_COLORIMETRY_XVYCC_709) |
|
||||
+ BIT(DRM_MODE_COLORIMETRY_SYCC_601) |
|
||||
+ BIT(DRM_MODE_COLORIMETRY_OPYCC_601) |
|
||||
+ BIT(DRM_MODE_COLORIMETRY_BT2020_CYCC) |
|
||||
+ BIT(DRM_MODE_COLORIMETRY_BT2020_YCC);
|
||||
|
||||
/**
|
||||
* DOC: standard connector properties
|
||||
@@ -1975,33 +1983,58 @@ EXPORT_SYMBOL(drm_mode_create_aspect_ratio_property);
|
||||
* drm_mode_create_dp_colorspace_property() is used for DP connector.
|
||||
*/
|
||||
|
||||
-/**
|
||||
- * drm_mode_create_hdmi_colorspace_property - create hdmi colorspace property
|
||||
- * @connector: connector to create the Colorspace property on.
|
||||
- *
|
||||
- * Called by a driver the first time it's needed, must be attached to desired
|
||||
- * HDMI connectors.
|
||||
- *
|
||||
- * Returns:
|
||||
- * Zero on success, negative errno on failure.
|
||||
- */
|
||||
-int drm_mode_create_hdmi_colorspace_property(struct drm_connector *connector)
|
||||
+static int drm_mode_create_colorspace_property(struct drm_connector *connector,
|
||||
+ u32 supported_colorspaces)
|
||||
{
|
||||
struct drm_device *dev = connector->dev;
|
||||
+ u32 colorspaces = supported_colorspaces | BIT(DRM_MODE_COLORIMETRY_DEFAULT);
|
||||
+ struct drm_prop_enum_list enum_list[DRM_MODE_COLORIMETRY_MAX];
|
||||
+ int i, len;
|
||||
|
||||
if (connector->colorspace_property)
|
||||
return 0;
|
||||
|
||||
+ if (WARN_ON(supported_colorspaces == 0 ||
|
||||
+ (supported_colorspaces & -BIT(DRM_MODE_COLORIMETRY_MAX)) != 0))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ len = 0;
|
||||
+ for (i = 0; i < DRM_MODE_COLORIMETRY_MAX; i++) {
|
||||
+ if ((colorspaces & BIT(i)) == 0)
|
||||
+ continue;
|
||||
+
|
||||
+ enum_list[len].type = i;
|
||||
+ enum_list[len].name = colorspace_names[i];
|
||||
+ len++;
|
||||
+ }
|
||||
+
|
||||
connector->colorspace_property =
|
||||
drm_property_create_enum(dev, DRM_MODE_PROP_ENUM, "Colorspace",
|
||||
- hdmi_colorspaces,
|
||||
- ARRAY_SIZE(hdmi_colorspaces));
|
||||
+ enum_list,
|
||||
+ len);
|
||||
|
||||
if (!connector->colorspace_property)
|
||||
return -ENOMEM;
|
||||
|
||||
return 0;
|
||||
}
|
||||
+/**
|
||||
+ * drm_mode_create_hdmi_colorspace_property - create hdmi colorspace property
|
||||
+ * @connector: connector to create the Colorspace property on.
|
||||
+ *
|
||||
+ * Called by a driver the first time it's needed, must be attached to desired
|
||||
+ * HDMI connectors.
|
||||
+ *
|
||||
+ * Returns:
|
||||
+ * Zero on success, negative errno on failure.
|
||||
+ */
|
||||
+int drm_mode_create_hdmi_colorspace_property(struct drm_connector *connector,
|
||||
+ u32 supported_colorspaces)
|
||||
+{
|
||||
+ u32 colorspaces = supported_colorspaces & hdmi_colorspaces;
|
||||
+
|
||||
+ return drm_mode_create_colorspace_property(connector, colorspaces);
|
||||
+}
|
||||
EXPORT_SYMBOL(drm_mode_create_hdmi_colorspace_property);
|
||||
|
||||
/**
|
||||
@@ -2014,22 +2047,12 @@ EXPORT_SYMBOL(drm_mode_create_hdmi_colorspace_property);
|
||||
* Returns:
|
||||
* Zero on success, negative errno on failure.
|
||||
*/
|
||||
-int drm_mode_create_dp_colorspace_property(struct drm_connector *connector)
|
||||
+int drm_mode_create_dp_colorspace_property(struct drm_connector *connector,
|
||||
+ u32 supported_colorspaces)
|
||||
{
|
||||
- struct drm_device *dev = connector->dev;
|
||||
+ u32 colorspaces = supported_colorspaces & dp_colorspaces;
|
||||
|
||||
- if (connector->colorspace_property)
|
||||
- return 0;
|
||||
-
|
||||
- connector->colorspace_property =
|
||||
- drm_property_create_enum(dev, DRM_MODE_PROP_ENUM, "Colorspace",
|
||||
- dp_colorspaces,
|
||||
- ARRAY_SIZE(dp_colorspaces));
|
||||
-
|
||||
- if (!connector->colorspace_property)
|
||||
- return -ENOMEM;
|
||||
-
|
||||
- return 0;
|
||||
+ return drm_mode_create_colorspace_property(connector, colorspaces);
|
||||
}
|
||||
EXPORT_SYMBOL(drm_mode_create_dp_colorspace_property);
|
||||
|
||||
diff --git a/drivers/gpu/drm/i915/display/intel_connector.c b/drivers/gpu/drm/i915/display/intel_connector.c
|
||||
index 6205ddd3ded0..843a669afd59 100644
|
||||
--- a/drivers/gpu/drm/i915/display/intel_connector.c
|
||||
+++ b/drivers/gpu/drm/i915/display/intel_connector.c
|
||||
@@ -283,14 +283,14 @@ intel_attach_aspect_ratio_property(struct drm_connector *connector)
|
||||
void
|
||||
intel_attach_hdmi_colorspace_property(struct drm_connector *connector)
|
||||
{
|
||||
- if (!drm_mode_create_hdmi_colorspace_property(connector))
|
||||
+ if (!drm_mode_create_hdmi_colorspace_property(connector, 0xffffffff))
|
||||
drm_connector_attach_colorspace_property(connector);
|
||||
}
|
||||
|
||||
void
|
||||
intel_attach_dp_colorspace_property(struct drm_connector *connector)
|
||||
{
|
||||
- if (!drm_mode_create_dp_colorspace_property(connector))
|
||||
+ if (!drm_mode_create_dp_colorspace_property(connector, 0xffffffff))
|
||||
drm_connector_attach_colorspace_property(connector);
|
||||
}
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
index 55744216392b..280d11648712 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
@@ -618,7 +618,7 @@ static int vc4_hdmi_connector_init(struct drm_device *dev,
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
- ret = drm_mode_create_hdmi_colorspace_property(connector);
|
||||
+ ret = drm_mode_create_hdmi_colorspace_property(connector, 0xffffffff);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
diff --git a/include/drm/display/drm_dp.h b/include/drm/display/drm_dp.h
|
||||
index e934aab357be..4fc5120392e3 100644
|
||||
--- a/include/drm/display/drm_dp.h
|
||||
+++ b/include/drm/display/drm_dp.h
|
||||
@@ -1617,7 +1617,7 @@ enum dp_pixelformat {
|
||||
*
|
||||
* This enum is used to indicate DP VSC SDP Colorimetry formats.
|
||||
* It is based on DP 1.4 spec [Table 2-117: VSC SDP Payload for DB16 through
|
||||
- * DB18] and a name of enum member follows DRM_MODE_COLORIMETRY definition.
|
||||
+ * DB18] and a name of enum member follows &enum drm_colorimetry definition.
|
||||
*
|
||||
* @DP_COLORIMETRY_DEFAULT: sRGB (IEC 61966-2-1) or
|
||||
* ITU-R BT.601 colorimetry format
|
||||
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
|
||||
index 565cf9d3c550..68f26a3ebb99 100644
|
||||
--- a/include/drm/drm_connector.h
|
||||
+++ b/include/drm/drm_connector.h
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <linux/notifier.h>
|
||||
#include <drm/drm_mode_object.h>
|
||||
#include <drm/drm_util.h>
|
||||
+#include <drm/drm_property.h>
|
||||
|
||||
#include <uapi/drm/drm_mode.h>
|
||||
|
||||
@@ -371,29 +372,30 @@ enum drm_privacy_screen_status {
|
||||
* a colorspace property which will be created and exposed to
|
||||
* userspace.
|
||||
*/
|
||||
-
|
||||
-/* For Default case, driver will set the colorspace */
|
||||
-#define DRM_MODE_COLORIMETRY_DEFAULT 0
|
||||
-/* CEA 861 Normal Colorimetry options */
|
||||
-#define DRM_MODE_COLORIMETRY_NO_DATA 0
|
||||
-#define DRM_MODE_COLORIMETRY_SMPTE_170M_YCC 1
|
||||
-#define DRM_MODE_COLORIMETRY_BT709_YCC 2
|
||||
-/* CEA 861 Extended Colorimetry Options */
|
||||
-#define DRM_MODE_COLORIMETRY_XVYCC_601 3
|
||||
-#define DRM_MODE_COLORIMETRY_XVYCC_709 4
|
||||
-#define DRM_MODE_COLORIMETRY_SYCC_601 5
|
||||
-#define DRM_MODE_COLORIMETRY_OPYCC_601 6
|
||||
-#define DRM_MODE_COLORIMETRY_OPRGB 7
|
||||
-#define DRM_MODE_COLORIMETRY_BT2020_CYCC 8
|
||||
-#define DRM_MODE_COLORIMETRY_BT2020_RGB 9
|
||||
-#define DRM_MODE_COLORIMETRY_BT2020_YCC 10
|
||||
-/* Additional Colorimetry extension added as part of CTA 861.G */
|
||||
-#define DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65 11
|
||||
-#define DRM_MODE_COLORIMETRY_DCI_P3_RGB_THEATER 12
|
||||
-/* Additional Colorimetry Options added for DP 1.4a VSC Colorimetry Format */
|
||||
-#define DRM_MODE_COLORIMETRY_RGB_WIDE_FIXED 13
|
||||
-#define DRM_MODE_COLORIMETRY_RGB_WIDE_FLOAT 14
|
||||
-#define DRM_MODE_COLORIMETRY_BT601_YCC 15
|
||||
+enum drm_colorspace {
|
||||
+ /* For Default case, driver will set the colorspace */
|
||||
+ DRM_MODE_COLORIMETRY_DEFAULT,
|
||||
+ /* CEA 861 Normal Colorimetry options */
|
||||
+ DRM_MODE_COLORIMETRY_SMPTE_170M_YCC,
|
||||
+ DRM_MODE_COLORIMETRY_BT709_YCC,
|
||||
+ /* CEA 861 Extended Colorimetry Options */
|
||||
+ DRM_MODE_COLORIMETRY_XVYCC_601,
|
||||
+ DRM_MODE_COLORIMETRY_XVYCC_709,
|
||||
+ DRM_MODE_COLORIMETRY_SYCC_601,
|
||||
+ DRM_MODE_COLORIMETRY_OPYCC_601,
|
||||
+ DRM_MODE_COLORIMETRY_OPRGB,
|
||||
+ DRM_MODE_COLORIMETRY_BT2020_CYCC,
|
||||
+ DRM_MODE_COLORIMETRY_BT2020_RGB,
|
||||
+ DRM_MODE_COLORIMETRY_BT2020_YCC,
|
||||
+ /* Additional Colorimetry extension added as part of CTA 861.G */
|
||||
+ DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65,
|
||||
+ DRM_MODE_COLORIMETRY_DCI_P3_RGB_THEATER,
|
||||
+ /* Additional Colorimetry Options added for DP 1.4a VSC Colorimetry Format */
|
||||
+ DRM_MODE_COLORIMETRY_RGB_WIDE_FIXED,
|
||||
+ DRM_MODE_COLORIMETRY_RGB_WIDE_FLOAT,
|
||||
+ DRM_MODE_COLORIMETRY_BT601_YCC,
|
||||
+ DRM_MODE_COLORIMETRY_MAX
|
||||
+};
|
||||
|
||||
/**
|
||||
* enum drm_bus_flags - bus_flags info for &drm_display_info
|
||||
@@ -828,7 +830,7 @@ struct drm_connector_state {
|
||||
* colorspace change on Sink. This is most commonly used to switch
|
||||
* to wider color gamuts like BT2020.
|
||||
*/
|
||||
- u32 colorspace;
|
||||
+ enum drm_colorspace colorspace;
|
||||
|
||||
/**
|
||||
* @writeback_job: Writeback job for writeback connectors
|
||||
@@ -1835,8 +1837,10 @@ int drm_connector_attach_hdr_output_metadata_property(struct drm_connector *conn
|
||||
bool drm_connector_atomic_hdr_metadata_equal(struct drm_connector_state *old_state,
|
||||
struct drm_connector_state *new_state);
|
||||
int drm_mode_create_aspect_ratio_property(struct drm_device *dev);
|
||||
-int drm_mode_create_hdmi_colorspace_property(struct drm_connector *connector);
|
||||
-int drm_mode_create_dp_colorspace_property(struct drm_connector *connector);
|
||||
+int drm_mode_create_hdmi_colorspace_property(struct drm_connector *connector,
|
||||
+ u32 supported_colorspaces);
|
||||
+int drm_mode_create_dp_colorspace_property(struct drm_connector *connector,
|
||||
+ u32 supported_colorspaces);
|
||||
int drm_mode_create_content_type_property(struct drm_device *dev);
|
||||
int drm_mode_create_suggested_offset_properties(struct drm_device *dev);
|
||||
|
||||
@@ -1919,6 +1923,7 @@ void drm_connector_list_iter_end(struct drm_connector_list_iter *iter);
|
||||
|
||||
bool drm_connector_has_possible_encoder(struct drm_connector *connector,
|
||||
struct drm_encoder *encoder);
|
||||
+const char *drm_get_colorspace_name(enum drm_colorspace colorspace);
|
||||
|
||||
/**
|
||||
* drm_for_each_connector_iter - connector_list iterator macro
|
||||
--
|
||||
2.39.2
|
@ -1,139 +0,0 @@
|
||||
From d750d1480362781e208b3cc64640c0be127afcc9 Mon Sep 17 00:00:00 2001
|
||||
From: "Daniel J. Ogorchock" <djogorchock@gmail.com>
|
||||
Date: Fri, 3 Feb 2023 16:51:18 -0500
|
||||
Subject: HID: nintendo: fix rumble rate limiter
|
||||
|
||||
It's been discovered that BT controller disconnect events correlate to
|
||||
erratic input report timestamp deltas.
|
||||
|
||||
In experimentation, it's been found that ensuring that multiple
|
||||
timestamp deltas are consistent prior to transmitting a rumble packet
|
||||
drastically reduces the occurence rate of BT disconnects.
|
||||
|
||||
Alter the joycon_enforce_subcmd_rate() function to use this new
|
||||
approach.
|
||||
|
||||
Signed-off-by: Daniel J. Ogorchock <djogorchock@gmail.com>
|
||||
Reviewed-by: Silvan Jegen <s.jegen@gmail.com
|
||||
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
|
||||
---
|
||||
drivers/hid/hid-nintendo.c | 75 ++++++++++++++++++++++++++++++++++++++++++----
|
||||
1 file changed, 69 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c
|
||||
index 2b781cc9082b4..250f5d2f888ab 100644
|
||||
--- a/drivers/hid/hid-nintendo.c
|
||||
+++ b/drivers/hid/hid-nintendo.c
|
||||
@@ -433,7 +433,9 @@ struct joycon_ctlr {
|
||||
u8 usb_ack_match;
|
||||
u8 subcmd_ack_match;
|
||||
bool received_input_report;
|
||||
+ unsigned int last_input_report_msecs;
|
||||
unsigned int last_subcmd_sent_msecs;
|
||||
+ unsigned int consecutive_valid_report_deltas;
|
||||
|
||||
/* factory calibration data */
|
||||
struct joycon_stick_cal left_stick_cal_x;
|
||||
@@ -543,19 +545,54 @@ static void joycon_wait_for_input_report(struct joycon_ctlr *ctlr)
|
||||
* Sending subcommands and/or rumble data at too high a rate can cause bluetooth
|
||||
* controller disconnections.
|
||||
*/
|
||||
+#define JC_INPUT_REPORT_MIN_DELTA 8
|
||||
+#define JC_INPUT_REPORT_MAX_DELTA 17
|
||||
+#define JC_SUBCMD_TX_OFFSET_MS 4
|
||||
+#define JC_SUBCMD_VALID_DELTA_REQ 3
|
||||
+#define JC_SUBCMD_RATE_MAX_ATTEMPTS 500
|
||||
+#define JC_SUBCMD_RATE_LIMITER_USB_MS 20
|
||||
+#define JC_SUBCMD_RATE_LIMITER_BT_MS 60
|
||||
+#define JC_SUBCMD_RATE_LIMITER_MS(ctlr) ((ctlr)->hdev->bus == BUS_USB ? JC_SUBCMD_RATE_LIMITER_USB_MS : JC_SUBCMD_RATE_LIMITER_BT_MS)
|
||||
static void joycon_enforce_subcmd_rate(struct joycon_ctlr *ctlr)
|
||||
{
|
||||
- static const unsigned int max_subcmd_rate_ms = 25;
|
||||
- unsigned int current_ms = jiffies_to_msecs(jiffies);
|
||||
- unsigned int delta_ms = current_ms - ctlr->last_subcmd_sent_msecs;
|
||||
+ unsigned int current_ms;
|
||||
+ unsigned long subcmd_delta;
|
||||
+ int consecutive_valid_deltas = 0;
|
||||
+ int attempts = 0;
|
||||
+ unsigned long flags;
|
||||
+
|
||||
+ if (unlikely(ctlr->ctlr_state != JOYCON_CTLR_STATE_READ))
|
||||
+ return;
|
||||
|
||||
- while (delta_ms < max_subcmd_rate_ms &&
|
||||
- ctlr->ctlr_state == JOYCON_CTLR_STATE_READ) {
|
||||
+ do {
|
||||
joycon_wait_for_input_report(ctlr);
|
||||
current_ms = jiffies_to_msecs(jiffies);
|
||||
- delta_ms = current_ms - ctlr->last_subcmd_sent_msecs;
|
||||
+ subcmd_delta = current_ms - ctlr->last_subcmd_sent_msecs;
|
||||
+
|
||||
+ spin_lock_irqsave(&ctlr->lock, flags);
|
||||
+ consecutive_valid_deltas = ctlr->consecutive_valid_report_deltas;
|
||||
+ spin_unlock_irqrestore(&ctlr->lock, flags);
|
||||
+
|
||||
+ attempts++;
|
||||
+ } while ((consecutive_valid_deltas < JC_SUBCMD_VALID_DELTA_REQ ||
|
||||
+ subcmd_delta < JC_SUBCMD_RATE_LIMITER_MS(ctlr)) &&
|
||||
+ ctlr->ctlr_state == JOYCON_CTLR_STATE_READ &&
|
||||
+ attempts < JC_SUBCMD_RATE_MAX_ATTEMPTS);
|
||||
+
|
||||
+ if (attempts >= JC_SUBCMD_RATE_MAX_ATTEMPTS) {
|
||||
+ hid_warn(ctlr->hdev, "%s: exceeded max attempts", __func__);
|
||||
+ return;
|
||||
}
|
||||
+
|
||||
ctlr->last_subcmd_sent_msecs = current_ms;
|
||||
+
|
||||
+ /*
|
||||
+ * Wait a short time after receiving an input report before
|
||||
+ * transmitting. This should reduce odds of a TX coinciding with an RX.
|
||||
+ * Minimizing concurrent BT traffic with the controller seems to lower
|
||||
+ * the rate of disconnections.
|
||||
+ */
|
||||
+ msleep(JC_SUBCMD_TX_OFFSET_MS);
|
||||
}
|
||||
|
||||
static int joycon_hid_send_sync(struct joycon_ctlr *ctlr, u8 *data, size_t len,
|
||||
@@ -1223,6 +1260,7 @@ static void joycon_parse_report(struct joycon_ctlr *ctlr,
|
||||
u8 tmp;
|
||||
u32 btns;
|
||||
unsigned long msecs = jiffies_to_msecs(jiffies);
|
||||
+ unsigned long report_delta_ms = msecs - ctlr->last_input_report_msecs;
|
||||
|
||||
spin_lock_irqsave(&ctlr->lock, flags);
|
||||
if (IS_ENABLED(CONFIG_NINTENDO_FF) && rep->vibrator_report &&
|
||||
@@ -1364,6 +1402,31 @@ static void joycon_parse_report(struct joycon_ctlr *ctlr,
|
||||
|
||||
input_sync(dev);
|
||||
|
||||
+ spin_lock_irqsave(&ctlr->lock, flags);
|
||||
+ ctlr->last_input_report_msecs = msecs;
|
||||
+ /*
|
||||
+ * Was this input report a reasonable time delta compared to the prior
|
||||
+ * report? We use this information to decide when a safe time is to send
|
||||
+ * rumble packets or subcommand packets.
|
||||
+ */
|
||||
+ if (report_delta_ms >= JC_INPUT_REPORT_MIN_DELTA &&
|
||||
+ report_delta_ms <= JC_INPUT_REPORT_MAX_DELTA) {
|
||||
+ if (ctlr->consecutive_valid_report_deltas < JC_SUBCMD_VALID_DELTA_REQ)
|
||||
+ ctlr->consecutive_valid_report_deltas++;
|
||||
+ } else {
|
||||
+ ctlr->consecutive_valid_report_deltas = 0;
|
||||
+ }
|
||||
+ /*
|
||||
+ * Our consecutive valid report tracking is only relevant for
|
||||
+ * bluetooth-connected controllers. For USB devices, we're beholden to
|
||||
+ * USB's underlying polling rate anyway. Always set to the consecutive
|
||||
+ * delta requirement.
|
||||
+ */
|
||||
+ if (ctlr->hdev->bus == BUS_USB)
|
||||
+ ctlr->consecutive_valid_report_deltas = JC_SUBCMD_VALID_DELTA_REQ;
|
||||
+
|
||||
+ spin_unlock_irqrestore(&ctlr->lock, flags);
|
||||
+
|
||||
/*
|
||||
* Immediately after receiving a report is the most reliable time to
|
||||
* send a subcommand to the controller. Wake any subcommand senders
|
||||
--
|
||||
cgit
|
@ -1,64 +0,0 @@
|
||||
From bcba9f32c13a29edf7e996371eebe7eb5ff9f854 Mon Sep 17 00:00:00 2001
|
||||
From: "Daniel J. Ogorchock" <djogorchock@gmail.com>
|
||||
Date: Fri, 3 Feb 2023 16:51:17 -0500
|
||||
Subject: HID: nintendo: prevent rumble queue overruns
|
||||
|
||||
Make sure that we never throw out the most recent rumble setting,
|
||||
opting to overwrite the prior queue head instead. This prevents
|
||||
instances where we could get rumble stuck on if there were an overrun at
|
||||
the wrong time.
|
||||
|
||||
Signed-off-by: Daniel J. Ogorchock <djogorchock@gmail.com>
|
||||
Reviewed-by: Silvan Jegen <s.jegen@gmail.com
|
||||
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
|
||||
---
|
||||
drivers/hid/hid-nintendo.c | 20 +++++++++++++++++---
|
||||
1 file changed, 17 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c
|
||||
index 5bfc0c4504608..2b781cc9082b4 100644
|
||||
--- a/drivers/hid/hid-nintendo.c
|
||||
+++ b/drivers/hid/hid-nintendo.c
|
||||
@@ -1527,6 +1527,7 @@ static int joycon_set_rumble(struct joycon_ctlr *ctlr, u16 amp_r, u16 amp_l,
|
||||
u16 freq_l_low;
|
||||
u16 freq_l_high;
|
||||
unsigned long flags;
|
||||
+ int next_rq_head;
|
||||
|
||||
spin_lock_irqsave(&ctlr->lock, flags);
|
||||
freq_r_low = ctlr->rumble_rl_freq;
|
||||
@@ -1547,8 +1548,21 @@ static int joycon_set_rumble(struct joycon_ctlr *ctlr, u16 amp_r, u16 amp_l,
|
||||
joycon_encode_rumble(data, freq_l_low, freq_l_high, amp);
|
||||
|
||||
spin_lock_irqsave(&ctlr->lock, flags);
|
||||
- if (++ctlr->rumble_queue_head >= JC_RUMBLE_QUEUE_SIZE)
|
||||
- ctlr->rumble_queue_head = 0;
|
||||
+
|
||||
+ next_rq_head = ctlr->rumble_queue_head + 1;
|
||||
+ if (next_rq_head >= JC_RUMBLE_QUEUE_SIZE)
|
||||
+ next_rq_head = 0;
|
||||
+
|
||||
+ /* Did we overrun the circular buffer?
|
||||
+ * If so, be sure we keep the latest intended rumble state.
|
||||
+ */
|
||||
+ if (next_rq_head == ctlr->rumble_queue_tail) {
|
||||
+ hid_dbg(ctlr->hdev, "rumble queue is full");
|
||||
+ /* overwrite the prior value at the end of the circular buf */
|
||||
+ next_rq_head = ctlr->rumble_queue_head;
|
||||
+ }
|
||||
+
|
||||
+ ctlr->rumble_queue_head = next_rq_head;
|
||||
memcpy(ctlr->rumble_data[ctlr->rumble_queue_head], data,
|
||||
JC_RUMBLE_DATA_SIZE);
|
||||
|
||||
@@ -2128,7 +2142,7 @@ static int nintendo_hid_probe(struct hid_device *hdev,
|
||||
|
||||
ctlr->hdev = hdev;
|
||||
ctlr->ctlr_state = JOYCON_CTLR_STATE_INIT;
|
||||
- ctlr->rumble_queue_head = JC_RUMBLE_QUEUE_SIZE - 1;
|
||||
+ ctlr->rumble_queue_head = 0;
|
||||
ctlr->rumble_queue_tail = 0;
|
||||
hid_set_drvdata(hdev, ctlr);
|
||||
mutex_init(&ctlr->output_mutex);
|
||||
--
|
||||
cgit
|
@ -1,78 +0,0 @@
|
||||
From e55f6f53ab572901f826fb66d385eaa7d1210bb5 Mon Sep 17 00:00:00 2001
|
||||
From: Jan200101 <sentrycraft123@gmail.com>
|
||||
Date: Tue, 22 Mar 2022 17:52:14 +0100
|
||||
Subject: [PATCH] drm/amdgpu: enable SI and CIK support by default
|
||||
|
||||
Signed-off-by: Jan200101 <sentrycraft123@gmail.com>
|
||||
---
|
||||
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 14 ++------------
|
||||
drivers/gpu/drm/radeon/radeon_drv.c | 10 ++++++++++
|
||||
2 files changed, 12 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
|
||||
index 0ead08ba58c2..95a59d203922 100644
|
||||
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
|
||||
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
|
||||
@@ -575,15 +575,10 @@ module_param_named(timeout_period, amdgpu_watchdog_timer.period, uint, 0644);
|
||||
*/
|
||||
#ifdef CONFIG_DRM_AMDGPU_SI
|
||||
|
||||
-#if defined(CONFIG_DRM_RADEON) || defined(CONFIG_DRM_RADEON_MODULE)
|
||||
-int amdgpu_si_support = 0;
|
||||
-MODULE_PARM_DESC(si_support, "SI support (1 = enabled, 0 = disabled (default))");
|
||||
-#else
|
||||
int amdgpu_si_support = 1;
|
||||
MODULE_PARM_DESC(si_support, "SI support (1 = enabled (default), 0 = disabled)");
|
||||
-#endif
|
||||
-
|
||||
module_param_named(si_support, amdgpu_si_support, int, 0444);
|
||||
+
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -594,15 +589,10 @@ module_param_named(si_support, amdgpu_si_support, int, 0444);
|
||||
*/
|
||||
#ifdef CONFIG_DRM_AMDGPU_CIK
|
||||
|
||||
-#if defined(CONFIG_DRM_RADEON) || defined(CONFIG_DRM_RADEON_MODULE)
|
||||
-int amdgpu_cik_support = 0;
|
||||
-MODULE_PARM_DESC(cik_support, "CIK support (1 = enabled, 0 = disabled (default))");
|
||||
-#else
|
||||
int amdgpu_cik_support = 1;
|
||||
MODULE_PARM_DESC(cik_support, "CIK support (1 = enabled (default), 0 = disabled)");
|
||||
-#endif
|
||||
-
|
||||
module_param_named(cik_support, amdgpu_cik_support, int, 0444);
|
||||
+
|
||||
#endif
|
||||
|
||||
/**
|
||||
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
|
||||
index 956c72b5aa33..5102711ece53 100644
|
||||
--- a/drivers/gpu/drm/radeon/radeon_drv.c
|
||||
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
|
||||
@@ -272,12 +272,22 @@ module_param_named(uvd, radeon_uvd, int, 0444);
|
||||
MODULE_PARM_DESC(vce, "vce enable/disable vce support (1 = enable, 0 = disable)");
|
||||
module_param_named(vce, radeon_vce, int, 0444);
|
||||
|
||||
+#ifdef CONFIG_DRM_AMDGPU_SI
|
||||
+int radeon_si_support = 0;
|
||||
+MODULE_PARM_DESC(si_support, "SI support (1 = enabled, 0 = disabled (default))");
|
||||
+#else
|
||||
int radeon_si_support = 1;
|
||||
MODULE_PARM_DESC(si_support, "SI support (1 = enabled (default), 0 = disabled)");
|
||||
+#endif
|
||||
module_param_named(si_support, radeon_si_support, int, 0444);
|
||||
|
||||
+#ifdef CONFIG_DRM_AMDGPU_CIK
|
||||
+int radeon_cik_support = 0;
|
||||
+MODULE_PARM_DESC(cik_support, "CIK support (1 = enabled, 0 = disabled (default))");
|
||||
+#else
|
||||
int radeon_cik_support = 1;
|
||||
MODULE_PARM_DESC(cik_support, "CIK support (1 = enabled (default), 0 = disabled)");
|
||||
+#endif
|
||||
module_param_named(cik_support, radeon_cik_support, int, 0444);
|
||||
|
||||
static struct pci_device_id pciidlist[] = {
|
||||
--
|
||||
2.35.1
|
2
release.sh
Executable file
2
release.sh
Executable file
@ -0,0 +1,2 @@
|
||||
# send debs to server
|
||||
rsync -azP --include './' --include '*.deb' --exclude '*' ./output/ ferreo@direct.pika-os.com:/srv/www/cockatiel-incoming/
|
@ -2,4 +2,4 @@
|
||||
|
||||
echo "Pika Kernel - Building"
|
||||
|
||||
make -j`nproc` bindeb-pkg LOCALVERSION=-pikaos
|
||||
make -j`nproc` bindeb-pkg LOCALVERSION=-pikaos KDEB_PKGVERSION=$(make kernelversion)-101pika2
|
||||
|
@ -4,12 +4,13 @@ echo "Pika Kernel - Applying configuration"
|
||||
|
||||
cp ../config .config
|
||||
|
||||
scripts/config -k -e CONFIG_GENERIC_CPU
|
||||
scripts/config -k -d CONFIG_GENERIC_CPU
|
||||
scripts/config -k -e CONFIG_GENERIC_CPU3
|
||||
scripts/config -e CACHY
|
||||
scripts/config -e SCHED_CFS
|
||||
scripts/config -e SCHED_BORE
|
||||
|
||||
scripts/config -e HZ_300 --set-val HZ 1000
|
||||
scripts/config -d HZ_PERIODIC -d NO_HZ_FULL -e NO_HZ_IDLE -e NO_HZ -e NO_HZ_COMMON
|
||||
scripts/config -e HZ_300 --set-val HZ 750
|
||||
scripts/config -d HZ_PERIODIC -d NO_HZ_IDLE -d CONTEXT_TRACKING_FORCE -e NO_HZ_FULL_NODEF -e NO_HZ_FULL -e NO_HZ -e NO_HZ_COMMON -e CONTEXT_TRACKING
|
||||
scripts/config -e PREEMPT_BUILD -d PREEMPT_NONE -d PREEMPT_VOLUNTARY -e PREEMPT -e PREEMPT_COUNT -e PREEMPTION -e PREEMPT_DYNAMIC
|
||||
|
||||
scripts/config -d CC_OPTIMIZE_FOR_PERFORMANCE \
|
||||
@ -17,13 +18,23 @@ scripts/config -d CC_OPTIMIZE_FOR_PERFORMANCE \
|
||||
|
||||
scripts/config -m TCP_CONG_CUBIC \
|
||||
-d DEFAULT_CUBIC \
|
||||
-e TCP_CONG_BBR2 \
|
||||
-e DEFAULT_BBR2 \
|
||||
--set-str DEFAULT_TCP_CONG bbr2
|
||||
-e TCP_CONG_BBR \
|
||||
-e DEFAULT_BBR \
|
||||
--set-str DEFAULT_TCP_CONG bbr
|
||||
|
||||
scripts/config -m NET_SCH_FQ_CODEL \
|
||||
-e NET_SCH_FQ \
|
||||
-d DEFAULT_FQ_CODEL \
|
||||
-e DEFAULT_FQ \
|
||||
--set-str DEFAULT_NET_SCH fq
|
||||
|
||||
scripts/config -e SCHED_CLASS_EXT
|
||||
|
||||
scripts/config -e LRU_GEN -e LRU_GEN_ENABLED -d LRU_GEN_STATS
|
||||
|
||||
scripts/config -d TRANSPARENT_HUGEPAGE_ALWAYS -e TRANSPARENT_HUGEPAGE_MADVISE
|
||||
scripts/config -d TRANSPARENT_HUGEPAGE_MADVISE -e TRANSPARENT_HUGEPAGE_ALWAYS
|
||||
|
||||
scripts/config -e PER_VMA_LOCK -d PER_VMA_LOCK_STATS
|
||||
|
||||
scripts/config -e DAMON \
|
||||
-e DAMON_VADDR \
|
||||
@ -33,29 +44,10 @@ scripts/config -e DAMON \
|
||||
-e DAMON_RECLAIM \
|
||||
-e DAMON_LRU_SORT
|
||||
|
||||
scripts/config -d ZRAM_DEF_COMP_LZORLE \
|
||||
-e ZRAM_DEF_COMP_ZSTD \
|
||||
--set-str ZRAM_DEF_COMP zstd \
|
||||
-d ZSWAP_COMPRESSOR_DEFAULT_LZ4 \
|
||||
-e ZSWAP_COMPRESSOR_DEFAULT_ZSTD \
|
||||
--set-str ZSWAP_COMPRESSOR_DEFAULT zstd
|
||||
|
||||
scripts/config --set-val MODULE_COMPRESS_ZSTD_LEVEL 19 -e MODULE_COMPRESS_ZSTD_ULTRA --set-val MODULE_COMPRESS_ZSTD_LEVEL_ULTRA 22 --set-val ZSTD_COMP_VAL 22
|
||||
|
||||
scripts/config -e EFI_HANDOVER_PROTOCOL
|
||||
|
||||
scripts/config -e USER_NS
|
||||
|
||||
scripts/config -d DEBUG_INFO \
|
||||
-d DEBUG_INFO_DWARF4 \
|
||||
-d DEBUG_INFO_DWARF5 \
|
||||
-d SLUB_DEBUG \
|
||||
-d PM_DEBUG \
|
||||
-d PM_ADVANCED_DEBUG \
|
||||
-d PM_SLEEP_DEBUG \
|
||||
-d ACPI_DEBUG \
|
||||
-d SCHED_DEBUG \
|
||||
-d LATENCYTOP \
|
||||
-d DEBUG_PREEMPT
|
||||
|
||||
make prepare
|
||||
|
@ -4,4 +4,8 @@ echo "Pika Kernel - Copying Output"
|
||||
|
||||
cd ..
|
||||
rm ./linux-libc*.deb
|
||||
cp ./*.deb ./output/
|
||||
|
||||
for f in *.deb;
|
||||
do
|
||||
cp $f ./output/$f
|
||||
done
|
||||
|
@ -2,21 +2,7 @@
|
||||
|
||||
echo "Pika Kernel - Applying patches"
|
||||
|
||||
# Cachy patches are here: https://github.com/CachyOS/kernel-patches/
|
||||
# orig patch from cachy - 0001-cachyos-base-all.patch
|
||||
patch -Np1 < "../patches/0001-cachy-all.patch"
|
||||
# orig patch from cachy
|
||||
patch -Np1 < "../patches/0002-eevdf.patch"
|
||||
# HDR patch - Currently broken against 6.3
|
||||
#patch -Np1 < "../patches/0004-hdr.patch"
|
||||
# Nintendo controller rumble patch
|
||||
patch -Np1 < "../patches/0006-Nintendo-controller-one.patch"
|
||||
# Nintendo controller BT patch
|
||||
patch -Np1 < "../patches/0006-Nintendo-controller-two.patch"
|
||||
# Nobara patches are here: https://github.com/sammilucia/nobara-kernel-fork
|
||||
# Extra Leigon laptop goodies
|
||||
patch -Np1 < "../patches/0001-Add-legion-laptop-v0.1.patch"
|
||||
# Allow setting custom pollrates for usb devices
|
||||
patch -Np1 < "../patches/0001-Allow-to-set-custom-USB-pollrate-for-specific-device.patch"
|
||||
# Allow pre polaris cards to use the amdgpu kernel module
|
||||
patch -Np1 < "../patches/amdgpu-si-cik-default.patch"
|
||||
if [ -f ../patches/series ]
|
||||
then
|
||||
for i in $(cat ../patches/series | grep -v '^#') ; do echo "Applying Patch: $i" && patch -Np1 -i ../patches/$i || bash -c "echo "Applying Patch $i Failed!" && exit 2"; done
|
||||
fi
|
||||
|
@ -1,25 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Pika Kernel - Releasing Kernel"
|
||||
|
||||
# Sign the packages
|
||||
dpkg-sig --sign builder ./output/linux-image*.deb
|
||||
dpkg-sig --sign builder ./output/linux-headers*.deb
|
||||
#dpkg-sig --sign builder ./output/linux-tools*.deb
|
||||
|
||||
# Pull down existing ppa repo db files etc
|
||||
rsync -azP --exclude '*.deb' ferreo@direct.pika-os.com:/srv/www/pikappa/ ./output/repo
|
||||
|
||||
# Copy over our gpg key in case it has been updated
|
||||
cp ./output/key.gpg ./output/repo/key.gpg
|
||||
|
||||
# Remove our existing package from the repo - only for current version so we can update it
|
||||
reprepro -V --basedir ./output/repo/ removefilter kinetic 'Package (% linux-6.3.0-*-pikaos*)'
|
||||
|
||||
# Add the new package to the repo
|
||||
reprepro -V --basedir ./output/repo/ includedeb kinetic ./output/linux-image*.deb
|
||||
reprepro -V --basedir ./output/repo/ includedeb kinetic ./output/linux-headers*.deb
|
||||
#reprepro -V --basedir ./output/repo/ includedeb kinetic ./output/linux-tools*.deb
|
||||
|
||||
# Push the updated ppa repo to the server
|
||||
rsync -azP ./output/repo/ ferreo@direct.pika-os.com:/srv/www/pikappa/
|
@ -2,7 +2,7 @@
|
||||
|
||||
echo "Pika Kernel - Getting source"
|
||||
|
||||
wget -nv https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.3.tar.xz
|
||||
tar -xf ./linux-6.3.tar.xz
|
||||
wget -nv https://cdn.kernel.org/pub/linux/kernel/v"$(echo $(cat ./VERSION) | cut -f1 -d".")".x/linux-"$(cat ./VERSION)".tar.gz
|
||||
tar -xf ./linux-"$(cat ./VERSION)".tar.gz
|
||||
|
||||
cd linux-6.3
|
||||
cd linux-"$(cat ./VERSION)"
|
||||
|
Loading…
Reference in New Issue
Block a user