I've an MSI GS66 Stealth laptop which came with Windows installed, alongside which I installed Ubuntu 18.04 with NVIDIA proprietary drivers.
Connecting an external monitor to my laptop through HDMI is how I've been using my laptop these days as the laptop's screen doesn't show anything: the screen doesn't have any glow, it's just "off". In this post I refer to the laptop's screen as the primary display and an external monitor connected via HDMI as the secondary display.
I'm looking for help in bringing the primary display back.
How it came to this
I had a secondary display connected and was working away with both screens functional. Took a break and didn't press any keys or move the mouse for a few minutes and I saw the laptop screen go dim and then completely dark. This looked a little odd because if the laptop was going into sleep because of inactivity, the secondary display should follow suit. However, it's just my laptop screen that turned dark/off. Keyboard backlight kept glowing as normal.
Restarting the laptop made no difference. After that episode, I always need a secondary display else I'm sitting blind without knowing what is going on.
System details
inxi -G
Graphics: Card-1: Intel CometLake-H GT2 [UHD Graphics]
Card-2: NVIDIA TU106M [GeForce RTX 2070 Mobile / Max-Q Refresh]
Display Server: x11 (X.Org 1.20.8 ) drivers: i915,nvidia
Resolution: 1920x1080@60.00hz
OpenGL: renderer: NVIDIA GeForce RTX 2070 with Max-Q Design/PCIe/SSE2
version: 4.6.0 NVIDIA 520.61.05
nvidia-smi
(first line)
NVIDIA-SMI 520.61.05 Driver Version: 520.61.05 CUDA Version: 11.8
xrandr
Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 598mm x 336mm
1920x1080 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
1024x768 75.03 60.00
800x600 75.00 60.32
720x576 50.00
720x480 59.94
640x480 75.00 59.94 59.93
DP-4 disconnected (normal left inverted right x axis y axis)
eDP-1-1 connected primary (normal left inverted right x axis y axis)
15360x8640 15.83 28.85
7680x4320 15.83 59.99 59.99 59.99
5120x2880 59.99 59.99
4096x2304 59.99 59.98
3840x2160 60.00 60.01 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
1792x1344 60.01
2048x1152 59.99 59.98 59.90 59.91
1920x1200 59.88 59.95
1920x1080 60.01 59.97 59.96 59.93
1600x1200 60.00
1680x1050 59.95 59.88
1600x1024 60.17
1400x1050 59.98
1600x900 59.99 59.94 59.95 59.82
1280x1024 60.02
1440x900 59.89
1400x900 59.96 59.88
1280x960 60.00
1440x810 60.00 59.97
1368x768 59.88 59.85
1360x768 59.80 59.96
1280x800 59.99 59.97 59.81 59.91
1152x864 60.00
1280x720 60.00 59.99 59.86 59.74
1024x768 60.04 60.00
960x720 60.00
928x696 60.05
896x672 60.01
1024x576 59.95 59.96 59.90 59.82
960x600 59.93 60.00
960x540 59.96 59.99 59.63 59.82
800x600 60.00 60.32 56.25
840x525 60.01 59.88
864x486 59.92 59.57
800x512 60.17
700x525 59.98
800x450 59.95 59.82
640x512 60.02
720x450 59.89
700x450 59.96 59.88
640x480 60.00 59.94
720x405 59.51 58.99
684x384 59.88 59.85
680x384 59.80 59.96
640x400 59.88 59.98
576x432 60.06
640x360 59.86 59.83 59.84 59.32
512x384 60.00
512x288 60.00 59.92
480x270 59.63 59.82
400x300 60.32 56.34
432x243 59.92 59.57
320x240 60.05
360x202 59.51 59.13
320x180 59.84 59.32
1680x1050 (0x1c5) 146.250MHz -HSync +VSync
h: width 1680 start 1784 end 1960 total 2240 skew 0 clock 65.29KHz
v: height 1050 start 1053 end 1059 total 1089 clock 59.95Hz
1280x1024 (0x1c8) 108.000MHz +HSync +VSync
h: width 1280 start 1328 end 1440 total 1688 skew 0 clock 63.98KHz
v: height 1024 start 1025 end 1028 total 1066 clock 60.02Hz
1280x800 (0x1c9) 83.500MHz -HSync +VSync
h: width 1280 start 1352 end 1480 total 1680 skew 0 clock 49.70KHz
v: height 800 start 803 end 809 total 831 clock 59.81Hz
1024x768 (0x1ce) 65.000MHz -HSync -VSync
h: width 1024 start 1048 end 1184 total 1344 skew 0 clock 48.36KHz
v: height 768 start 771 end 777 total 806 clock 60.00Hz
800x600 (0x1d0) 40.000MHz +HSync +VSync
h: width 800 start 840 end 968 total 1056 skew 0 clock 37.88KHz
v: height 600 start 601 end 605 total 628 clock 60.32Hz
640x480 (0x1d4) 25.175MHz -HSync -VSync
h: width 640 start 656 end 752 total 800 skew 0 clock 31.47KHz
v: height 480 start 490 end 492 total 525 clock 59.94Hz
sudo lshw -c video
*-display
description: VGA compatible controller
product: TU106M [GeForce RTX 2070 Mobile / Max-Q Refresh]
vendor: NVIDIA Corporation
physical id: 0
bus info: pci@0000:01:00.0
version: a1
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
configuration: driver=nvidia latency=0
resources: irq:186 memory:ac000000-acffffff memory:80000000-8fffffff memory:90000000-91ffffff ioport:3000(size=128) memory:ad000000-ad07ffff
*-display
description: VGA compatible controller
product: CometLake-H GT2 [UHD Graphics]
vendor: Intel Corporation
physical id: 2
bus info: pci@0000:00:02.0
version: 05
width: 64 bits
clock: 33MHz
capabilities: pciexpress msi pm vga_controller bus_master cap_list rom
configuration: driver=i915 latency=0
resources: irq:183 memory:ab000000-abffffff memory:40000000-4fffffff ioport:4000(size=64) memory:c0000-dffff
"Display settings" screenshots
Single Display
is enabled by default. I've a BenQ monitor connected at the moment, at work I've an HP monitor.

On going to Join Displays
, primary display has an unusually high resolution 15360 x 8640
(I don't remember ever setting that high a resolution) and an even weirder refresh rate of 15.83 Hz
(what?!).

On "correcting" the resolution of primary display to 1920 x 1080
(refresh rate automatically switches to a much saner 120 Hz
) and hitting Apply, primary display still remains blank. And Display settings go back to Single Display (first screenshot).

I know the primary display exists because I can move the mouse pointer "out" of the secondary display.
When booting my laptop, the Ubuntu login screen shows up on my secondary display — GRUB menu never shows up, likely because HDMI drivers are not loaded up before an operating system is selected? — after I assume the GRUB menu has timed out.
Is there anything I can do in software? Or is something wrong with the hardware? The video Laptop Screen is Black (But Still Powered On and Running!) looked useful but I don't want to go about opening up my work laptop without knowing what I'm getting into.