Commit 70e137e3 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'fbdev-for-6.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev

Pull fbdev fixes from Helge Deller:
 "A few small unspectacular fbdev fixes:

   - Fix for USB endpoint check in udlfb (found by syzbot fuzzer)

   - Small fix in error code path in omapfb

   - compiler warning fixes in fbmem & i810

   - code removal and whitespace cleanups in stifb and atyfb"

* tag 'fbdev-for-6.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev:
  fbdev: stifb: Whitespace cleanups
  fbdev: udlfb: Use usb_control_msg_send()
  fbdev: udlfb: Fix endpoint check
  fbdev: atyfb: Remove unused clock determination
  fbdev: i810: include i810_main.h in i810_dvt.c
  fbdev: fbmem: mark get_fb_unmapped_area() static
  fbdev: omapfb: panel-tpo-td043mtea1: fix error code in probe()
parents e2065b8c d9a45969
...@@ -124,7 +124,7 @@ config FB_PROVIDE_GET_FB_UNMAPPED_AREA ...@@ -124,7 +124,7 @@ config FB_PROVIDE_GET_FB_UNMAPPED_AREA
depends on FB depends on FB
help help
Allow generic frame-buffer to provide get_fb_unmapped_area Allow generic frame-buffer to provide get_fb_unmapped_area
function. function to provide shareable character device support on nommu.
menuconfig FB_FOREIGN_ENDIAN menuconfig FB_FOREIGN_ENDIAN
bool "Framebuffer foreign endianness support" bool "Framebuffer foreign endianness support"
......
...@@ -3498,11 +3498,6 @@ static int atyfb_setup_generic(struct pci_dev *pdev, struct fb_info *info, ...@@ -3498,11 +3498,6 @@ static int atyfb_setup_generic(struct pci_dev *pdev, struct fb_info *info,
if (ret) if (ret)
goto atyfb_setup_generic_fail; goto atyfb_setup_generic_fail;
#endif #endif
if (!(aty_ld_le32(CRTC_GEN_CNTL, par) & CRTC_EXT_DISP_EN))
par->clk_wr_offset = (inb(R_GENMO) & 0x0CU) >> 2;
else
par->clk_wr_offset = aty_ld_8(CLOCK_CNTL, par) & 0x03U;
/* according to ATI, we should use clock 3 for acelerated mode */ /* according to ATI, we should use clock 3 for acelerated mode */
par->clk_wr_offset = 3; par->clk_wr_offset = 3;
......
...@@ -1468,7 +1468,7 @@ __releases(&info->lock) ...@@ -1468,7 +1468,7 @@ __releases(&info->lock)
} }
#if defined(CONFIG_FB_PROVIDE_GET_FB_UNMAPPED_AREA) && !defined(CONFIG_MMU) #if defined(CONFIG_FB_PROVIDE_GET_FB_UNMAPPED_AREA) && !defined(CONFIG_MMU)
unsigned long get_fb_unmapped_area(struct file *filp, static unsigned long get_fb_unmapped_area(struct file *filp,
unsigned long addr, unsigned long len, unsigned long addr, unsigned long len,
unsigned long pgoff, unsigned long flags) unsigned long pgoff, unsigned long flags)
{ {
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "i810_regs.h" #include "i810_regs.h"
#include "i810.h" #include "i810.h"
#include "i810_main.h"
struct mode_registers std_modes[] = { struct mode_registers std_modes[] = {
/* 640x480 @ 60Hz */ /* 640x480 @ 60Hz */
...@@ -276,7 +277,7 @@ void i810fb_fill_var_timings(struct fb_var_screeninfo *var) ...@@ -276,7 +277,7 @@ void i810fb_fill_var_timings(struct fb_var_screeninfo *var)
var->upper_margin = total - (yres + var->lower_margin + var->vsync_len); var->upper_margin = total - (yres + var->lower_margin + var->vsync_len);
} }
u32 i810_get_watermark(struct fb_var_screeninfo *var, u32 i810_get_watermark(const struct fb_var_screeninfo *var,
struct i810fb_par *par) struct i810fb_par *par)
{ {
struct mode_registers *params = &par->regs; struct mode_registers *params = &par->regs;
......
...@@ -491,7 +491,8 @@ static int tpo_td043_probe(struct spi_device *spi) ...@@ -491,7 +491,8 @@ static int tpo_td043_probe(struct spi_device *spi)
ddata->vcc_reg = devm_regulator_get(&spi->dev, "vcc"); ddata->vcc_reg = devm_regulator_get(&spi->dev, "vcc");
if (IS_ERR(ddata->vcc_reg)) { if (IS_ERR(ddata->vcc_reg)) {
r = dev_err_probe(&spi->dev, r, "failed to get LCD VCC regulator\n"); r = dev_err_probe(&spi->dev, PTR_ERR(ddata->vcc_reg),
"failed to get LCD VCC regulator\n");
goto err_regulator; goto err_regulator;
} }
......
...@@ -741,7 +741,7 @@ ngleClearOverlayPlanes(struct stifb_info *fb, int mask, int data) ...@@ -741,7 +741,7 @@ ngleClearOverlayPlanes(struct stifb_info *fb, int mask, int data)
packed_len = (fb->info.var.xres << 16) | fb->info.var.yres; packed_len = (fb->info.var.xres << 16) | fb->info.var.yres;
NGLE_SET_DSTXY(fb, packed_dst); NGLE_SET_DSTXY(fb, packed_dst);
/* Write zeroes to overlay planes */ /* Write zeroes to overlay planes */
NGLE_QUICK_SET_IMAGE_BITMAP_OP(fb, NGLE_QUICK_SET_IMAGE_BITMAP_OP(fb,
IBOvals(RopSrc, MaskAddrOffset(0), IBOvals(RopSrc, MaskAddrOffset(0),
BitmapExtent08, StaticReg(0), BitmapExtent08, StaticReg(0),
...@@ -1297,14 +1297,14 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref) ...@@ -1297,14 +1297,14 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref)
break; break;
default: default:
#ifdef FALLBACK_TO_1BPP #ifdef FALLBACK_TO_1BPP
printk(KERN_WARNING printk(KERN_WARNING
"stifb: Unsupported graphics card (id=0x%08x) " "stifb: Unsupported graphics card (id=0x%08x) "
"- now trying 1bpp mode instead\n", "- now trying 1bpp mode instead\n",
fb->id); fb->id);
bpp = 1; /* default to 1 bpp */ bpp = 1; /* default to 1 bpp */
break; break;
#else #else
printk(KERN_WARNING printk(KERN_WARNING
"stifb: Unsupported graphics card (id=0x%08x) " "stifb: Unsupported graphics card (id=0x%08x) "
"- skipping.\n", "- skipping.\n",
fb->id); fb->id);
......
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
#include <video/udlfb.h> #include <video/udlfb.h>
#include "edid.h" #include "edid.h"
#define OUT_EP_NUM 1 /* The endpoint number we will use */
static const struct fb_fix_screeninfo dlfb_fix = { static const struct fb_fix_screeninfo dlfb_fix = {
.id = "udlfb", .id = "udlfb",
.type = FB_TYPE_PACKED_PIXELS, .type = FB_TYPE_PACKED_PIXELS,
...@@ -1541,24 +1543,16 @@ static const struct device_attribute fb_device_attrs[] = { ...@@ -1541,24 +1543,16 @@ static const struct device_attribute fb_device_attrs[] = {
static int dlfb_select_std_channel(struct dlfb_data *dlfb) static int dlfb_select_std_channel(struct dlfb_data *dlfb)
{ {
int ret; int ret;
void *buf;
static const u8 set_def_chn[] = { static const u8 set_def_chn[] = {
0x57, 0xCD, 0xDC, 0xA7, 0x57, 0xCD, 0xDC, 0xA7,
0x1C, 0x88, 0x5E, 0x15, 0x1C, 0x88, 0x5E, 0x15,
0x60, 0xFE, 0xC6, 0x97, 0x60, 0xFE, 0xC6, 0x97,
0x16, 0x3D, 0x47, 0xF2 }; 0x16, 0x3D, 0x47, 0xF2 };
buf = kmemdup(set_def_chn, sizeof(set_def_chn), GFP_KERNEL); ret = usb_control_msg_send(dlfb->udev, 0, NR_USB_REQUEST_CHANNEL,
if (!buf)
return -ENOMEM;
ret = usb_control_msg(dlfb->udev, usb_sndctrlpipe(dlfb->udev, 0),
NR_USB_REQUEST_CHANNEL,
(USB_DIR_OUT | USB_TYPE_VENDOR), 0, 0, (USB_DIR_OUT | USB_TYPE_VENDOR), 0, 0,
buf, sizeof(set_def_chn), USB_CTRL_SET_TIMEOUT); &set_def_chn, sizeof(set_def_chn), USB_CTRL_SET_TIMEOUT,
GFP_KERNEL);
kfree(buf);
return ret; return ret;
} }
...@@ -1652,7 +1646,7 @@ static int dlfb_usb_probe(struct usb_interface *intf, ...@@ -1652,7 +1646,7 @@ static int dlfb_usb_probe(struct usb_interface *intf,
struct fb_info *info; struct fb_info *info;
int retval; int retval;
struct usb_device *usbdev = interface_to_usbdev(intf); struct usb_device *usbdev = interface_to_usbdev(intf);
struct usb_endpoint_descriptor *out; static u8 out_ep[] = {OUT_EP_NUM + USB_DIR_OUT, 0};
/* usb initialization */ /* usb initialization */
dlfb = kzalloc(sizeof(*dlfb), GFP_KERNEL); dlfb = kzalloc(sizeof(*dlfb), GFP_KERNEL);
...@@ -1666,9 +1660,9 @@ static int dlfb_usb_probe(struct usb_interface *intf, ...@@ -1666,9 +1660,9 @@ static int dlfb_usb_probe(struct usb_interface *intf,
dlfb->udev = usb_get_dev(usbdev); dlfb->udev = usb_get_dev(usbdev);
usb_set_intfdata(intf, dlfb); usb_set_intfdata(intf, dlfb);
retval = usb_find_common_endpoints(intf->cur_altsetting, NULL, &out, NULL, NULL); if (!usb_check_bulk_endpoints(intf, out_ep)) {
if (retval) { dev_err(&intf->dev, "Invalid DisplayLink device!\n");
dev_err(&intf->dev, "Device should have at lease 1 bulk endpoint!\n"); retval = -EINVAL;
goto error; goto error;
} }
...@@ -1927,7 +1921,8 @@ static int dlfb_alloc_urb_list(struct dlfb_data *dlfb, int count, size_t size) ...@@ -1927,7 +1921,8 @@ static int dlfb_alloc_urb_list(struct dlfb_data *dlfb, int count, size_t size)
} }
/* urb->transfer_buffer_length set to actual before submit */ /* urb->transfer_buffer_length set to actual before submit */
usb_fill_bulk_urb(urb, dlfb->udev, usb_sndbulkpipe(dlfb->udev, 1), usb_fill_bulk_urb(urb, dlfb->udev,
usb_sndbulkpipe(dlfb->udev, OUT_EP_NUM),
buf, size, dlfb_urb_completion, unode); buf, size, dlfb_urb_completion, unode);
urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment