Package Details: ddcci-driver-linux-dkms 0.4.4-2

Git Clone URL: https://aur.archlinux.org/ddcci-driver-linux-dkms.git (read-only, click to copy)
Package Base: ddcci-driver-linux-dkms
Description: A pair of Linux kernel drivers for DDC/CI monitors (DKMS)
Upstream URL: https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux/
Keywords: backlight hdmi monitor
Licenses: GPL2
Conflicts: ddcci-driver-linux
Submitter: irtimmer
Maintainer: ewout (Porous3247)
Last Packager: Porous3247
Votes: 39
Popularity: 1.13
First Submitted: 2017-04-15 18:51 (UTC)
Last Updated: 2023-09-03 13:11 (UTC)

Latest Comments

« First ‹ Previous 1 2 3 4 5 6 Next › Last »

GPereira commented on 2023-10-09 19:20 (UTC)

I am loading the ddcci module in mkinitcpio and the slider doesn't show up on GNOME. What do I need to do?

Andrei_Korshikov commented on 2023-06-10 10:26 (UTC)

@dxwil I upgraded the kernel to 6.3.6 and got the same behavior as you. My solution is to modprobe ddcci_backlight in 3 seconds after starting SDDM service (After=sddm.service and additional ExecStart=/usr/bin/sleep 3 before ExecStart=/usr/bin/modprobe ddcci_backlight).

Porous3247 commented on 2023-05-06 16:07 (UTC) (edited on 2023-05-07 00:34 (UTC) by Porous3247)

@UmarJ

Thanks for letting me know, I applied your changes.

Note that the patch does not work on kernel versions before 6.3. Sorry to anyone who can't get it working for kernels older than 6.3--I don't know how to make it work for everyone.

Edit: I updated to patch to use the LINUX_VERSION_CODE macro so that building now works on any kernel version

UmarJ commented on 2023-05-06 13:49 (UTC)

Apply this patch for compatibility with Linux 6.3 and above.

Source

diff --git a/ddcci/ddcci.c b/ddcci/ddcci.c
index ea76352..946574a 100644
--- a/ddcci/ddcci.c
+++ b/ddcci/ddcci.c
@@ -43,6 +43,7 @@ static DEFINE_SEMAPHORE(core_lock);

 struct bus_type ddcci_bus_type;
 EXPORT_SYMBOL_GPL(ddcci_bus_type);
+static bool ddcci_bus_registered;

 /* Assert neccessary string array sizes  */
 #ifndef sizeof_field
@@ -931,7 +932,7 @@ ATTRIBUTE_GROUPS(ddcci_char_device);

 /* DDC/CI bus */

-static int ddcci_device_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int ddcci_device_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
    struct ddcci_device *device = to_ddcci_device(dev);
    char model[ARRAY_SIZE(device->model)];
@@ -1011,7 +1012,7 @@ static void ddcci_device_release(struct device *dev)
    kfree(device);
 }

