You are not logged in.

#1 2021-06-11 12:10:26

erlanger
Member
Registered: 2020-06-22
Posts: 2

INTEL screen tears, NVIDIA can't control backlight; what to do?

Hello all,

I've recently acquired a Thinkpad P17, a laptop with both integrated Intel graphics and discrete Nvidia graphics (and a 17.3" UHD (3840 x 2160) IPS display). My problem is this:

  1. When using Intel, backlight control works (through /sys/class/backlight/intel_backlight/brightness), but there is significant screen tearing in glxgears and general video playback (mpv, youtube, etc.). Note the locaiton of tearing does not move (it is near the top of the screen), so the problem AFAIK is not with the refresh rate.

  2. When using Nvidia, there is no screen tearing, but I cannot control the backlight (I see /sys/class/backlight/nvidia-0/brightness, but writing to the file has no effect).

What I've tried for Intel:

  1. Changing the acceleration methodas in

    Section "Device"
      Identifier "Intel Graphics"
      Driver "modesetting"
      Option "TripleBuffer" "true"
      Option "TearFree" "true"
    EndSection

    I tried this both with and without TripleBuffer.

  2. Enabling PRIME using the modesetting driver and the nvidia-drm.modeset=1 kernel parameter. Unfortunately xrandr shows that  PRIME Synchronization is only active for externally display ports such as HDMI-0 and DP-0 (note that I have no external displays attached.). I then tried using xrandr --setprovideroffloadsink, but the command errors and there is no effect.

  3. Switching to the xf86-video-intel driver.

  4. Using acclerated H.264 decoding thorugh libva-intel-driver-g45-h264

What I've tried for NVIDIA (note that, to use the NVIDIA card, I selected discrete graphics in my BIOS, so the integrated Intel graphics should be invisible to the Kernel):

  1. Both the nvidia proprietary driver and nouveau.

  2. Configuring xorg as in

    Section "Device"
    	Identifier "nvidia"
    	Driver "nvidia"
    	BusID "PCI:1:0:0"
    	Option "RegistryDwords" "EnableBrightnessControl=1"
    EndSection
  3. Installing acpid, enabling it, and rebooting.

  4. All of the following kernel parameters (under the proprietary driver):

    acpi_backlight=video
    acpi_backlight=vendor
    acpi_backlight=native
    acpi_backlight=none
  5. I can control the "brightness" through xrandr --brightness, but this is not the same as controling the backlight.

And with all that, I'm stuck. Any ideas? If logs and such are needed, please ask.

Offline

#2 2021-06-11 12:48:51

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,657

Re: INTEL screen tears, NVIDIA can't control backlight; what to do?

Use an actual compositor for the intel/modesetting case and make sure it isn't implicitly disabled for fullscreen applications. FWIW both TripleBuffer and TearFree are non existent options of the modesetting driver

Offline

#3 2021-06-11 14:01:30

seth
Member
Registered: 2012-09-03
Posts: 51,017

Re: INTEL screen tears, NVIDIA can't control backlight; what to do?

Note the locaiton of tearing does not move (it is near the top of the screen), so the problem AFAIK is not with the refresh rate.

That doesn't sound unsynced, so a syncing compositor will - likely - not help.
Does glxgears suggest that it's syncing? To what frequency and what's the output of "xrandr -q"?

For mpv, does

mpv -vo=gpu --video-sync=display-resample mymostfavoriteporn.mp4

prevent tearing?

Offline

#4 2021-06-19 02:07:15

erlanger
Member
Registered: 2020-06-22
Posts: 2

Re: INTEL screen tears, NVIDIA can't control backlight; what to do?

Thanks for the help!

V1del wrote:

Use an actual compositor for the intel/modesetting case and make sure it isn't implicitly disabled for fullscreen applications. FWIW both TripleBuffer and TearFree are non existent options of the modesetting driver

I installed picom and set

xrender-sync-fence = true  # needed to eliminate a few warnings
unredir-if-possible = false

as configuration. When I run picom, there is a substantial improvement: glxgears doesn't tear at all, web browser scrolling doesn't tear, and general video tearing is greatly reduced. A video such as this shows some tearing, though the tearing is much worse in mpv (perhaps that is a clue?).

seth wrote:

Note the locaiton of tearing does not move (it is near the top of the screen), so the problem AFAIK is not with the refresh rate.

That doesn't sound unsynced, so a syncing compositor will - likely - not help.
Does glxgears suggest that it's syncing? To what frequency and what's the output of "xrandr -q"?

For mpv, does

mpv -vo=gpu --video-sync=display-resample mymostfavoriteporn.mp4

prevent tearing?

You made me notice that, while screen tearing seems worse at that top position (which is not simply a straight horizontal line, by the way---it looks like \________ ), it still happens across the display.

glxgears claims it is syncing, but with the compositor disabled, I see the static \_____ tearing near the top. Here's some output:

Running synchronized to the vertical refresh.  The framerate should be
approximately the same as the monitor refresh rate.
354 frames in 5.0 seconds = 70.593 FPS
301 frames in 5.0 seconds = 60.000 FPS
301 frames in 5.0 seconds = 60.003 FPS
301 frames in 5.0 seconds = 60.004 FPS

The head of "xrandr -q" looks like this:

Screen 0: minimum 320 x 200, current 3840 x 2160, maximum 16384 x 16384
eDP-1 connected primary 3840x2160+0+0 (normal left inverted right x axis y axis) 382mm x 215mm
   3840x2160     60.00*+  59.98    59.97  
   3200x1800     59.96    59.94  
   2880x1620     59.96    59.97  
   2560x1600     59.99    59.97  
   2560x1440     59.99    59.99    59.96    59.95  
   2048x1536     60.00  
   1920x1440     60.00  
   1856x1392     60.01

Running mpv  with those settings doesn't seem to have an effect without the compositor enabled. With the compositor enabled, the settings seem to make the video a bit "laggy" (perhaps lower frame rate; I can't tell) and the tearing persists.

Overall, with the compositor, the tearing is bearable, though still existent. Do either of you have any thoughts on the NVIDIA issue? Is there a way to control the backlight without dealing with driver issues? (perhaps through MMAP on the card or display?)

Last edited by erlanger (2021-06-19 02:10:58)

Offline

#5 2021-06-19 11:24:47

seth
Member
Registered: 2012-09-03
Posts: 51,017

Re: INTEL screen tears, NVIDIA can't control backlight; what to do?

The internal output is likely wired to the intel chip why you can't control it through nvidia - the Fn brightness keys are OS controlled rather than UEFI and don't work?
It's likely also the reason why you'd get tearing because the nvidia chip doesn't get the vblank signal or only gets it w/ a delay.

When you don't disable the intel output, do you run X11 on the nvidia GPU nevertheless? Or on the intel chip?
Xorg log?

Offline

Board footer

Powered by FluxBB