1

I wanted to switch off power to my laptop monitor when plugged in to an external monitor, as on my distro (Manjaro 20.2), disabling the laptop screen with xrandr/arandr doesn't switch off the backlight, and a non-blinking cursor is left visible.

In my pursuit of the above setup, I have done something or other to my computer, and now, my laptop monitor gets no output, and is no longer visible to xrandr. For my sins, I now cannot remember what it was that I did. Believe me, I'm not impressed with myself either.

Running xrandr -q gives me the below:

Screen 0: minimum 8 x 8, current 2560 x 1080, maximum 32767 x 32767
HDMI-0 connected primary 2560x1080+0+0 (normal left inverted right x axis y axis) 798mm x 334mm
   2560x1080     59.98*+  74.99    50.00  
   3840x2160     29.97    25.00    23.98    23.98  
   2560x1440     59.95  
   1920x1080     75.00    60.00    59.94    50.00  
   1680x1050     59.95  
   1600x900      60.00  
   1280x1024     75.02    60.02  
   1280x800      59.81  
   1280x720      60.00    59.94    50.00  
   1152x864      60.00  
   1024x768      75.03    60.00  
   800x600       75.00    60.32  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    59.93    59.94

Clearly, my laptop monitor (which was called something like eDP-1-1) is not available here.

What can I do to get my laptop monitor back in action?


EDIT

Some more details based on @TelcoM's updated answer:

My integrated GPU is indeed an Intel, and my discrete GPU is NVIDIA. By the looks of my Xorg log, the NVIDIA GPU uses the NVIDIA driver, and presumably the Intel GPU is meant to use the standard Intel driver, but I don't know how to add those, or how to check if they're already there.

Here's my Xorg log - https://pastebin.com/X8F5k1BS

Also the output of fbset -i:

mode "1920x1080"
    geometry 1920 1080 1920 1080 32
    timings 0 0 0 0 0 0 0
    accel true
    rgba 8/16,8/8,8/0,0/0
endmode

Frame buffer device information:
    Name        : i915drmfb
    Address     : (nil)
    Size        : 8294400
    Type        : PACKED PIXELS
    Visual      : TRUECOLOR
    XPanStep    : 1
    YPanStep    : 1
    YWrapStep   : 0
    LineLength  : 7680
    Accelerator : No

EDIT

In my original question, I outline how I thought that some messing around with grub had caused my problem. Some digging off the back of @telcoM's answer would lead me to now believe that that wasn't the issue after all.

My conclusion is that I did something else silly while I was tired, and didn't make a note of what it was, so now I'm really stumped. I'm now just looking for a general way of diagnosing why my laptop monitor isn't visible to xrandr, and how to fix it.


Original Question Details

I followed this question as a starting point, which advised editing /etc/default/grub to add video={monitor}:d to the end of the GRUB_CMDLINE_LINUX_DEFAULT setting, where {monitor} is the name of the monitor according to xrandr -q. It wasn't clear about whether the monitor to use here was the laptop screen or the external monitor, so I went with the external monitor, ending up with:

GRUB_CMDLINE_LINUX_DEFAULT="quiet udev.log_priority=3 video=HDMI-0:d"

This didn't have the effect that I wanted of showing GRUB on the external monitor, nor did it switch off the backlight of the laptop screen. Moreover, it removed the laptop screen (which was called something like eDP-1-1) from the list of available xrandr screens. Now I can't get output to my laptop screen at all.

How can I try to diagnose this?

1 Answer 1

0

If that was the only change you did, it takes effect only after GRUB has done its job and the kernel takes over. If you had the ability to see the GRUB boot menu before you made your change, you should still be able to see it.

Normally, you can press any key at the GRUB boot menu to interrupt the automatic boot process, then move the selection bar to the kernel you wish to boot, and then press the E key to edit the boot entry before executing it.

What makes things a bit more complicated is that /etc/default/grub is a pre-configuration file that gets pre-processed into the real GRUB configuration file. As you choose to edit the boot entry at boot time, you'll see quite many lines of text you can edit. Typically, your GRUB_CMDLINE_LINUX_DEFAULT setting would be used to form a configuration line that will look something like this:

        linux   /vmlinuz-<version number> <other options> quiet udev.log_priority=3 video=HDMI-0:d <possibly some more options>