-static char *ddcci_devnode(struct device *dev,
+static char *ddcci_devnode(const struct device *dev,
             umode_t *mode, kuid_t *uid, kgid_t *gid)
 {
    struct ddcci_device *device;
@@ -1021,7 +1022,7 @@ static char *ddcci_devnode(struct device *dev,
             device->i2c_client->adapter->nr);
 }

-static char *ddcci_dependent_devnode(struct device *dev,
+static char *ddcci_dependent_devnode(const struct device *dev,
             umode_t *mode, kuid_t *uid, kgid_t *gid)
 {
    struct ddcci_device *device;
@@ -1100,7 +1101,7 @@ int ddcci_register_driver(struct module *owner, struct ddcci_driver *driver)
    int ret;

    /* Can't register until after driver model init */
-   if (unlikely(WARN_ON(!ddcci_bus_type.p)))
+   if (unlikely(WARN_ON(!ddcci_bus_registered)))
        return -EAGAIN;

    pr_debug("registering driver [%s]\n", driver->driver.name);
@@ -1672,8 +1673,9 @@ static int ddcci_detect(struct i2c_client *client, struct i2c_board_info *info)
 }

 /* I2C probe function */
-static int ddcci_probe(struct i2c_client *client, const struct i2c_device_id *id)
+static int ddcci_probe(struct i2c_client *client)
 {
+   const struct i2c_device_id *id = i2c_client_get_device_id(client);
    int i, ret = -ENODEV, tmp;
    unsigned char main_addr, addr;
    struct ddcci_bus_drv_data *drv_data;
@@ -1849,6 +1851,7 @@ static int __init ddcci_module_init(void)
        pr_err("failed to register bus 'ddcci'\n");
        goto err_busreg;
    }
+   ddcci_bus_registered = true;

    /* Register I2C driver */
    ret = i2c_add_driver(&ddcci_driver);
diff --git a/PKGBUILD b/PKGBUILD
index 9297d2b..e544baa 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -13,8 +13,15 @@ depends=('dkms')
 conflicts=("ddcci-driver-linux")
 source=(
   "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux/-/archive/v${pkgver}/ddcci-driver-linux-v${pkgver}.tar.gz"
+  "linux-6.3-rc2.patch"
 )
-b2sums=('71f855b8d7e4b9a1b5d38a73d4a6df7453e72600596121f68c6782f180211bd935ab30cf0cf94cc0528e8d5f732449d35b24cd9584d17083318d819b81a0b259')
+b2sums=('71f855b8d7e4b9a1b5d38a73d4a6df7453e72600596121f68c6782f180211bd935ab30cf0cf94cc0528e8d5f732449d35b24cd9584d17083318d819b81a0b259'
+        '77a9e85879d988bbc411c9238e59daa45d88c44330cfe1fc79897e1b6251881ade01f2d54951080dce9ba2c6e9371322e73ee8fc5da8bea8f5bf6e818f428a5f')
+
+prepare() {
+  cd "${srcdir}/ddcci-driver-linux-v${pkgver}"
+  patch --strip=1 --input="${srcdir}/linux-6.3-rc2.patch"
+}

 package() {
   local destdir="${pkgdir}/usr/src/ddcci-${pkgver}"

joshtau commented on 2023-04-02 11:12 (UTC) (edited on 2023-04-02 11:12 (UTC) by joshtau)

Yeah, I have to modprobe when my desktop env starts.

I have a super hacky script I whipped up in 30s, which is (note 6 is my monitor ID):

if [[ $(brightnessctl -d ddcci6) == "Device 'ddcci6' not found" ]]; then
    sudo modprobe ddcci
    sudo modprobe dcci_backlight
    echo 'ddcci 0x37' | sudo tee /sys/bus/i2c/devices/i2c-6/new_device
elif [ ! -d "/dev/bus/ddcci/6" ]; then
    sudo modprobe ddcci
    sudo modprobe dcci_backlight
    echo 'ddcci 0x37' | sudo tee /sys/bus/i2c/devices/i2c-6/new_device
else
    echo "Monitor brightness is already loaded."
    sudo dmesg | rg ddcci
fi

I have this in my labwc autostart file. If I wasn't lazy, or was using sway, I would have a systemd service which would listen for when the DE started.

dxwil commented on 2023-04-01 10:29 (UTC)

@Andrei_Korshikov I tried using your systemd file but it still did not work, dmesg returned this:

[ 26.153345] ddcci 4-0037: core device [6e] probe failed: -19 [ 26.153362] i2c i2c-4: new_device: Instantiated device ddcci at 0x37

Only modprobing ddcci when the desktop is loaded works for me so far

Andrei_Korshikov commented on 2023-04-01 04:02 (UTC)

@dxwill Maybe because of this? At least with my setup (laptop with external monitor) I have no luck with modules-load.d and have to craft systemd unit. Also look at joshtau comment below: "Sometimes in tty it won't work correctly", maybe you have to load ddcci only after your display manager.

Porous3247 commented on 2023-03-30 19:26 (UTC)

@dxwil the PKGBUILD copies the source to /usr/src/ddcci-${pkgver} then the building process invokes the Makefile provided by the package. That Makefile invokes Makefile.dkms which then invokes the modprobe command. So it seems that the developers of the package made it convenient for all of us.

dxwil commented on 2023-03-30 16:34 (UTC)

ddcci does not load through a file in /etc/modules-load.d/ddcci.conf, but only by manually modprobe'ing it, does anyone know why that might happen? Thanks

joshtau commented on 2023-03-30 04:07 (UTC)

I just tried it again and it worked, I have no idea what was going on but yesterday I was getting a git commit instead of a version number from that file.

Sorry for the noise, also I don't mind which checksum, as long as there is one :-).