I have a Samsung HDTV with both HDMI and DVI inputs. The native resolution is 1920x1080. I am using a passive HDMI to DVI adapter with my RPi. When I start the desktop environment, everything looks fine. But during boot, the text is badly misaligned (the framebuffer dimensions do not match the monitors physical resolution.)
To fix this misalignment, I edited the framebuffer settings in config.txt. I started with the maximum height detected by xrandr (which is 2048). This put the rasperries at the top of the screen on my 1080 monitor. Then I adjusted the width until the text filled the screen horizontally. So I ended up using a framebuffer size of 1700x2048 to obtain a correct display resolution of 1920x1080 during boot:
# Uncomment to force a console size. By default it will be display's size minus overscan.
framebuffer_width=1700
framebuffer_height=2048
XRANDR OUTPUT USING DVI CONNECTION
xrandr
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 2048 x 2048
HDMI-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 520mm x 320mm
1920x1080 59.93*+
1680x1050 59.88
1280x1024 75.02 60.02
1440x900 59.90
1280x960 60.00
1280x800 59.91
1152x864 75.00
1024x768 75.03 70.07 60.00
832x624 74.55
800x600 72.19 75.00 60.32 56.25
640x480 75.00 72.81 66.67 59.94
720x400 70.08
Composite-1 unknown connection (normal left inverted right x axis y axis)
The maximum resolution of 2048x2048 detected by xrandr here is wrong: the LCD panel is physically limited to 1920x1080. The minimum display mode detected by xrandr is 320x200 (which yields a 4:3 aspect ratio, when the panel is actually 16:9).
If I set the framebuffer size to 2048x2048, I get a display with a 4:3 aspect correctly centered on screen that would work for an old analog monitor. When I set the framebuffer to 1700x2048 and then connect an HDMI monitor, I get the same results, but when KMS becomes active during boot it correctly switches to 1920x1080 automatically regardless of the framebuffer settings in config.txt. (This information may also be useful in some situations where analog output is supported and monitors are frequently switched or multiple monitors are attached simultaneously.)
XRANDR OUTPUT USING HDMI CONNECTION (SAME MONITOR)
xrandr
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 2048 x 2048
HDMI-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 160mm x 90mm
1920x1080 60.00*+ 60.00 59.94 30.00 24.00 29.97 23.98
1920x1080i 60.00 60.00 59.94
1680x1050 59.88
1280x1024 75.02 60.02
1440x900 59.90
1280x960 60.00
1280x800 59.91
1152x864 75.00
1280x720 60.00 60.00 59.94
1024x768 75.03 70.07 60.00
832x624 74.55
800x600 72.19 75.00 60.32 56.25
720x480 60.00 60.00 59.94 59.94
720x480i 60.00 59.94
640x480 75.00 72.81 66.67 60.00 59.94
720x400 70.08
Composite-1 unknown connection (normal left inverted right x axis y axis)
720x480 62.69