• Other
  • Registers to control Intel graphics dithering on Linux located

About 10 years ago, the code to control dithering in the Linux driver for Intel graphics was contained in the source code for these two files, drivers/gpu/drm/i915/i915_reg.h and drivers/gpu/drm/i915/intel_display.c

I know today they are using different drivers, however maybe the hardware registers haven't changed since that time.

Could someone with Linux using Intel graphics hardware on a laptop with a 6-bit panel please load up a gradient image and try these commands to see if the image changes?

% sudo intel_reg_write 0x70008 0xc0000040 # no dither
% sudo intel_reg_write 0x70008 0xc0000050 # spatial
% sudo intel_reg_write 0x70008 0xc0000054 # ST

Edit: Before doing that, could you please also make a note of what the current register setting is before you change values? intel_reg_read 0x70008

    8 days later
    3 years later

    Sunspark I attempted this on Ubuntu 22.04 MATE. It looks like the syntax changed a bit but the command doesn't work.

    I suspect this slow motion could be dithering but I don't have a capture card to test yet: https://imgur.com/a/DXm8Nh0

    I tried the following which look like a no-op:

    ubuntu-mate@ubuntu-mate:~$ sudo intel_reg read 0x70008 --verbose
                           TRANS_CONF_A (0x00070008): 0x00000000 (disabled, inactive, pf-pd)
    
    
    ubuntu-mate@ubuntu-mate:~$ sudo intel_reg write  0x70008 0xc0000040 --verbose
    Before:
                           TRANS_CONF_A (0x00070008): 0x00000000 (disabled, inactive, pf-pd)
    After:
                           TRANS_CONF_A (0x00070008): 0x00000000 (disabled, inactive, pf-pd)
    
    
    ubuntu-mate@ubuntu-mate:~$ sudo intel_reg read 0x70008 --verbose
                           TRANS_CONF_A (0x00070008): 0x00000000 (disabled, inactive, pf-pd)

    Anyone have ideas?

    I believe I'm using the Intel driver:

    ubuntu-mate@ubuntu-mate:~$ lspci -nnk | egrep -i --color 'vga|3d|2d' -A3 | grep 'in use'
    	Kernel driver in use: i915
    	Kernel driver in use: serial
    
    ubuntu-mate@ubuntu-mate:~$ inxi -G
    Graphics:
      Device-1: Intel UHD Graphics 620 driver: i915 v: kernel
      Device-2: Cheng Uei Precision Industry (Foxlink) Webcam type: USB
        driver: uvcvideo
      Display: x11 server: X.Org v: 1.21.1.3 driver: X: loaded: modesetting
        unloaded: fbdev,vesa gpu: i915 resolution: 1920x1080~60Hz
      OpenGL: renderer: Mesa Intel UHD Graphics 620 (KBL GT2)
        v: 4.6 Mesa 22.2.5

    Here's a dump of all registers / the help file.

    And here's xrandr --props

    I also tried running ditherig (amd64) on WINE, and it doesn't work (as I expected) but worth a try. It is unable to identify the GPU.

    igfxtweak has some different values.

    OK writing to the active pipe:

    ubuntu-mate@ubuntu-mate:~$ sudo intel_reg read 0x7f008 
                         TRANS_CONF_EDP (0x0007f008): 0xc0000000 (enabled, active, pf-pd)
    ubuntu-mate@ubuntu-mate:~$ sudo intel_reg write 0x7f008 0xc0000040 --verbose
    Before:
                         TRANS_CONF_EDP (0x0007f008): 0xc0000000 (enabled, active, pf-pd)
    After:
                         TRANS_CONF_EDP (0x0007f008): 0xc0000000 (enabled, active, pf-pd)

    It's again a no-op. It seems to be ignoring my writes.

    However I guess it's using modesetting so maybe that's the reason?

    ubuntu-mate@ubuntu-mate:~$ inxi -G
    Graphics:
      Device-1: Intel UHD Graphics 620 driver: i915 v: kernel
      Device-2: Cheng Uei Precision Industry (Foxlink) Webcam type: USB
        driver: uvcvideo
      Display: x11 server: X.Org v: 1.21.1.3 driver: X: loaded: modesetting
        unloaded: fbdev,vesa gpu: i915 resolution: 1920x1080~60Hz
      OpenGL: renderer: Mesa Intel UHD Graphics 620 (KBL GT2)
        v: 4.6 Mesa 22.2.5

      ryans You need to install the xf86-video-intel package and edit or create the /etc/X11/xorg.conf.d/20-intel.conf file. Read https://wiki.archlinux.org/title/Intel_graphics for more details. I've done it, it will work, but only for x.org not Wayland. Read my notes on configuring the file here: https://ledstrain.org/d/1780-different-rendering-settings-on-intel-linux-drivers-affects-comfort

      I never actually tested the registers, but I figure if you switch to the other driver it will probably work and hey, in the meantime you will get to play with a different driver and different combinations of settings.

        Sunspark Thanks, I will try it, praying it helps me. Looks like modesetting / Wayland are popular these days.

        Do you still use X.org / xf86-video-intel / UXA as the most comfortable?

          ryans Where I last left off on this machine, yes, but I don't use Linux on this machine because Windows is better for my setup both in looks and UI. I do use Linux on the steam deck though and it seems ok but still a work in progress (so-so Windows, so-so x.org, seems decent enough on their Wayland game mode interface). Comparison is also complicated by the fact that I can't use the same monitor port or adapter.

          Just copy the conf file I made in the other thread. Reboot and play with it awhile. Then edit it, change it to SNA, reboot and do the same thing. Then rename it to .xxx and reboot so the modesetting one activates next.

          The x86 intel driver for x.org is no longer developed (it was 1 guy), so your milage will vary depending on how old your igpu is.

          9 days later

          Has anyone been able to get this to work? I have not.

          I have Fedora with intel iris xe using the i915 driver.

          My default value is …24 (enabled …)

          [asdf@fedora ~]$ sudo intel_reg read 0x70008

                             TRANS_CONF_A (0x00070008): 0xc0000024 (enabled, active, pf-pd)

          I have tried setting it to 0xc0000040 with no effect. The number value can change, but the string still says (enabled, active, pf-fd).

          I have also for fun tried oxc0000000. No luck.

          Tried also 0x00000000, which froze the system.

          Is there documentation anywhere that lists what these registry things and their values are? I could not find anything by searching online.

            a month later

            Have not heard back from you folks on whether this works or not.

            I have tried a few times to set registers via "intel_reg write …". Quite frequently the system freezes when doing this.

            • JTL replied to this.

              caboy My only guess is to figure out what ditherig and the Windows driver do "differently". Not a trivial task.

              Not to mention, these registers are from many years ago now. Entirely possible that nowadays it is something different.

              If you are able to read it, the source code for ditherig is on Github and should tell you which registers the author uses these days. https://github.com/skawamoto0/ditherig

              • JTL replied to this.

                Sunspark Not to mention, these registers are from many years ago now. Entirely possible that nowadays it is something different.

                I've located certain datasheets that imply they are still the same for Intel Xe graphics.

                5 months later

                I'm trying Ubuntu 22.04 (vanilla/GNOME) again 🙂. @Sunspark Is there a way to tell if xf86-video-intel is loaded or not? I'm not sure I did it right.

                $ sudo inxi -G
                Graphics:
                  Device-1: Intel UHD Graphics 620 driver: i915 v: kernel
                  Device-2: Cheng Uei Precision Industry (Foxlink) Webcam type: USB
                    driver: uvcvideo
                  Display: server: X.Org v: 1.21.1.4 driver: X: loaded: intel gpu: i915
                    resolution: 1920x1080~60Hz
                  OpenGL: renderer: Mesa Intel UHD Graphics 620 (KBL GT2)
                    v: 4.6 Mesa 23.0.4-0ubuntu1~22.04.1

                Trying the intel_gpu commands sadly have no impact:

                $ sudo intel_reg write 0x7f008 0xc0000040 --verbose
                Before:
                                     TRANS_CONF_EDP (0x0007f008): 0xc0000000 (enabled, active, pf-pd)
                After:
                                     TRANS_CONF_EDP (0x0007f008): 0xc0000000 (enabled, active, pf-pd)

                And the conf file:

                $ cat /etc/X11/xorg.conf.d/20-intel.conf 
                Section "Device"
                Identifier      "Intel Graphics"
                Driver          "intel"
                Option          "DRI"           "3"
                Option          "AccelMethod"   "UXA"   # SNA is normal default
                #Option         "TearFree"      "true"
                EndSection

                Another idea I had was trying to disable Intel power-saving, doing a fake EDID and other settings here like Dac6bit, or on xrandr

                I can't quickly check because stupid Valve left out inxi on theirs (along with other stuff). But, I think it is correct because it says "Loaded: intel" so now you need to rename the file to .bak or something, and compare the modesetting driver next..

                I'm going to suggest to you not to use Gnome. Use KDE instead, so that means Kubuntu http://cdimage.ubuntu.com/kubuntu/releases/22.04/release/. KDE does have better fractional scaling than Gnome, which makes a difference if you're not using 100% or 200% scaling. If you are, then it doesn't matter. I prefer KDE. Lots of flippy switches and customizability.

                Forget about the gpu registers.. too much time has passed. What I will suggest instead for external monitors is a custom modeline.. you can dial in the refresh rate you want pretty precisely w/ different blanking intervals, etc. On my monitor the default EDID sets it to 59.876 (not even 59.94!), but I did spend awhile on the deck comparing various modelines to get it to 60.000 and seeing which one I thought seemed ok and found one that seems ok to use.. xrandr is what you use to set and switch refresh rates in x.org. To calculate the numbers they can come from various sources, the one I ended up on was "Exact" from CRU. To convert the numbers from CRU, it is easy.. you just add them one after the other.. so if it says 1920 48 32 80 as an example, then 1920 1968 2000 2080 for the Linux modeline version.

                I don't use Linux as my desktop, I just play with it on the deck to see if I can customize it to the point of liking it. Windows 10 is still my main desktop.

                  7 days later

                  I've tried playing around with some grub configs (based on this Intel post), but I can't get rid of this gray square flickering (slow motion)

                  For reference:

                  GRUB_CMDLINE_LINUX_DEFAULT="quiet splash i915.enable_dithering=0 i915.enable_psr=0 i915.dpst=0 i915.enable_dc=0 i915.enable_rc6=0 i915.enable_fbc=0 i915.panel_use_ssc=0 i915.alpha_support=0 i915.enable_ips=0 i915.enable_dpcd_backlight=0 intel_idle.max_cstate=2"

                  I'd like to disable all these somehow too.

                  • KM replied to this.

                    caboy I have tried setting it to 0xc0000040 with no effect. The number value can change, but the string still says (enabled, active, pf-fd).

                    I have also for fun tried oxc0000000. No luck.

                    I wonder if secure boot could be "protecting" these registers somehow.

                    • JTL replied to this.
                      dev