Just find a line like that, and delete the video=HDMI-0:d part that's causing problems for you.

Note: everything you do in GRUB's boot-time "boot entry editing mode" is non-persistent: any changes you make there will take effect for that one boot only. Once you get back into Linux proper, you can hopefully have your screen display back, and will be able to edit /etc/default/grub again, and then run sudo update-grub again to make persistent changes.

Many modern laptops have dual GPUs: a CPU-integrated power-efficient GPU for minimizing battery power use, and another discrete GPU chip for when increased display performance is needed. Unfortunately, some laptop manufacturers have taken the cheapest way out: the system firmware will only operate the CPU-integrated GPU, and let the operating system worry about initializing the second GPU. This means such laptops will only be able to display the firmware configuration menus and the early part of the boot process on the internal display, and on any external displays that have been physically connected to the first GPU.

One rather typical dual-GPU set-up seems to be that the internal display and the VGA output connector are wired to the first GPU, and any digital output connectors like HDMI or DisplayPort to the second more powerful GPU. The rationale seems to be that if you have an external HD display connected, you'll also very likely have external power connected, and so battery power consumption won't be an issue. Unfortunately such a construction might restrict you to using the internal display for boot troubleshooting and BIOS access, so you won't be able to set up a 100% "pure" external-display-only configuration.

A more high-quality dual-GPU implementation will be able to switch outputs from one GPU to another, and might have settings in the BIOS menus to select which GPU to use at boot time, if both GPUs seem to have displays connected to them.


Without knowing more details about your hardware (the types of both GPUs, mainly) it's hard to give exact instructions. The discrete GPU may also have two sets of drivers to choose from: both ATI/AMD and Nvidia GPUs have a proprietary binary driver and an open-source driver available.

Your first step should probably be trying to get the kernel modesetting drivers for both GPUs loaded: first the one for whatever you want to use as the "primary" display, so the kernel's text-mode display starts initially in a useful location.

Once those are present, it's time to see how the X11 server sees the GPUs: if the kernel modesetting drivers are loaded, and X11 driver modules for both GPUs are installed, it just might auto-detect both GPUs as both now seem to have displays attached to them. If not, you might have to write at least a partial xorg.conf file to drop in /etc/X11/xorg.conf.d, to tell the X server to expect two GPUs, not just one.

Then, you should be able to see both GPUs in the xrandr --listproviders output. Once you have that, xrandr --setprovideroutputsource 1 0 or similar will couple the GPUs together into a single display system, and bring the other GPUs displays/display connectors available for xrandr - or for your desktop environment of choice's GUI display configuration tool, for that matter. Then it should be just a matter of selecting the display resolutions you want to use, and configuring the physical locations of the displays relative to each other so that the mouse pointer's transition from one screen to another makes sense.

4
  • Thanks for such an in-depth response. Taking a look through the boot-time GRUB configuration, I see the line you mention, and no matter what I do with the video=whatever part, xrandr still doesn't see my laptop monitor. I can only assume I did something else too late at night, and now can't remember what it is. I might edit the question to reflect the fact that messing around with GRUB doesn't appear to have caused this, and that I now just need a way of diagnosing this step-by-step.
    – murchu27
    Feb 17, 2021 at 18:59
  • Also, thanks for that info about typical dual-GPU setups not outputting to the discrete GPU during the early boot process. That would explain why I'm having trouble getting GRUB to show up on my external display!
    – murchu27
    Feb 17, 2021 at 19:00
  • My guess would be, you may have switched the X server and/or the kernel framebuffer driver from using the Intel driver module to whatever the other GPU is (Nvidia or ATI/AMD, probably). The contents of /var/log/Xorg.0.log would most likely contain a lot of clues. cat /proc/fb and fbset -i would give information on what the kernel thinks it's now displaying on.
    – telcoM
    Feb 17, 2021 at 19:52
  • I'll update the question with the information in Xorg.0.log and the output of those commands. Just a bit confused by the update to your answer: how do I load the kernel modesetting drivers for my GPUs? I was trying to follow the instructions here, but I'm not really sure what to do now that I've added that kernel parameter.
    – murchu27
    Feb 18, 2021 at 15:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .