Changing to a lower screen resolution without stretching

When I change the screen resolution of my laptop from 1366x768 to 1024x768 via [Displays ...], the entire screen is still filled, stretching the picture uglyly. How can I have a pixel wise 1-to-1 mapping such that the original proportions are preserved?

This I need particularly when I want to mirror the screen together with a beamer.

(In 9.10 it somewhat depended on the displays available at startup. If a lower resolution screen was added later on, proportions were retained)


xrandr output:

Screen 0: minimum 320 x 200, current 1366 x 768, maximum 8192 x 8192
LVDS connected 1366x768+0+0 (normal left inverted right x axis y axis) 256mm x 144mm
   1366x768       60.0*+   50.0  
   1360x768       60.0     50.0  
   1280x768       60.0     50.0  
   1280x720       60.0     50.0  
   1024x768       60.0     50.0  
   1024x600       60.0     50.0  
   800x600        60.0     50.0  
   800x480        60.0     50.0  
   640x480        60.0     50.0  
DFP1 disconnected (normal left inverted right x axis y axis)
CRT1 disconnected (normal left inverted right x axis y axis)

This is a lenovo X121e and:

$ sudo lshw -C display
[sudo] password for ulrich: 
  *-display               
       description: VGA compatible controller
       product: Wrestler [Radeon HD 6320]
       vendor: Hynix Semiconductor (Hyundai Electronics)
       physical id: 1
       bus info: pci@0000:00:01.0
       version: 00
       width: 32 bits
       clock: 33MHz
       capabilities: pm pciexpress msi vga_controller bus_master cap_list rom
       configuration: driver=fglrx_pci latency=0
       resources: irq:45 memory:e0000000-efffffff ioport:4000(size=256) memory:f0300000-f033ffff

(What I found odd when running above is that it took so long)


Solution 1:

Try first setting scaling mode on the display to "Full aspect"

xrandr --output LVDS --set "scaling mode" "Full aspect" 

or

xrandr --output LVDS --set PANEL_FITTING full_aspect

After this change your resolution

xrandr -s 1024x768

This works with lenovo E330 laptop with intel gpu.

Options for scaling mode are: "Full", "Center" or "Full aspect".

Solution 2:

It's not 100% clear what you want (I suggest you edit the title so it's more obvious to the next guy who tries to solve this problem), but I think the solution is basically this: My xrandr output is

Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
eDP1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 309mm x 173mm
   1920x1080      60.1*+   59.9  
   1680x1050      60.0     59.9  
   1600x1024      60.2  
   1400x1050      60.0  
   1280x1024      60.0  
   1440x900       59.9  
   1280x960       60.0  
   1360x768       59.8     60.0  
   1152x864       60.0  
   1024x768       60.0  
   800x600        60.3     56.2  
   640x480        59.9  
DP1 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)

If I then run xrandr --output eDP1 --size 1360x768 --fb 1360x768 The result is a big chunk of the bottom and right of my screen is black, although it doesn't play well with my window manager. Basically, if I'd just passed size I'd have switched to a lower resolution, and then stretched the image to fit the screen. But since I also passed fb, I've told X that there's only 1360x768 to fill up, so no stretching needed to be done.

I have no idea how to make this play well with my window manager or anyone else's. Maybe you can. Good luck.

EDIT: I'm not actually sure whether you have to pick one of the existing modelines, or if you can just use two arbitrary (width, height) pairs, or if you need to define a modeline before using arbitrary pairs. The above was the only command I tried.

Solution 3:

This helped me a lot, but none of it worked. My grandson dropped his notebook which damaged the LCD on all 4 sides.

The native resolution of the LCD is 1366x768.

So I set it with this:

xrandr --output eDP \
  --mode 1280x720 \
  --set 'underscan' on \
  --set 'underscan vborder' 24 \
  --set 'underscan hborder' 43

Works great!