Package Details: intelpwm 1.1-1

Git Clone URL: https://aur.archlinux.org/intelpwm.git (read-only, click to copy)
Package Base: intelpwm
Description: PWM frequency setting on Intel HD Graphics with modprobe.d
Upstream URL: https://127001.me/post/eliminate-backlight-flicker-with-i915/
Licenses: GPL
Submitter: nikatar
Maintainer: nikatar (carrothu)
Last Packager: carrothu
Votes: 3
Popularity: 0.000000
First Submitted: 2020-04-21 12:04 (UTC)
Last Updated: 2022-05-13 11:29 (UTC)

Dependencies (1)

Required by (0)

Sources (3)

Pinned Comments

nikatar commented on 2020-04-21 12:16 (UTC) (edited on 2020-04-21 12:41 (UTC) by nikatar)

Fix PWM on your display.

It's based on: https://aur.archlinux.org/packages/intelpwm-udev

But here modprobe.d is used instead of udev. This allows the backlight controls in various DEs aware about of the new PWM frequency and work correctly.

Also now you can normally set the PWM frequency in ordinary Hz in the config file, forgetting about hexs.

Default frequency is 860Hz. Tested on Thinkpad X230

Latest Comments

nikatar commented on 2022-05-13 10:01 (UTC)

@carrothu, welcome!

carrothu commented on 2022-05-13 01:18 (UTC)

@nikatar OK, I'll try to maintain this package.

nikatar commented on 2022-05-12 22:25 (UTC)

@carrothu, if you wish, I can give you this package, because I no longer need it and have no personal interest in maintaining it

You can maintain this package further and contribute to the community

carrothu commented on 2022-04-30 03:18 (UTC) (edited on 2022-04-30 03:33 (UTC) by carrothu)

According to the post https://127001.me/post/eliminate-backlight-flicker-with-i915/, I adjusted the script to enhace the the compatibility. I'll be glad if you merge them into the repository.

Here's the new script:

/usr/bin/intelpwm

#!/usr/bin/env bash

source /etc/intelpwm.conf 1>/dev/null 2>&1 || >&2 echo "WARN:  /etc/intelpwm.conf does not exit"


if [ -z "$FREQ" ]; then
  >&2 echo "ERROR: FREQ is not defined. Specify in /etc/intelpwm.conf or in environment"
  exit 1
fi

function reg_read() {
  # this assumes fixed position of the value in intel_reg output
  # so far this has been the case though
  intel_reg  read "$1" | cut -c51-60
}

PCH_FREQ="$(reg_read ${PCH_RAWCLK_FREQ_REG})"
BLC_CTL2="$(reg_read ${BLC_PWM_PCH_CTL2_REG})"
CYCLE="${BLC_CTL2:6:4}"
HEX=$(printf "0x%08x" $((1000000*PCH_FREQ/128/FREQ)))
PERIOD="${HEX:6:9}"

>&2 echo "Writing 0x${PERIOD}${CYCLE} to register ${BLC_PWM_PCH_CTL2_REG}"
intel_reg write "${BLC_PWM_PCH_CTL2_REG}" "0x${PERIOD}${CYCLE}"

/etc/intelpwm.conf

# backlight PWM frequency in Hz
FREQ=860

# intelpwm reads PCH frequency from this register
PCH_RAWCLK_FREQ_REG=0xc6204

# intelpwm modifies 4 upper bytes of this register
BLC_PWM_PCH_CTL2_REG=0xc8254

I've tested the script on my Lenovo Miix510.

nikatar commented on 2021-02-21 09:23 (UTC)

Frankly, I can't say for sure. I didn't notice any changes for the external display. Probably they have their own PWM controller

Autodidaddy commented on 2021-02-19 23:19 (UTC)

I'm trying to get rid of screen flickering. I have Intel HD Graphics on a laptop. My question is; does this only apply to internal led screen or also for external led screen?

nikatar commented on 2020-04-21 12:16 (UTC) (edited on 2020-04-21 12:41 (UTC) by nikatar)

Fix PWM on your display.

It's based on: https://aur.archlinux.org/packages/intelpwm-udev

But here modprobe.d is used instead of udev. This allows the backlight controls in various DEs aware about of the new PWM frequency and work correctly.

Also now you can normally set the PWM frequency in ordinary Hz in the config file, forgetting about hexs.

Default frequency is 860Hz. Tested on Thinkpad X230