milos-linux/drivers/staging/sm750fb
Junrui Luo 75a1621e4f staging: sm750fb: fix division by zero in ps_to_hz()
ps_to_hz() is called from hw_sm750_crtc_set_mode() without validating
that pixclock is non-zero. A zero pixclock passed via FBIOPUT_VSCREENINFO
causes a division by zero.

Fix by rejecting zero pixclock in lynxfb_ops_check_var(), consistent
with other framebuffer drivers.

Fixes: 81dee67e21 ("staging: sm750fb: add sm750 to staging")
Reported-by: Yuhao Jiang <danisjiang@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Junrui Luo <moonafterrain@outlook.com>
Link: https://patch.msgid.link/SYBPR01MB7881AFBFCE28CCF528B35D0CAF4BA@SYBPR01MB7881.ausprd01.prod.outlook.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-31 10:33:21 +02:00
..
ddk750.h staging: sm750fb: remove ddk750_hwi2c 2025-04-25 16:08:00 +02:00
ddk750_chip.c staging: sm750fb: fix typo 'resetted' -> 'reset' 2026-01-11 13:54:01 +01:00
ddk750_chip.h
ddk750_display.c staging: sm750fb: remove ddk750_dvi 2025-04-25 16:07:59 +02:00
ddk750_display.h
ddk750_mode.c staging: sm750fb: Fix "programed" typo in ddk750_mode.c 2026-02-24 10:11:52 -08:00
ddk750_mode.h
ddk750_power.c
ddk750_power.h staging: sm750fb: change enum dpms to snake_case 2025-04-25 16:09:14 +02:00
ddk750_reg.h
ddk750_swi2c.c staging: sm750fb: Fix "varios" typo in ddk750_swi2c.c 2026-02-24 10:11:57 -08:00
ddk750_swi2c.h
Kconfig
Makefile staging: sm750fb: remove ddk750_hwi2c 2025-04-25 16:08:00 +02:00
readme
sm750.c staging: sm750fb: fix division by zero in ps_to_hz() 2026-03-31 10:33:21 +02:00
sm750.h staging: sm750fb: rename initParm to init_parm 2026-01-27 15:48:25 +01:00
sm750_accel.c staging: sm750fb: Clean up variable names 2026-02-07 14:33:29 +01:00
sm750_accel.h
sm750_cursor.c staging: sm750fb: rename sm750_hw_cursor_setData2 2025-05-01 17:48:40 +02:00
sm750_cursor.h staging: sm750fb: rename sm750_hw_cursor_setData2 2025-05-01 17:48:40 +02:00
sm750_hw.c Merge branch 'staging-linus' into branch 'staging-next' 2026-02-25 07:15:08 -08:00
TODO staging/sm750fb: remove outdated TODO lines 2026-01-11 13:50:30 +01:00

Introduction:
	SM750 of Silicon MOtion is pci express display controller device.
	The SM750 embedded graphics features include:
	- dual display
	- 2D acceleration
	- 16MB integrated video memory

About the kernel module parameter of driver:

	Use 1280,8bpp index color and 60 hz mode:
	insmod ./sm750fb.ko g_option="1280x1024-8@60"

	Disable MTRR,Disable 2d acceleration,Disable hardware cursor,
	and use a 800x600 mode :
	insmod ./sm750fb.ko g_option="noaccel:nomtrr:nohwc:800x600"

	dual frame buffer for driver with "dual" parameter
	insmod ./sm750fb.ko g_option="dual,800x600:1024x768"
	it will create fb0 and fb1 (or fb1,fb2 if fb0 already exist) under /dev
	and user can use con2fb to link fbX and ttyX

	Notes:
	1) if you build the driver with built-in method, the parameter
		you edited in the grub config file will be also the
		same format as above modular method,but additionally add
		"video=sm750fb:"
		ahead of parameters,so,it looks like:
		video=sm750fb:noaccel,1280x1024@60,otherparam,etc...
		it equal to modular method with below command:
		insmod ./sm750fb.ko g_option="noaccel:1280x1024@60:otherparm:etc..."

	2) if you put 800x600 into the parameter without bpp and
		refresh rate, kernel driver will defaulty use 16bpp and 60hz

Important:
	if you have vesafb enabled in your config then /dev/fb0 will be created by vesafb
	and this driver will use fb1, fb2. In that case, you need to configure your X-server
	to use fb1. Another simple althernative is to disable vesafb from your config.