# Monitor screen splits in half vertically



## trev (Aug 31, 2021)

From time to time my monitor screen gets split in half vertically when I'm in Xorg. Exiting from Xorg to the console screen and the screen is still split in half vertically. The right side of the screen extends into the left side of the screen if I move the cursor off the screen to the right.

I don't believe it is an Xorg issue but if it matters I use twm for my window manager.

I've been using FreeBSD since 2.1 and have never had this happen before. Currently using FreeBSD 12.2-STABLE (August 25) amd64 on a 2011 Mac mini. The issue first occurred a couple of months ago.

The only way to resolve it it is to reboot. Weird. Anyone have any ideas?


----------



## SirDice (Aug 31, 2021)

trev said:


> From time to time my monitor screen gets split in half vertically when I'm in Xorg.


That's strange. Might be the monitor that's doing it though. My Asus PG279Q has a bit of a quirk every now and then whenever I switch inputs or resolution.  The screen is split in half vertically (that sounds similar to yours) and the right half of the screen is shifted a couple of pixels to the left. In my case it's clearly the monitor that's doing it, not the graphics card, if I switch inputs just once the normal picture is restored. If possible I would try using a different monitor for a while and see if it happens again. If the problem disappears it was the monitor.


----------



## trev (Aug 31, 2021)

I don't believe it's the monitor - if I connect another computer, the monitor screen is normal.

I just did an xv screen capture to demo the issue, but the screen capture is normal!


----------



## SirDice (Aug 31, 2021)

trev said:


> I just did an xv screen capture to demo the issue, but the screen capture is normal!


Graphics cards are basically split up into two sections, there's one part that does the rendering and builds the image on a display viewport. Then there's a part that reads the information from the viewport and produces the correct signals and bit streams for the monitor output.

I'm actually trying to create my own graphics chipset using an FPGA for a 65816 CPU based computer I'm trying to design and build. I've been studying a lot of similar projects to wrap my head around how graphics cards actually work and produce a picture.


----------



## trev (Aug 31, 2021)

Here's what it looks like.


----------



## SirDice (Aug 31, 2021)

It's unlikely to be caused by the graphics card due to the way the bitstreams work. The signals are drawn line by line with the appropriate sync pulses (HSync) at the end of the line and at the bottom of the screen (VSync). If there was any problem with that you would expect to see a horizontal split, not a vertical one. A vertical split would mean the bitstream for that line was interrupted half way through, for each line, every time. That's unlikely to happen. 

A modern wide screen LCD monitor is actually two panels, one left and one right, that are combined in a single panel. And each half has a separate controller. So here it's quite possible one of the halves isn't working properly. Or there's something amiss with the "master" controller that splits up the image to the two half panel controllers.


----------



## covacat (Aug 31, 2021)

looks like the a gpu register is set wrong and the internal fb image is scanned from an offset which is not a multiple of the horizontal res


----------



## trev (Sep 1, 2021)

I've ruled out the monitor - I can connect 3 other systems (FreeBSD and macOS and Windows) to it and it's fine, reconnect the original FreeBSD system and back to a split screen.

I wish I knew what I do to cause it. It has something to do with the mouse and I cannot rule out also touching the left side of the keyboard at the same time. Last night I was clicking the mouse to enlarge a Proton Mail new email window in SeaMonkey when it happened.


----------



## eternal_noob (Sep 1, 2021)

trev said:


> Currently using FreeBSD 12.2-STABLE


Maybe try a RELEASE version of FreeBSD, the development versions are not guaranteed to work.


----------



## trev (Sep 1, 2021)

I see someone else had a similar issue in FreeBSD 11: https://forums.freebsd.org/threads/screen-split-into-half.57449/

I use STABLE because over the years I have submitted patches against it for the asmc(4) KLM to support various Mac mini models. I have another patch ready to go (2014 model), just holding off until I can get one done for the 2012 model.


----------



## sidetone (Sep 1, 2021)

Could it be the graphics modules, VESA or other graphics devices in the Kernel? As you said, this also happens outside of X11.


----------



## SirDice (Sep 1, 2021)

sidetone said:


> As you said, this also happens outside of X11.


After exiting X if I understood correctly. It would be worthwhile to check if it still happens if you never started X. It's possible the X driver throws the card into some weird state, and this state is kept when exiting X. But it may not happen if X is not started at all.


----------



## trev (Sep 1, 2021)

sidetone & SirDice:

It has only happened _in_ Xorg, but when I exit Xorg in the hope of returning to normal, the  issue persists in the console. 

Unfortunately I spend most of my time in Xorg -- for GUI apps web, email, Lazarus IDE, and a bunch of remote xterm ssh sessions -- and the issue has probably only occured 3 times in 3 months; each time I've been clicking the mouse to do something. I just need to pin down exactly what triggers it which, as I mentioned, may also involve the keys on the left side of the keyboard. I'll just have to pay better attention... of course while I'm paying attention it won't happen


----------



## SirDice (Sep 1, 2021)

trev said:


> of course while I'm paying attention it won't happen


The most annoying problems to solve are the ones that happen intermittently. It's much easier to troubleshoot something if it's consistently broken.


----------



## covacat (Sep 1, 2021)

if you have a graphic console try switching to text 80x25 and see if changes anything


----------

