stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 4.4 001/100] drm/gma500: Fixup fbdev stolen size usage evaluation
@ 2020-02-14 16:22 Sasha Levin
  2020-02-14 16:22 ` [PATCH AUTOSEL 4.4 002/100] nfsd4: avoid NULL deference on strange COPY compounds Sasha Levin
                   ` (98 more replies)
  0 siblings, 99 replies; 104+ messages in thread
From: Sasha Levin @ 2020-02-14 16:22 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Paul Kocialkowski, Patrik Jakobsson, Sasha Levin, dri-devel

From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>

[ Upstream commit fd1a5e521c3c083bb43ea731aae0f8b95f12b9bd ]

psbfb_probe performs an evaluation of the required size from the stolen
GTT memory, but gets it wrong in two distinct ways:
- The resulting size must be page-size-aligned;
- The size to allocate is derived from the surface dimensions, not the fb
  dimensions.

When two connectors are connected with different modes, the smallest will
be stored in the fb dimensions, but the size that needs to be allocated must
match the largest (surface) dimensions. This is what is used in the actual
allocation code.

Fix this by correcting the evaluation to conform to the two points above.
It allows correctly switching to 16bpp when one connector is e.g. 1920x1080
and the other is 1024x768.

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191107153048.843881-1-paul.kocialkowski@bootlin.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/gma500/framebuffer.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/gma500/framebuffer.c b/drivers/gpu/drm/gma500/framebuffer.c
index 2eaf1b31c7bd8..ef60bb1971951 100644
--- a/drivers/gpu/drm/gma500/framebuffer.c
+++ b/drivers/gpu/drm/gma500/framebuffer.c
@@ -533,6 +533,7 @@ static int psbfb_probe(struct drm_fb_helper *helper,
 		container_of(helper, struct psb_fbdev, psb_fb_helper);
 	struct drm_device *dev = psb_fbdev->psb_fb_helper.dev;
 	struct drm_psb_private *dev_priv = dev->dev_private;
+	unsigned int fb_size;
 	int bytespp;
 
 	bytespp = sizes->surface_bpp / 8;
@@ -542,8 +543,11 @@ static int psbfb_probe(struct drm_fb_helper *helper,
 	/* If the mode will not fit in 32bit then switch to 16bit to get
 	   a console on full resolution. The X mode setting server will
 	   allocate its own 32bit GEM framebuffer */
-	if (ALIGN(sizes->fb_width * bytespp, 64) * sizes->fb_height >
-	                dev_priv->vram_stolen_size) {
+	fb_size = ALIGN(sizes->surface_width * bytespp, 64) *
+		  sizes->surface_height;
+	fb_size = ALIGN(fb_size, PAGE_SIZE);
+
+	if (fb_size > dev_priv->vram_stolen_size) {
                 sizes->surface_bpp = 16;
                 sizes->surface_depth = 16;
         }
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 104+ messages in thread

end of thread, other threads:[~2020-02-15  0:43 UTC | newest]

Thread overview: 104+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-14 16:22 [PATCH AUTOSEL 4.4 001/100] drm/gma500: Fixup fbdev stolen size usage evaluation Sasha Levin
2020-02-14 16:22 ` [PATCH AUTOSEL 4.4 002/100] nfsd4: avoid NULL deference on strange COPY compounds Sasha Levin
2020-02-14 16:22 ` [PATCH AUTOSEL 4.4 003/100] brcmfmac: Fix use after free in brcmf_sdio_readframes() Sasha Levin
2020-02-14 16:22 ` [PATCH AUTOSEL 4.4 004/100] gianfar: Fix TX timestamping with a stacked DSA driver Sasha Levin
2020-02-14 16:22 ` [PATCH AUTOSEL 4.4 005/100] pinctrl: sh-pfc: sh7264: Fix CAN function GPIOs Sasha Levin
2020-02-14 16:22 ` [PATCH AUTOSEL 4.4 006/100] media: i2c: mt9v032: fix enum mbus codes and frame sizes Sasha Levin
2020-02-14 16:22 ` [PATCH AUTOSEL 4.4 007/100] media: sti: bdisp: fix a possible sleep-in-atomic-context bug in bdisp_device_run() Sasha Levin
2020-02-14 16:22 ` [PATCH AUTOSEL 4.4 008/100] efi/x86: Map the entire EFI vendor string before copying it Sasha Levin
2020-02-14 16:22 ` [PATCH AUTOSEL 4.4 009/100] MIPS: Loongson: Fix potential NULL dereference in loongson3_platform_init() Sasha Levin
2020-02-14 16:22 ` [PATCH AUTOSEL 4.4 010/100] uio: fix a sleep-in-atomic-context bug in uio_dmem_genirq_irqcontrol() Sasha Levin
2020-02-14 16:22 ` [PATCH AUTOSEL 4.4 011/100] usb: gadget: udc: fix possible sleep-in-atomic-context bugs in gr_probe() Sasha Levin
2020-02-14 16:22 ` [PATCH AUTOSEL 4.4 012/100] nfs: NFS_SWAP should depend on SWAP Sasha Levin
2020-02-14 16:22 ` [PATCH AUTOSEL 4.4 013/100] jbd2: clear JBD2_ABORT flag before journal_reset to update log tail info when load journal Sasha Levin
2020-02-14 16:22 ` [PATCH AUTOSEL 4.4 014/100] scsi: ufs: Fix ufshcd_probe_hba() reture value in case ufshcd_scsi_add_wlus() fails Sasha Levin
2020-02-14 16:22 ` [PATCH AUTOSEL 4.4 015/100] tracing: Fix very unlikely race of registering two stat tracers Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 016/100] ext4, jbd2: ensure panic when aborting with zero errno Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 017/100] libertas: don't exit from lbs_ibss_join_existing() with RCU read lock held Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 018/100] libertas: make lbs_ibss_join_existing() return error code on rates overflow Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 019/100] kconfig: fix broken dependency in randconfig-generated .config Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 020/100] clk: qcom: rcg2: Don't crash if our parent can't be found; return an error Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 021/100] drm/amdgpu: remove 4 set but not used variable in amdgpu_atombios_get_connector_info_from_object_table Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 022/100] drm/amdgpu: remove set but not used variable 'dig_connector' Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 023/100] drm/amdgpu: remove set but not used variable 'dig' Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 024/100] drm/amdgpu: remove always false comparison in 'amdgpu_atombios_i2c_process_i2c_ch' Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 025/100] drm/amdgpu: remove set but not used variable 'mc_shared_chmap' Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 026/100] drm/amdgpu: remove set but not used variable 'amdgpu_connector' Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 027/100] drm/gma500: remove set but not used variable 'htotal' Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 028/100] drm/gma500: remove set but not used variable 'error' Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 029/100] drm/gma500: remove set but not used variable 'is_hdmi','is_crt' Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 030/100] drm/gma500: remove set but not used variable 'channel_eq' Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 031/100] drm/radeon: remove set but not used variable 'size', 'relocs_chunk' Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 032/100] drm/radeon: remove set but not used variable 'dig_connector' Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 033/100] drm/radeon: remove set but not used variable 'radeon_connector' Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 034/100] drm/radeon: remove set but not used variable 'blocks' Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 035/100] drm/radeon: remove set but not used variable 'tv_pll_cntl1' Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 036/100] regulator: rk808: Lower log level on optional GPIOs being not available Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 037/100] NFC: port100: Convert cpu_to_le16(le16_to_cpu(E1) + E2) to use le16_add_cpu() Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 038/100] tty: omap-serial: remove set but unused variable Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 039/100] padata: always acquire cpu_hotplug_lock before pinst->lock Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 040/100] reiserfs: Fix spurious unlock in reiserfs_fill_super() error handling Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 041/100] isdn: don't mark kcapi_proc_exit as __exit Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 042/100] ALSA: usx2y: Adjust indentation in snd_usX2Y_hwdep_dsp_status Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 043/100] b43legacy: Fix -Wcast-function-type Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 044/100] ipw2x00: " Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 045/100] iwlegacy: " Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 046/100] rtlwifi: rtl_pci: " Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 047/100] bcma: remove set but not used variable 'sizel' Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 048/100] orinoco: avoid assertion in case of NULL pointer Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 049/100] ACPICA: Disassembler: create buffer fields in ACPI_PARSE_LOAD_PASS1 Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 050/100] scsi: aic7xxx: Adjust indentation in ahc_find_syncrate Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 051/100] ARM: dts: r8a7779: Add device node for ARM global timer Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 052/100] rtc: hym8563: Return -EINVAL if the time is known to be invalid Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 053/100] x86/vdso: Provide missing include file Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 054/100] pinctrl: sh-pfc: r8a7778: Fix duplicate SDSELF_B and SD1_CLK_B Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 055/100] pinctrl: sh-pfc: sh7269: Fix CAN function GPIOs Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 056/100] ALSA: sh: Fix compile warning wrt const Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 057/100] tools lib api fs: Fix gcc9 stringop-truncation compilation error Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 058/100] drm/gma500: remove set but not used variables 'hist_reg' Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 059/100] usbip: Fix unsafe unaligned pointer usage Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 060/100] soc/tegra: fuse: Correct straps' address for older Tegra124 device trees Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 061/100] ARM: dts: at91: sama5d3: fix maximum peripheral clock rates Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 062/100] ARM: dts: at91: sama5d3: define clock rate range for tcb1 Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 063/100] rcu: Use WRITE_ONCE() for assignments to ->pprev for hlist_nulls Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 064/100] Input: edt-ft5x06 - work around first register access error Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 065/100] wan: ixp4xx_hss: fix compile-testing on 64-bit Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 066/100] ASoC: atmel: fix build error with CONFIG_SND_ATMEL_SOC_DMA=m Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 067/100] PCI: Don't disable bridge BARs when assigning bus resources Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 068/100] driver core: Print device when resources present in really_probe() Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 069/100] ARC: [plat-axs10x]: Add missing multicast filter number to GMAC node Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 070/100] drm/nouveau: Fix copy-paste error in nouveau_fence_wait_uevent_handler Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 071/100] drm/vmwgfx: prevent memory leak in vmw_cmdbuf_res_add Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 072/100] iommu/arm-smmu-v3: Use WRITE_ONCE() when changing validity of an STE Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 073/100] scsi: iscsi: Don't destroy session if there are outstanding connections Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 074/100] ide: remove set but not used variable 'hwif' Sasha Levin
2020-02-14 16:23 ` [PATCH AUTOSEL 4.4 075/100] cmd64x: potential buffer overflow in cmd64x_program_timings() Sasha Levin
2020-02-14 16:24 ` [PATCH AUTOSEL 4.4 076/100] ide: serverworks: potential overflow in svwks_set_pio_mode() Sasha Levin
2020-02-14 16:24 ` [PATCH AUTOSEL 4.4 077/100] remoteproc: Initialize rproc_class before use Sasha Levin
2020-02-14 16:24 ` [PATCH AUTOSEL 4.4 078/100] s390/ftrace: generate traced function stack frame Sasha Levin
2020-02-14 16:24 ` [PATCH AUTOSEL 4.4 079/100] ALSA: hda - Add docking station support for Lenovo Thinkpad T420s Sasha Levin
2020-02-14 16:24 ` [PATCH AUTOSEL 4.4 080/100] char: hpet: Use flexible-array member Sasha Levin
2020-02-14 17:43   ` Eric Biggers
2020-02-14 23:36     ` Sasha Levin
2020-02-14 23:47       ` Eric Biggers
2020-02-15  0:03       ` Greg Kroah-Hartman
2020-02-14 16:24 ` [PATCH AUTOSEL 4.4 081/100] jbd2: switch to use jbd2_journal_abort() when failed to submit the commit record Sasha Levin
2020-02-14 16:24 ` [PATCH AUTOSEL 4.4 082/100] ARM: 8951/1: Fix Kexec compilation issue Sasha Levin
2020-02-14 16:24 ` [PATCH AUTOSEL 4.4 083/100] hostap: Adjust indentation in prism2_hostapd_add_sta Sasha Levin
2020-02-14 16:24 ` [PATCH AUTOSEL 4.4 084/100] rtlwifi: rtl8821ae: remove unused variables Sasha Levin
2020-02-14 16:24 ` [PATCH AUTOSEL 4.4 085/100] rtlwifi: rtl8192ee: " Sasha Levin
2020-02-14 16:24 ` [PATCH AUTOSEL 4.4 086/100] rtlwifi: rtl8723ae: " Sasha Levin
2020-02-14 16:24 ` [PATCH AUTOSEL 4.4 087/100] iwlegacy: ensure loop counter addr does not wrap and cause an infinite loop Sasha Levin
2020-02-14 16:24 ` [PATCH AUTOSEL 4.4 088/100] mwifiex: Fix possible buffer overflows in mwifiex_ret_wmm_get_status() Sasha Levin
2020-02-14 16:24 ` [PATCH AUTOSEL 4.4 089/100] mwifiex: Fix possible buffer overflows in mwifiex_cmd_append_vsie_tlv() Sasha Levin
2020-02-14 16:24 ` [PATCH AUTOSEL 4.4 090/100] drm/nouveau/disp/nv50-: prevent oops when no channel method map provided Sasha Levin
2020-02-14 16:24 ` [PATCH AUTOSEL 4.4 091/100] docs: i2c: writing-clients: properly name the stop condition Sasha Levin
2020-02-14 16:24 ` [PATCH AUTOSEL 4.4 092/100] trigger_next should increase position index Sasha Levin
2020-02-14 16:24 ` [PATCH AUTOSEL 4.4 093/100] radeon: insert 10ms sleep in dce5_crtc_load_lut Sasha Levin
2020-02-14 16:24 ` [PATCH AUTOSEL 4.4 094/100] ocfs2: fix a NULL pointer dereference when call ocfs2_update_inode_fsync_trans() Sasha Levin
2020-02-14 16:24 ` [PATCH AUTOSEL 4.4 095/100] lib/scatterlist.c: adjust indentation in __sg_alloc_table Sasha Levin
2020-02-14 16:24 ` [PATCH AUTOSEL 4.4 096/100] reiserfs: prevent NULL pointer dereference in reiserfs_insert_item() Sasha Levin
2020-02-14 16:24 ` [PATCH AUTOSEL 4.4 097/100] bcache: explicity type cast in bset_bkey_last() Sasha Levin
2020-02-14 16:24 ` [PATCH AUTOSEL 4.4 098/100] irqchip/gic-v3-its: Reference to its_invall_cmd descriptor when building INVALL Sasha Levin
2020-02-14 16:24 ` [PATCH AUTOSEL 4.4 099/100] microblaze: Prevent the overflow of the start Sasha Levin
2020-02-14 16:24 ` [PATCH AUTOSEL 4.4 100/100] brd: check and limit max_part par Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).