Commit dc49c3b1 authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'drm-misc-fixes-2023-05-11' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes



drm-misc-fixes for v6.4-rc2:
- More DSC macro fixes.
- Small mipi-dsi fix.
- Scheduler timeout handling fix.

---

drm-misc-fixes for v6.4-rc1:
- Fix DSC macros.
- Fix VESA format for simplefb.
- Prohibit potential out-of-bounds access in generic fbdev emulation.
- Improve AST2500+ compat on ARM.

Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/b34135e3-2651-4e0a-a776-9b047882b1b2@linux.intel.com
parents ac9a7868 2da5bffe
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -51,7 +51,8 @@ __init bool sysfb_parse_mode(const struct screen_info *si,
	 *
	 * It's not easily possible to fix this in struct screen_info,
	 * as this could break UAPI. The best solution is to compute
	 * bits_per_pixel here and ignore lfb_depth. In the loop below,
	 * bits_per_pixel from the color bits, reserved bits and
	 * reported lfb_depth, whichever is highest.  In the loop below,
	 * ignore simplefb formats with alpha bits, as EFI and VESA
	 * don't specify alpha channels.
	 */
@@ -60,6 +61,7 @@ __init bool sysfb_parse_mode(const struct screen_info *si,
					  si->green_size + si->green_pos,
					  si->blue_size + si->blue_pos),
				     si->rsvd_size + si->rsvd_pos);
		bits_per_pixel = max_t(u32, bits_per_pixel, si->lfb_depth);
	} else {
		bits_per_pixel = si->lfb_depth;
	}
+5 −4
Original line number Diff line number Diff line
@@ -425,11 +425,12 @@ struct ast_device *ast_device_create(const struct drm_driver *drv,
		return ERR_PTR(-EIO);

	/*
	 * If we don't have IO space at all, use MMIO now and
	 * assume the chip has MMIO enabled by default (rev 0x20
	 * and higher).
	 * After AST2500, MMIO is enabled by default, and it should be adopted
	 * to be compatible with Arm.
	 */
	if (!(pci_resource_flags(pdev, 2) & IORESOURCE_IO)) {
	if (pdev->revision >= 0x40) {
		ast->ioregs = ast->regs + AST_IO_MM_OFFSET;
	} else if (!(pci_resource_flags(pdev, 2) & IORESOURCE_IO)) {
		drm_info(dev, "platform has no IO space, trying MMIO\n");
		ast->ioregs = ast->regs + AST_IO_MM_OFFSET;
	}
+12 −4
Original line number Diff line number Diff line
@@ -641,19 +641,27 @@ static void drm_fb_helper_damage(struct drm_fb_helper *helper, u32 x, u32 y,
static void drm_fb_helper_memory_range_to_clip(struct fb_info *info, off_t off, size_t len,
					       struct drm_rect *clip)
{
	u32 line_length = info->fix.line_length;
	u32 fb_height = info->var.yres;
	off_t end = off + len;
	u32 x1 = 0;
	u32 y1 = off / info->fix.line_length;
	u32 y1 = off / line_length;
	u32 x2 = info->var.xres;
	u32 y2 = DIV_ROUND_UP(end, info->fix.line_length);
	u32 y2 = DIV_ROUND_UP(end, line_length);

	/* Don't allow any of them beyond the bottom bound of display area */
	if (y1 > fb_height)
		y1 = fb_height;
	if (y2 > fb_height)
		y2 = fb_height;

	if ((y2 - y1) == 1) {
		/*
		 * We've only written to a single scanline. Try to reduce
		 * the number of horizontal pixels that need an update.
		 */
		off_t bit_off = (off % info->fix.line_length) * 8;
		off_t bit_end = (end % info->fix.line_length) * 8;
		off_t bit_off = (off % line_length) * 8;
		off_t bit_end = (end % line_length) * 8;

		x1 = bit_off / info->var.bits_per_pixel;
		x2 = DIV_ROUND_UP(bit_end, info->var.bits_per_pixel);
+1 −1
Original line number Diff line number Diff line
@@ -221,7 +221,7 @@ mipi_dsi_device_register_full(struct mipi_dsi_host *host,
		return dsi;
	}

	dsi->dev.of_node = info->node;
	device_set_node(&dsi->dev, of_fwnode_handle(info->node));
	dsi->channel = info->channel;
	strlcpy(dsi->name, info->type, sizeof(dsi->name));

+3 −1
Original line number Diff line number Diff line
@@ -2,6 +2,8 @@
#ifndef __NVIF_IF0012_H__
#define __NVIF_IF0012_H__

#include <drm/display/drm_dp.h>

union nvif_outp_args {
	struct nvif_outp_v0 {
		__u8 version;
@@ -63,7 +65,7 @@ union nvif_outp_acquire_args {
				__u8 hda;
				__u8 mst;
				__u8 pad04[4];
				__u8 dpcd[16];
				__u8 dpcd[DP_RECEIVER_CAP_SIZE];
			} dp;
		};
	} v0;
Loading