Commit Graph

2640 Commits

Author SHA1 Message Date
Sandor Yu
693c2b3565 LF-13056: video: fbdev: sii902x: Fix Coverity issue #5483966
Fix Coverity issue #5483966: Dereference null return value.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
2024-10-23 17:44:03 +08:00
Sandor Yu
6e05055e92 LF-13054: video: fbdev: mxc_dcic: Fix Coverity issue #250401
Fix Coverity issue #250401: Dereference null return value

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
2024-10-23 17:44:03 +08:00
Sandor Yu
d43f09a49d LF-13087: video: fbdev: mxsfb_sii902x: Fix Coverity issue 22841530
Fix Coverity issue 22841530:
variable "audio_rates" was declared but never referenced

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
2024-10-23 17:44:03 +08:00
Jason Liu
239f62168d This is the 6.6.51 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmbisF0ACgkQONu9yGCS
 aT5Y8xAAqS/rmrC+/qlFvbtAqK+KXLq9BIGvDHW2QHfCyMpSZ6isehVhh64apHE/
 /XvJ6a+2iPVp5o52iDTUKzbcDr3Jx/QwhS8Xa/HyQQy1rXIPpJNJb8Vuvkn/B2Cq
 cPCfTtfPZUUQTd09uAdBhy5NT8hsT2kSVpmSXDnahn9ih8k0tR40udw5Qf7xpWcf
 HqljbfonLP86mF/SB9m+VhDGF9fekujyb+0iS0OPE+TdvSjKB9ySoeL4PIeTSxrz
 goZdp9ygAYy8Bks825ztbfQszqIwceHU/xZRaUrGfOOk4A5kwTmbdUQu7ooMc+5F
 kbpifbewmY1UGn2KTxgj59xCjQ7HLQe+sqacy0/gALzRSajUNyjLn0n4w3UqaJWb
 pf+gwqHBLgDRfvWctggEdY2ApKgOlM9D7TTpWWB9uv1oR/g3PGfgehZgrMMPgPUw
 EZ8JiwnITfRaRFiH/vSR3aJKRj6qjb4mX3/U8HgGcACtyFfHgtuI7jzhnX36fRNO
 FG38bxSUMrJnlohghfBl6zyaruZBMHVaoQzs6MYZ7qrVvCbt3CHivJdaQ85nw0h7
 YHa2zYFfT0ztyaSMzWq6JatgI7BZfd8PjobhbRZADBBD39KC8aL8XLoDPnpzWMUY
 UDlK8n96gOKo0t8ILDWcIisCVGNogcHJlGppC8Fu7ZyKzYsMhN4=
 =OEL/
 -----END PGP SIGNATURE-----

Merge tag 'v6.6.51' into lf-6.6.y

This is the 6.6.51 stable release

* tag 'v6.6.51': (2369 commits)
  Linux 6.6.51
  Bluetooth: hci_sync: Fix UAF on hci_abort_conn_sync
  Bluetooth: hci_sync: Fix UAF on create_le_conn_complete
  ...

Signed-off-by: Jason Liu <jason.hui.liu@nxp.com>

 Conflicts:
	arch/arm64/boot/dts/freescale/imx8mp.dtsi
	arch/arm64/boot/dts/freescale/imx93.dtsi
	drivers/dma/fsl-edma-common.c
	drivers/dma/fsl-edma-common.h
	drivers/dma/fsl-edma.c
	drivers/irqchip/irq-imx-irqsteer.c
	drivers/perf/fsl_imx9_ddr_perf.c
	drivers/spi/spi-fsl-lpspi.c
	sound/soc/sof/imx/imx8m.c
2024-09-24 11:49:41 +08:00
Thomas Zimmermann
340bbe90cc fbdev: vesafb: Detect VGA compatibility from screen info's VESA attributes
[ Upstream commit c2bc958b2b ]

Test the vesa_attributes field in struct screen_info for compatibility
with VGA hardware. Vesafb currently tests bit 1 in screen_info's
capabilities field which indicates a 64-bit lfb address and is
unrelated to VGA compatibility.

Section 4.4 of the Vesa VBE 2.0 specifications defines that bit 5 in
the mode's attributes field signals VGA compatibility. The mode is
compatible with VGA hardware if the bit is clear. In that case, the
driver can access VGA state of the VBE's underlying hardware. The
vesafb driver uses this feature to program the color LUT in palette
modes. Without, colors might be incorrect.

The problem got introduced in commit 89ec4c238e ("[PATCH] vesafb: Fix
incorrect logo colors in x86_64"). It incorrectly stores the mode
attributes in the screen_info's capabilities field and updates vesafb
accordingly. Later, commit 5e8ddcbe86 ("Video mode probing support for
the new x86 setup code") fixed the screen_info, but did not update vesafb.
Color output still tends to work, because bit 1 in capabilities is
usually 0.

Besides fixing the bug in vesafb, this commit introduces a helper that
reads the correct bit from screen_info.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: 5e8ddcbe86 ("Video mode probing support for the new x86 setup code")
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Cc: <stable@vger.kernel.org> # v2.6.23+
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-08-11 12:47:16 +02:00
Thomas Zimmermann
bab0a82854 fbdev/vesafb: Replace references to global screen_info by local pointer
[ Upstream commit 3218286bbb ]

Get the global screen_info's address once and access the data via
this pointer. Limits the use of global state.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231206135153.2599-4-tzimmermann@suse.de
Stable-dep-of: c2bc958b2b ("fbdev: vesafb: Detect VGA compatibility from screen info's VESA attributes")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-08-11 12:47:15 +02:00
Jason Liu
21efea47c1 This is the 6.6.34 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmZu0U0ACgkQONu9yGCS
 aT4c2Q//SGn9+yEUml1/7nQUTND434ly4JPMdrR1jjJSKwxAsgzOYKCoUpzpXim8
 7mdKz7q1cXx/l+tfJgEDdJ8JzVS6ipJWAwF4vE+18zWZjEax/M3dgluZUUswXKYg
 Da76wSaNkfGiIewu8HV90LKAKaQoCR4ypyWG8CqDZkCnGJORUJA09GNDrKFhOodT
 f0TzjIvPw8E3rU2+HZfPmxUI0XQEzfVPWb5DK+0F7hcHw4ETcij7y0AInBkQ5bNt
 tFRCc462nT23e3jXJECWMbSXdRF57LlT8G9626Om0iS+TY7YD6PPNa7/bdqVHzcw
 hDmKE+xONslwvuzkYn2R9u+nc/dw/hJ8QI5j9QohbJCcXjcv8N3QeXoiLPjiDxxv
 1JVVi6emyKvKx26kjY/m0ZTZ/QWWwQlj/+R8Or/yIMMYZvPwyBUX3I8cZIQhyAg4
 n/fc2tFqmax0K6e9YOXj3sa+OlXx02DAC8oVToNrSS7HT5uhtoKT4vU1d+et2alo
 dFJAhklt27k+eV+Ayxo+RUaxUVggM0MAB67S7XUR0kylP2BeL2l9wMKVzZz2V5T4
 O9PHY1RpD8OGk7aZvlbZYIis7LBqVTXcaEB4l5QtSYM4RMON4BYb5QLEc0jYywzV
 U7GMNiKhhuwEHjiPD0cIXyeWeQzTlH9os5lhW8moVY9mtthGlr0=
 =zdH0
 -----END PGP SIGNATURE-----

Merge tag 'v6.6.34' into lf-6.6.y

This is the 6.6.34 stable release

* tag 'v6.6.34': (2530 commits)
  Linux 6.6.34
  smp: Provide 'setup_max_cpus' definition on UP too
  selftests: net: more strict check in net_helper
  ...

Signed-off-by: Jason Liu <jason.hui.liu@nxp.com>

 Conflicts:
	arch/arm64/boot/dts/freescale/imx8-ss-conn.dtsi
	drivers/net/ethernet/freescale/fec_ptp.c
	drivers/pmdomain/imx/imx8mp-blk-ctrl.c
	drivers/usb/dwc3/host.c
	tools/perf/util/pmu.c
2024-06-18 17:16:08 +08:00
Cai Xinchen
b8385ff814 fbdev: savage: Handle err return when savagefb_check_var failed
commit 6ad959b670 upstream.

The commit 04e5eac8f3ab("fbdev: savage: Error out if pixclock equals zero")
checks the value of pixclock to avoid divide-by-zero error. However
the function savagefb_probe doesn't handle the error return of
savagefb_check_var. When pixclock is 0, it will cause divide-by-zero error.

Fixes: 04e5eac8f3 ("fbdev: savage: Error out if pixclock equals zero")
Signed-off-by: Cai Xinchen <caixinchen1@huawei.com>
Cc: stable@vger.kernel.org
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-06-16 13:47:37 +02:00
Sean Young
a10c3d5ff9 pwm: Rename pwm_apply_state() to pwm_apply_might_sleep()
[ Upstream commit c748a6d77c ]

In order to introduce a pwm api which can be used from atomic context,
we will need two functions for applying pwm changes:

	int pwm_apply_might_sleep(struct pwm *, struct pwm_state *);
	int pwm_apply_atomic(struct pwm *, struct pwm_state *);

This commit just deals with renaming pwm_apply_state(), a following
commit will introduce the pwm_apply_atomic() function.

Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Mark Brown <broonie@kernel.org>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> # for input
Acked-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Acked-by: Lee Jones <lee@kernel.org>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Stable-dep-of: 974afccd37 ("leds: pwm: Disable PWM when going to suspend")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-06-12 11:12:24 +02:00
Randy Dunlap
1cc6b956ad fbdev: sh7760fb: allow modular build
[ Upstream commit 51084f89d6 ]

There is no reason to prohibit sh7760fb from being built as a
loadable module as suggested by Geert, so change the config symbol
from bool to tristate to allow that and change the FB dependency as
needed.

Fixes: f75f71b2c4 ("fbdev/sh7760fb: Depend on FB=y")
Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Javier Martinez Canillas <javierm@redhat.com>
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Helge Deller <deller@gmx.de>
Cc: linux-fbdev@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Acked-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Acked-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-06-12 11:12:02 +02:00
Arnd Bergmann
be84945440 fbdev: sisfb: hide unused variables
[ Upstream commit 688cf59866 ]

Building with W=1 shows that a couple of variables in this driver are only
used in certain configurations:

drivers/video/fbdev/sis/init301.c:239:28: error: 'SiS_Part2CLVX_6' defined but not used [-Werror=unused-const-variable=]
  239 | static const unsigned char SiS_Part2CLVX_6[] = {   /* 1080i */
      |                            ^~~~~~~~~~~~~~~
drivers/video/fbdev/sis/init301.c:230:28: error: 'SiS_Part2CLVX_5' defined but not used [-Werror=unused-const-variable=]
  230 | static const unsigned char SiS_Part2CLVX_5[] = {   /* 750p */
      |                            ^~~~~~~~~~~~~~~
drivers/video/fbdev/sis/init301.c:211:28: error: 'SiS_Part2CLVX_4' defined but not used [-Werror=unused-const-variable=]
  211 | static const unsigned char SiS_Part2CLVX_4[] = {   /* PAL */
      |                            ^~~~~~~~~~~~~~~
drivers/video/fbdev/sis/init301.c:192:28: error: 'SiS_Part2CLVX_3' defined but not used [-Werror=unused-const-variable=]
  192 | static const unsigned char SiS_Part2CLVX_3[] = {  /* NTSC, 525i, 525p */
      |                            ^~~~~~~~~~~~~~~
drivers/video/fbdev/sis/init301.c:184:28: error: 'SiS_Part2CLVX_2' defined but not used [-Werror=unused-const-variable=]
  184 | static const unsigned char SiS_Part2CLVX_2[] = {
      |                            ^~~~~~~~~~~~~~~
drivers/video/fbdev/sis/init301.c:176:28: error: 'SiS_Part2CLVX_1' defined but not used [-Werror=unused-const-variable=]
  176 | static const unsigned char SiS_Part2CLVX_1[] = {
      |                            ^~~~~~~~~~~~~~~

This started showing up after the definitions were moved into the
source file from the header, which was not flagged by the compiler.
Move the definition into the appropriate #ifdef block that already
exists next to them.

Fixes: 5908986ef3 ("video: fbdev: sis: avoid mismatched prototypes")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-06-12 11:12:00 +02:00
Arnd Bergmann
4a1dc97212 fbdev: shmobile: fix snprintf truncation
[ Upstream commit 26c8cfb9d1 ]

The name of the overlay does not fit into the fixed-length field:

drivers/video/fbdev/sh_mobile_lcdcfb.c:1577:2: error: 'snprintf' will always be truncated; specified size is 16, but format string expands to at least 25

Make it short enough by changing the string.

Fixes: c5deac3c9b ("fbdev: sh_mobile_lcdc: Implement overlays support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-06-12 11:11:58 +02:00
Tony Lindgren
5fdc39e024 drm/omapdrm: Fix console with deferred ops
[ Upstream commit 01c0cce88c ]

Commit 95da53d63d ("drm/omapdrm: Use regular fbdev I/O helpers")
stopped console from updating for command mode displays because there is
no damage handling in fb_sys_write() unlike we had earlier in
drm_fb_helper_sys_write().

Let's fix the issue by adding FB_GEN_DEFAULT_DEFERRED_DMAMEM_OPS and
FB_DMAMEM_HELPERS_DEFERRED as suggested by Thomas. We cannot use the
FB_DEFAULT_DEFERRED_OPS as fb_deferred_io_mmap() won't work properly
for write-combine.

Fixes: 95da53d63d ("drm/omapdrm: Use regular fbdev I/O helpers")
Suggested-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240228063540.4444-3-tony@atomide.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-06-12 11:11:56 +02:00
Thomas Zimmermann
c00e8fd749 fbdev: Provide I/O-memory helpers as module
[ Upstream commit 6b180f66c0 ]

Provide helpers for accessing I/O memory in a helper module. The fbdev
core uses these helpers, so select the module unconditionally for fbdev.
Drivers will later be able to select the module individually and the
helpers will become optional.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-2-tzimmermann@suse.de
Stable-dep-of: 01c0cce88c ("drm/omapdrm: Fix console with deferred ops")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-06-12 11:11:56 +02:00
Nam Cao
8986ea3539 fbdev: fix incorrect address computation in deferred IO
commit 78d9161d2b upstream.

With deferred IO enabled, a page fault happens when data is written to the
framebuffer device. Then driver determines which page is being updated by
calculating the offset of the written virtual address within the virtual
memory area, and uses this offset to get the updated page within the
internal buffer. This page is later copied to hardware (thus the name
"deferred IO").

This offset calculation is only correct if the virtual memory area is
mapped to the beginning of the internal buffer. Otherwise this is wrong.
For example, if users do:
    mmap(ptr, 4096, PROT_WRITE, MAP_FIXED | MAP_SHARED, fd, 0xff000);

Then the virtual memory area will mapped at offset 0xff000 within the
internal buffer. This offset 0xff000 is not accounted for, and wrong page
is updated.

Correct the calculation by using vmf->pgoff instead. With this change, the
variable "offset" will no longer hold the exact offset value, but it is
rounded down to multiples of PAGE_SIZE. But this is still correct, because
this variable is only used to calculate the page offset.

Reported-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Closes: https://lore.kernel.org/linux-fbdev/271372d6-e665-4e7f-b088-dee5f4ab341a@oracle.com
Fixes: 56c134f7f1 ("fbdev: Track deferred-I/O pages in pageref struct")
Cc: <stable@vger.kernel.org>
Signed-off-by: Nam Cao <namcao@linutronix.de>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Tested-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20240423115053.4490-1-namcao@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-05-02 16:32:46 +02:00
Roman Smirnov
3d4b909704 fbmon: prevent division by zero in fb_videomode_from_videomode()
[ Upstream commit c2d953276b ]

The expression htotal * vtotal can have a zero value on
overflow. It is necessary to prevent division by zero like in
fb_var_to_videomode().

Found by Linux Verification Center (linuxtesting.org) with Svace.

Signed-off-by: Roman Smirnov <r.smirnov@omp.ru>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-13 13:07:40 +02:00
Aleksandr Burakov
89f0cf6ac6 fbdev: viafb: fix typo in hw_bitblt_1 and hw_bitblt_2
[ Upstream commit bc87bb342f ]

There are some actions with value 'tmp' but 'dst_addr' is checked instead.
It is obvious that a copy-paste error was made here and the value
of variable 'tmp' should be checked here.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Aleksandr Burakov <a.burakov@rosalinux.ru>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-13 13:07:39 +02:00
Jason Liu
ffcb081b1e This is the 6.6.21 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmXoglwACgkQONu9yGCS
 aT4b5Q/+NTo9lSsob4MeA31IdXx/zxHSQKnREAGN5A4pevI6HJbnqJO6jQxZ2FKk
 2uB51Xjw/vhaQOljnNpkrCLrZBKoh/BuodxS7oYjYfDyba+DCoFMkqBtav9ZzlcF
 JcoPOOm4lEvTOozs/3ulmWx+ZZC1pnZt5JEmUTjL17AHdZUlugDg49WiZlEm3Le9
 ApmBN1t9VJz64wHsmbjgXiPUVb76I08knCBv/No1hrJmemK4Gn9lZn3WAIiSsWvp
 Dk4bzHmLleHbIW3EKc5VS1Jhp+m3/gGDP6Z4bN0B9HLu2qc8HT91rpC+giLzwIv2
 L1G8j9a5nyQEPropN+EUsJSzk0iez6o9DrSEDj2XmgPnxB0wsTwrmZvPjaU6M03Z
 QLMgFbiveeDSHjvt9RZvrIAMklW6PjZqaX4ZMvHxGJvvayFfaEQCb40/KwppvdiX
 C/U3fT3L0RdSRu/V/k+W/a8O65EJ/5ZLd3G/RNSiWhy/uZoSpfbSLADo/zUXqNc3
 bxSpVv7NAfA/riZlAeN/WXq2eZd0pQYF4BLK4UEJ2muPs2ZA42D3bGg19TgNRAgs
 mAovy5Liuj/iTsi9hXGymrMNp4plbM/Sie9qs+rwNJBXrYctkNPOAiR9ng381dX2
 1Icy4uek50/CqWocxTtblp8ch+dT68AKPZzkjB0RCvjneWVc2LI=
 =hAft
 -----END PGP SIGNATURE-----

Merge tag 'v6.6.21' into lf-6.6.y

This is the 6.6.21 stable release

* tag 'v6.6.21': (143 commits)
  Linux 6.6.21
  drm/nouveau: don't fini scheduler before entity flush
  selftests: mptcp: rm subflow with v4/v4mapped addr
  ...

Signed-off-by: Jason Liu <jason.hui.liu@nxp.com>

 Conflicts:
	drivers/dma/fsl-edma-common.c
	drivers/dma/fsl-qdma.c
	drivers/net/ethernet/freescale/fman/fman_memac.c
	drivers/phy/freescale/phy-fsl-imx8-mipi-dphy.c
2024-03-13 14:24:30 +08:00
Jason Liu
8eb8dd316c This is the 6.6.20 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmXjYIIACgkQONu9yGCS
 aT5mvw/9GnG2BWbZp9BgVzBnT00CXnIpiGlsoSU0I0Uiso3XqpNYBu7jIZ+vmsqz
 3H2bpkToEwJgg40I+w3iRaY84FWJZtl6HWtXydVQghQzXdA7qSuKBmbqQdUGKqZq
 Uqy7SFabkqQmlmF+RX1tYsgj7Vg3tqThERLUKQRhZIRa+Xek6Izi16RKEXcBNoXv
 vN+Q6AJ6vgjzHdw/UndsTH48bA/NofLlGapf7ZRGaSO7vY6bO5N23Xeg8gBIUh3M
 RHYf0ubKOvOw6LfZrE8BAbLd9Om2IHRAwHTqvDUNaIOl6y7exwCCIMK2lDdlzQ3W
 7gug4HzlQjVz93OtL8MjLnfINOO7en65gyqvwit9N7O7nJKvuIMtt5vVam+h4ikB
 xF/QmFj95GNeRLwBmOJxOS89KyC8BrjE3PfYtL1mUO9joH8vZBccon6WIV7C2u5M
 d+0UglxC4lNTJ3s3FcnrzEKCn5YaE8WvFYQX0xvFQL3GWGDkyrNaafqoz19a8yd2
 ndf3xUh5QKYWI2UGhqV6FdfYC9BolEh/niMKrJYCEJ6BroO3nzh1L8keC+MHbJwp
 Yuu9FCT+vNDKfR/HQwUhUGX/3wyBKb8jqzDXUB2s4FLPUSBX+/RAso13FWua1TGd
 E432ZXaobuUx3+kHsqB+0dc99QVblnMFMPEoM4ye3lYHzq8PDJ0=
 =7IL4
 -----END PGP SIGNATURE-----

Merge tag 'v6.6.20' into lf-6.6.y

This is the 6.6.20 stable release

* tag 'v6.6.20': (3154 commits)
  Linux 6.6.20
  fs/ntfs3: fix build without CONFIG_NTFS3_LZX_XPRESS
  Linux 6.6.19
  ...

Signed-off-by: Jason Liu <jason.hui.liu@nxp.com>

 Conflicts:
	arch/arm64/boot/dts/freescale/imx8mm.dtsi
	arch/arm64/boot/dts/freescale/imx8mq.dtsi
	drivers/clk/imx/clk-imx8qxp.c
	drivers/dma/fsl-edma.c
	drivers/firmware/arm_scmi/perf.c
	drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
	drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c
	drivers/net/ethernet/freescale/fec_main.c
	drivers/scsi/scsi_error.c
	drivers/spi/spi-imx.c
	sound/soc/fsl/fsl_sai.c
2024-03-11 14:59:44 +08:00
Jiri Slaby (SUSE)
73a6bd68a1 fbcon: always restore the old font data in fbcon_do_set_font()
[ Upstream commit 00d6a284fc ]

Commit a5a923038d (fbdev: fbcon: Properly revert changes when
vc_resize() failed) started restoring old font data upon failure (of
vc_resize()). But it performs so only for user fonts. It means that the
"system"/internal fonts are not restored at all. So in result, the very
first call to fbcon_do_set_font() performs no restore at all upon
failing vc_resize().

This can be reproduced by Syzkaller to crash the system on the next
invocation of font_get(). It's rather hard to hit the allocation failure
in vc_resize() on the first font_set(), but not impossible. Esp. if
fault injection is used to aid the execution/failure. It was
demonstrated by Sirius:
  BUG: unable to handle page fault for address: fffffffffffffff8
  #PF: supervisor read access in kernel mode
  #PF: error_code(0x0000) - not-present page
  PGD cb7b067 P4D cb7b067 PUD cb7d067 PMD 0
  Oops: 0000 [#1] PREEMPT SMP KASAN
  CPU: 1 PID: 8007 Comm: poc Not tainted 6.7.0-g9d1694dc91ce #20
  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
  RIP: 0010:fbcon_get_font+0x229/0x800 drivers/video/fbdev/core/fbcon.c:2286
  Call Trace:
   <TASK>
   con_font_get drivers/tty/vt/vt.c:4558 [inline]
   con_font_op+0x1fc/0xf20 drivers/tty/vt/vt.c:4673
   vt_k_ioctl drivers/tty/vt/vt_ioctl.c:474 [inline]
   vt_ioctl+0x632/0x2ec0 drivers/tty/vt/vt_ioctl.c:752
   tty_ioctl+0x6f8/0x1570 drivers/tty/tty_io.c:2803
   vfs_ioctl fs/ioctl.c:51 [inline]
  ...

So restore the font data in any case, not only for user fonts. Note the
later 'if' is now protected by 'old_userfont' and not 'old_data' as the
latter is always set now. (And it is supposed to be non-NULL. Otherwise
we would see the bug above again.)

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Fixes: a5a923038d ("fbdev: fbcon: Properly revert changes when vc_resize() failed")
Reported-and-tested-by: Ubisectech Sirius <bugreport@ubisectech.com>
Cc: Ubisectech Sirius <bugreport@ubisectech.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Helge Deller <deller@gmx.de>
Cc: linux-fbdev@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20240208114411.14604-1-jirislaby@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-03-06 14:48:38 +00:00
Fullway Wang
99f1abc34a fbdev: sis: Error out if pixclock equals zero
[ Upstream commit e421946be7 ]

The userspace program could pass any values to the driver through
ioctl() interface. If the driver doesn't check the value of pixclock,
it may cause divide-by-zero error.

In sisfb_check_var(), var->pixclock is used as a divisor to caculate
drate before it is checked against zero. Fix this by checking it
at the beginning.

This is similar to CVE-2022-3061 in i740fb which was fixed by
commit 15cf0b8.

Signed-off-by: Fullway Wang <fullwaywang@outlook.com>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-03-01 13:34:48 +01:00
Fullway Wang
bc3c2e58d7 fbdev: savage: Error out if pixclock equals zero
[ Upstream commit 04e5eac8f3 ]

The userspace program could pass any values to the driver through
ioctl() interface. If the driver doesn't check the value of pixclock,
it may cause divide-by-zero error.

Although pixclock is checked in savagefb_decode_var(), but it is not
checked properly in savagefb_probe(). Fix this by checking whether
pixclock is zero in the function savagefb_check_var() before
info->var.pixclock is used as the divisor.

This is similar to CVE-2022-3061 in i740fb which was fixed by
commit 15cf0b8.

Signed-off-by: Fullway Wang <fullwaywang@outlook.com>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-03-01 13:34:48 +01:00
Nam Cao
2db6388d8a fbdev: flush deferred IO before closing
commit 33cd6ea9c0 upstream.

When framebuffer gets closed, the queued deferred IO gets cancelled. This
can cause some last display data to vanish. This is problematic for users
who send a still image to the framebuffer, then close the file: the image
may never appear.

To ensure none of display data get lost, flush the queued deferred IO
first before closing.

Another possible solution is to delete the cancel_delayed_work_sync()
instead. The difference is that the display may appear some time after
closing. However, the clearing of page mapping after this needs to be
removed too, because the page mapping is used by the deferred work. It is
not completely obvious whether it is okay to not clear the page mapping.
For a patch intended for stable trees, go with the simple and obvious
solution.

Fixes: 60b59beafb ("fbdev: mm: Deferred IO support")
Cc: stable@vger.kernel.org
Signed-off-by: Nam Cao <namcao@linutronix.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-01-25 15:35:45 -08:00
Nam Cao
1e3b051e97 fbdev: flush deferred work in fb_deferred_io_fsync()
commit 15e4c1f462 upstream.

The driver's fsync() is supposed to flush any pending operation to
hardware. It is implemented in this driver by cancelling the queued
deferred IO first, then schedule it for "immediate execution" by calling
schedule_delayed_work() again with delay=0. However, setting delay=0
only means the work is scheduled immediately, it does not mean the work
is executed immediately. There is no guarantee that the work is finished
after schedule_delayed_work() returns. After this driver's fsync()
returns, there can still be pending work. Furthermore, if close() is
called by users immediately after fsync(), the pending work gets
cancelled and fsync() may do nothing.

To ensure that the deferred IO completes, use flush_delayed_work()
instead. Write operations to this driver either write to the device
directly, or invoke schedule_delayed_work(); so by flushing the
workqueue, it can be guaranteed that all previous writes make it to the
device.

Fixes: 5e841b88d2 ("fb: fsync() method for deferred I/O flush.")
Cc: stable@vger.kernel.org
Signed-off-by: Nam Cao <namcao@linutronix.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-01-25 15:35:45 -08:00
Thomas Zimmermann
2aceb3a826 fbdev/acornfb: Fix name of fb_ops initializer macro
commit b48807788e upstream.

Fix build by using the correct name for the initializer macro
for struct fb_ops.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: 9037afde8b ("fbdev/acornfb: Use fbdev I/O helpers")
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Helge Deller <deller@gmx.de>
Cc: Javier Martinez Canillas <javierm@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: <stable@vger.kernel.org> # v6.6+
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231127131655.4020-2-tzimmermann@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-01-25 15:35:45 -08:00
Dario Binacchi
71ec48abc5 fbdev: imxfb: fix left margin setting
[ Upstream commit 5758844105 ]

The previous setting did not take into account the CSTN mode.
For the H_WAIT_2 bitfield (bits 0-7) of the LCDC Horizontal Configuration
Register (LCDCR), the IMX25RM manual states that:

In TFT mode, it specifies the number of SCLK periods between the end of
HSYNC and the beginning of OE signal, and the total delay time equals
(H_WAIT_2 + 3) of SCLK periods.
In CSTN mode, it specifies the number of SCLK periods between the end of
HSYNC and the first display data in each line, and the total delay time
equals (H_WAIT_2 + 2) of SCLK periods.

The patch handles both cases.

Fixes: 4e47382fbc ("fbdev: imxfb: warn about invalid left/right margin")
Fixes: 7e8549bcee ("imxfb: Fix margin settings")
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-01-25 15:35:40 -08:00
Jason Liu
6d09067baf Merge tag 'v6.6.2' into lf-6.6.y
This is the 6.6.2 stable release

* tag 'v6.6.2': (634 commits)
  Linux 6.6.2
  btrfs: make found_logical_ret parameter mandatory for function queue_scrub_stripe()
  btrfs: use u64 for buffer sizes in the tree search ioctls
  ...

Signed-off-by: Jason Liu <jason.hui.liu@nxp.com>

Conflicts:
	drivers/clk/imx/clk-imx8mq.c
	drivers/clk/imx/clk-imx8qxp.c
	drivers/media/i2c/ov5640.c
	drivers/misc/pci_endpoint_test.c
2023-11-30 09:40:58 -06:00
Dong Aisheng
d0e3e968af Merge branch 'display/next' into next
* display/next: (640 commits)
  LF-10583-2: drm: bridge: imx: Add i.MX95 LVDS Display Bridge(LDB) driver
  LF-10583-1: dt-bindings: display: bridge: Add i.MX95 LVDS display bridge binding
  LF-10620: drm: bridge: it6263: add support for DRM_BRIDGE_ATTACH_NO_CONNECTOR
  LF-10617-2 drm/panel: Add Raydium RM692C9 MIPI DSI panel support
  LF-10617-1 dt-bindings: display: panel: Add Raydium RM692C9
  ...
2023-11-22 17:04:46 +08:00
Arnd Bergmann
172056918a fbdev: fsl-diu-fb: mark wr_reg_wa() static
[ Upstream commit a5035c8184 ]

wr_reg_wa() is not an appropriate name for a global function, and doesn't need
to be global anyway, so mark it static and avoid the warning:

drivers/video/fbdev/fsl-diu-fb.c:493:6: error: no previous prototype for 'wr_reg_wa' [-Werror=missing-prototypes]

Fixes: 0d9dab39fb ("powerpc/5121: fsl-diu-fb: fix issue with re-enabling DIU area descriptor")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-11-20 11:59:38 +01:00
Dan Carpenter
b346a53115 fbdev: imsttfb: fix a resource leak in probe
[ Upstream commit aba6ab57a9 ]

I've re-written the error handling but the bug is that if init_imstt()
fails we need to call iounmap(par->cmap_regs).

Fixes: c75f5a5506 ("fbdev: imsttfb: Fix use after free bug in imsttfb_probe")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-11-20 11:59:38 +01:00
Dan Carpenter
85fd4eb8f6 fbdev: imsttfb: fix double free in probe()
[ Upstream commit e08c30efda ]

The init_imstt() function calls framebuffer_release() on error and then
the probe() function calls it again.  It should only be done in probe.

Fixes: 518ecb6a20 ("fbdev: imsttfb: Fix error path of imsttfb_probe()")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-11-20 11:59:38 +01:00
Sandor Yu
dc3ef9aa39 LF-9960: video: mxsfb: remove FBINFO_FLAG_DEFAULT flag
Flag FBINFO_FLAG_DEFAULT is removed from fb.h and
its value is 0, so remove FBINFO_FLAG_DEFAULT
will not affect any functions in this driver.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
2023-10-30 15:36:14 +08:00
Robby Cai
e7429ab9ea LF-9950 video: epdc: remove FBINFO_FLAG_DEFAULT flag
The value of FBINFO_FLAG_DEFAULT flags is 0 and info->flags is initialized
to 0 by kzalloc in framebuffer_alloc(), thus has no impact.

Signed-off-by: Robby Cai <robby.cai@nxp.com>
2023-10-30 15:36:14 +08:00
Robby Cai
5d0a8af45e LF-9180-4 video: epdc: fix dump caused by read permission set without show function
To fix by removing S_IRUGO. This fix has no function impact.

[    3.274088] ------------[ cut here ]------------
[    3.278794] Attribute update: read permission without 'show'
[    3.284597] WARNING: CPU: 1 PID: 9 at ../drivers/base/core.c:3019 device_create_file+0xa8/0xd0
[    3.293295] Modules linked in:
[    3.296384] CPU: 1 PID: 9 Comm: kworker/u4:0 Not tainted 6.1.22-00013-gf9364ee7bb8c #433
[    3.304537] Hardware name: NXP i.MX8ULP EVK (DT)
[    3.309194] Workqueue: events_unbound deferred_probe_work_func
[    3.315085] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    3.322102] pc : device_create_file+0xa8/0xd0
[    3.326498] lr : device_create_file+0xa8/0xd0
[    3.330897] sp : ffff80000806bae0
[    3.334240] x29: ffff80000806bae0 x28: 0000000000000000 x27: 0000000000000001
[    3.341448] x26: ffff6bd8045c4050 x25: ffffd0c84050d190 x24: ffff6bd8045c4558
[    3.348654] x23: ffff6bd8040e0c10 x22: ffffd0c8403c8c88 x21: 0000000000000000
[    3.355859] x20: ffff6bd805a55800 x19: ffffd0c8403c8e40 x18: 0000000000000006
[    3.363062] x17: ffffd0c840400cc8 x16: 000000000000023e x15: ffff80000806b610
[    3.370267] x14: 00000000000003b1 x13: 0000000000000000 x12: 0000000000000000
[    3.377474] x11: 0000000000000001 x10: 0000000000000a40 x9 : ffff80000806b990
[    3.384679] x8 : ffff6bd804118aa0 x7 : ffff6bd857bd2b40 x6 : 00000000ffffffff
[    3.391884] x5 : 00000000410fd040 x4 : 0000000000f0000f x3 : 0000000000100000
[    3.399088] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff6bd804118000
[    3.406295] Call trace:
[    3.408761]  device_create_file+0xa8/0xd0
[    3.412805]  mxc_epdc_fb_probe+0xe54/0x11f0
[    3.417027]  platform_probe+0x68/0xc0
[    3.420725]  really_probe+0xbc/0x2dc
[    3.424335]  __driver_probe_device+0x78/0xe0
[    3.428644]  driver_probe_device+0xd8/0x160
[    3.432864]  __device_attach_driver+0xb8/0x134
[    3.437348]  bus_for_each_drv+0x7c/0xd4
[    3.441219]  __device_attach+0x9c/0x1a0
[    3.445081]  device_initial_probe+0x14/0x20
[    3.449305]  bus_probe_device+0x98/0xa0
[    3.453178]  deferred_probe_work_func+0x80/0xc0
[    3.457751]  process_one_work+0x1d4/0x330
[    3.461800]  worker_thread+0x220/0x430
[    3.465587]  kthread+0x108/0x10c
[    3.468848]  ret_from_fork+0x10/0x20
[    3.472460] ---[ end trace 0000000000000000 ]---

Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Guoniu.zhou <guoniu.zhou@nxp.com>
(cherry picked from commit 8c5467c6dd)
2023-10-30 15:36:14 +08:00
Liu Ying
85b8af6c17 LF-9730 video: fbdev: mxc_ipuv3_fb: Check ipu_pre_config() return value
If ipu_pre_config() fails early and leave pre->store_addr unset,
_setup_disp_channel2() would then use the uninitialized pre.store_addr,
which makes Coverity complain about the uninitialized scalar variable.
Fix this issue by checking ipu_pre_config() return value.

This fixes Coverity issue: CID 22841537.

Cc: Sandor Yu <Sandor.yu@nxp.com>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
Reviewed-by: Sandor Yu <Sandor.yu@nxp.com>
2023-10-30 15:36:13 +08:00
Sandor Yu
78cd328a51 LF-9726: fbdev: mipi dsi northwest: fix Coverity issues
Fix Coverity issues.
CID 28813714: Out-of-bounds read (OVERRUN)
CID 22841779, CID 22841583: Uninitialized scalar variable

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
2023-10-30 15:36:13 +08:00
Robby Cai
ffa4fc05ef LF-9180-3 video: epdc: move device_create_file after framebuffer register
Without this patch, the 'update' node will not really be created under /sys
because info->dev is null before the framebuffer is registered and
device_create_file just returns with value 0.

Note: this interface is only for debug purpose, should not use for normal
case, e.g., udate waveform_mode during epdc update.

Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Guoniu.zhou <guoniu.zhou@nxp.com>
2023-10-30 15:36:13 +08:00
Robby Cai
6ca9af0983 LF-9180-2 video: epdc: fix Coverity issue: using uninitialized value update.waveform_mode
CID: 21635654

There is one corner case to call mxc_epdc_fb_send_update with 'update' parameter
where 'update.waveform_mode' is not initialized. This happens only when users
change the 'waveform_mode' via /sys interface with unexpected value.
Fixed by initializing the variable before use.

Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Guoniu.zhou <guoniu.zhou@nxp.com>
2023-10-30 15:36:13 +08:00
Robby Cai
a83edf0662 LF-9180-1 video: epdc_v2: fix Coverity issue: using uninitialized value update.quant_bit
CID: 21634739

There is no side effect even without this patch. The reason is the quant_bit variable
only takes effect when dither_mode variable is not 0 (now it's 0).
However, fix this by initializing the variable before use to avoid the coverity check/report.

Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Guoniu.zhou <guoniu.zhou@nxp.com>
2023-10-30 15:36:13 +08:00
Robby Cai
466d1bb66d LF-8539 video: fbdev: mxsfb: Fix Coverity Issue: 1480680 Copy into fixed size buffer
Fix Coverity Issue: 1480680 Copy into fixed size buffer

CID 1480680 (#1 of 2): Copy into fixed size buffer (STRING_OVERFLOW)
CID 1480680 (#2 of 2): Copy into fixed size buffer (STRING_OVERFLOW)
8. fixed_size_dest: You might overrun the 32-character fixed-size string host->disp_videomode by copying disp_videomode without checking the length.

Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Liu Ying <victor.liu@nxp.com>
2023-10-30 15:36:13 +08:00
Robby Cai
ddb9e9b37f LF-8538 video: fbdev: mxsfb: Fix Coverity Issue: 1480679 Uninitialized scalar variable
Fix Coverity Issue: 1480679 Uninitialized scalar variable

CID 1480679 (#1 of 1): Uninitialized scalar variable (UNINIT)
uninit_use_in_call: Using uninitialized value fb_vm. Field fb_vm.name is uninitialized when calling fb_add_videomode.

Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Liu Ying <victor.liu@nxp.com>
2023-10-30 15:36:13 +08:00
Robby Cai
0a71fc0ea7 LF-8221 fbdev: epdc: fix build error for epdc_v2
Fix following error caused by the change
a20dacd4c970f gpiolib: of: remove of_get_gpio[_flags]() and of_get_named_gpio_flags()

../drivers/video/fbdev/mxc/mxc_epdc_v2_fb.c: In function 'mxc_epdc_fb_probe':
../drivers/video/fbdev/mxc/mxc_epdc_v2_fb.c:5077:31: error: implicit declaration of function 'of_get_named_gpio_flags'; did you mean 'of_get_named_gpio'? [-Werror=implicit-function-declaration]
 5077 |                 enable_gpio = of_get_named_gpio_flags(np, "en-gpios", 0, &flag);
      |                               ^~~~~~~~~~~~~~~~~~~~~~~
      |                               of_get_named_gpio
cc1: some warnings being treated as errors

Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Guoniu.zhou <guoniu.zhou@nxp.com>
2023-10-30 15:36:13 +08:00
Robby Cai
e49f314414 LF-5163 video: epdc_v2: Fix Coverity Issue: 18996754 Unsigned compared against 0
correct type for rounded_pix_clk, rounded_parent_rate, which should be 'long'
as return value of clk_rounded_rate().

Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Alice Yuan <alice.yuan@nxp.com>
(cherry picked from commit 16d5e478a2)
2023-10-30 15:36:13 +08:00
Robby Cai
03d0a2ec1c LF-5082 media: epdc: Fix Coverity Issue: 3298979 Negative loop bound
Check the return value for clk_round_rate each time.
Correct type for rounded_pix_clk, rounded_parent_rate;

Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Alice Yuan <alice.yuan@nxp.com>
(cherry picked from commit f2404671cf)
2023-10-30 15:36:13 +08:00
Sandor Yu
0436ec882a LF-6559: video: mxc_ipuv3: fix mxc_v4l2_output test case fail
Generalize access_ok() is introduced in 5.18 kernel by the patch.

commit 12700c17fc ("uaccess: generalize access_ok()")

copy_from_user() and copy_to_user() could only handle pointer
from user space after the above patch applied.

mxc_ipu fb_ioctl interface MXCFB_SET_OVERLAY_POS is designed to support
caller from both user and kernel space.
mxc_copy_from_user() and mxc_copy_to_user() are implemented this patch,
use memcpy() to handle kernel space pointer.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
Reviewed-by: Liu Ying <victor.liu@nxp.com>
2023-10-30 15:36:13 +08:00
Robby Cai
3d3a8b1e6d LF-5913-2 fbdev: epdc: fix implicit conversion from different enumeration
change DMA_TO_DEV (of type dma_data_direction) to DMA_MEM_TO_DEV (of type dma_transfer_direction)
which is required by device_prep_slave_sg().

Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Guoniu.zhou <guoniu.zhou@nxp.com>
2023-10-30 15:36:13 +08:00
Robby Cai
ac35ed9337 LF-5913-1 fbdev: epdc_v2: fix implicit conversion from different enumeration build warning
drivers/video/fbdev/mxc/mxc_epdc_v2_fb.c:6053:12: warning: implicit conversion from enumeration type
'enum dma_data_direction' to different enumeration type 'enum dma_transfer_direction' [-Wenum-conversion]
                                                     DMA_TO_DEVICE,
                                                     ^~~~~~~~~~~~~
drivers/video/fbdev/mxc/mxc_epdc_v2_fb.c:6234:12: warning: implicit conversion from enumeration type
'enum dma_data_direction' to different enumeration type 'enum dma_transfer_direction' [-Wenum-conversion]
                                                     DMA_TO_DEVICE,
                                                     ^~~~~~~~~~~~~
drivers/video/fbdev/mxc/mxc_epdc_v2_fb.c:6371:12: warning: implicit conversion from enumeration type
'enum dma_data_direction' to different enumeration type 'enum dma_transfer_direction' [-Wenum-conversion]
                                                     DMA_TO_DEVICE,
                                                     ^~~~~~~~~~~~~
drivers/video/fbdev/mxc/mxc_epdc_v2_fb.c:6519:12: warning: implicit conversion from enumeration type
'enum dma_data_direction' to different enumeration type 'enum dma_transfer_direction' [-Wenum-conversion]
                                                     DMA_TO_DEVICE,
                                                     ^~~~~~~~~~~~~
drivers/video/fbdev/mxc/mxc_epdc_v2_fb.c:6716:12: warning: implicit conversion from enumeration type
'enum dma_data_direction' to different enumeration type 'enum dma_transfer_direction' [-Wenum-conversion]
                                                     DMA_TO_DEVICE,

To reproduce the warnings:
1) Install clang 12:
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 12

2) Build kernel with clang:
export PATH=/usr/lib/llvm-12/bin/:$PATH  LLVM=1
make ARCH=arm64 imx_v8_defconfig
make ARCH=arm64

Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Guoniu.zhou <guoniu.zhou@nxp.com>
2023-10-30 15:36:12 +08:00
Liu Ying
4c27bbe4b0 LF-2658 video: fbdev: mxc: Forward ipuv3 LCD external port(mxc_lcdif) driver from imx_4.19.y kernel
This patch forwards ipuv3 LCD external port(mxc_lcdif) driver from
imx_4.19.y kernel.

Reviewed-by: Robby Cai <robby.cai@nxp.com>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
2023-10-30 15:36:12 +08:00
Sandor Yu
9f1fe9e73f fbdev: dcic: Enable imx6 dcic driver
This patch forwards imx6 dcic driver from imx_4.19.y kernel.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
[ Aisheng: squash fixes ]
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
[ Robby: squash fix to update class_create() usage ]
Signed-off-by: Robby Cai <robby.cai@nxp.com>
2023-10-30 15:36:12 +08:00
Sandor Yu
a3836d2da3 video: fbdev: mxc: hdmi: add hdmi framebuffer driver
Add imx6 hdmi framebuffer driver.
This patch forwards imx6 HDMI framebuffer driver from imx_4.19.y kernel.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
[ Aisheng: squash fixes ]
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
[ Liu Ying: Drop platform_device_unregister() from mxc_hdmi_disp_deinit() ]
[ Liu Ying: Remove device attributes in mxc_hdmi_disp_deinit() ]
Signed-off-by: Liu Ying <victor.liu@nxp.com>
[ Liu Ying: Squash a change to make mxc_hdmi_i2c_remove() return void ]
Signed-off-by: Liu Ying <victor.liu@nxp.com>
[ Robby Cai: Update class_create() api ]
Signed-off-by: Robby Cai <robby.cai@nxp.com>
2023-10-30 15:36:12 +08:00