summaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2021-03-16 07:45:12 +0100
committerDave Airlie <airlied@redhat.com>2021-03-16 08:08:46 +0100
commit51c3b916a4d7e24b4918925965867fdd9bd8dd59 (patch)
tree3257e3e0fda7fbb0fe1425177b0c661db1bfee63 /drivers/video
parentLinux 5.12-rc3 (diff)
parentdrm: fix drm_mode_create_blob comment (diff)
downloadlinux-51c3b916a4d7e24b4918925965867fdd9bd8dd59.tar.xz
linux-51c3b916a4d7e24b4918925965867fdd9bd8dd59.zip
Merge tag 'drm-misc-next-2021-03-03' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
drm-misc-next for 5.13: UAPI Changes: Cross-subsystem Changes: Core Changes: - %p4cc printk format modifier - atomic: introduce drm_crtc_commit_wait, rework atomic plane state helpers to take the drm_commit_state structure - dma-buf: heaps rework to return a struct dma_buf - simple-kms: Add plate state helpers - ttm: debugfs support, removal of sysfs Driver Changes: - Convert drivers to shadow plane helpers - arc: Move to drm/tiny - ast: cursor plane reworks - gma500: Remove TTM and medfield support - mxsfb: imx8mm support - panfrost: MMU IRQ handling rework - qxl: rework to better handle resources deallocation, locking - sun4i: Add alpha properties for UI and VI layers - vc4: RPi4 CEC support - vmwgfx: doc cleanup Signed-off-by: Dave Airlie <airlied@redhat.com> From: Maxime Ripard <maxime@cerno.tech> Link: https://patchwork.freedesktop.org/patch/msgid/20210303100600.dgnkadonzuvfnu22@gilmour
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/fbdev/amba-clcd.c17
-rw-r--r--drivers/video/fbdev/efifb.c3
-rw-r--r--drivers/video/fbdev/omap/hwa742.c42
-rw-r--r--drivers/video/fbdev/omap2/omapfb/dss/dsi.c2
-rw-r--r--drivers/video/fbdev/simplefb.c5
5 files changed, 35 insertions, 34 deletions
diff --git a/drivers/video/fbdev/amba-clcd.c b/drivers/video/fbdev/amba-clcd.c
index 33595cc4778e..9ec969e136bf 100644
--- a/drivers/video/fbdev/amba-clcd.c
+++ b/drivers/video/fbdev/amba-clcd.c
@@ -35,19 +35,6 @@
/* This is limited to 16 characters when displayed by X startup */
static const char *clcd_name = "CLCD FB";
-/*
- * Unfortunately, the enable/disable functions may be called either from
- * process or IRQ context, and we _need_ to delay. This is _not_ good.
- */
-static inline void clcdfb_sleep(unsigned int ms)
-{
- if (in_atomic()) {
- mdelay(ms);
- } else {
- msleep(ms);
- }
-}
-
static inline void clcdfb_set_start(struct clcd_fb *fb)
{
unsigned long ustart = fb->fb.fix.smem_start;
@@ -77,7 +64,7 @@ static void clcdfb_disable(struct clcd_fb *fb)
val &= ~CNTL_LCDPWR;
writel(val, fb->regs + fb->off_cntl);
- clcdfb_sleep(20);
+ msleep(20);
}
if (val & CNTL_LCDEN) {
val &= ~CNTL_LCDEN;
@@ -109,7 +96,7 @@ static void clcdfb_enable(struct clcd_fb *fb, u32 cntl)
cntl |= CNTL_LCDEN;
writel(cntl, fb->regs + fb->off_cntl);
- clcdfb_sleep(20);
+ msleep(20);
/*
* and now apply power.
diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c
index b80ba3d2a9b8..f58a545b3bf3 100644
--- a/drivers/video/fbdev/efifb.c
+++ b/drivers/video/fbdev/efifb.c
@@ -16,6 +16,7 @@
#include <linux/platform_device.h>
#include <linux/printk.h>
#include <linux/screen_info.h>
+#include <linux/pm_runtime.h>
#include <video/vga.h>
#include <asm/efi.h>
#include <drm/drm_utils.h> /* For drm_get_panel_orientation_quirk */
@@ -574,6 +575,7 @@ static int efifb_probe(struct platform_device *dev)
goto err_fb_dealoc;
}
fb_info(info, "%s frame buffer device\n", info->fix.id);
+ pm_runtime_get_sync(&efifb_pci_dev->dev);
return 0;
err_fb_dealoc:
@@ -600,6 +602,7 @@ static int efifb_remove(struct platform_device *pdev)
unregister_framebuffer(info);
sysfs_remove_groups(&pdev->dev.kobj, efifb_groups);
framebuffer_release(info);
+ pm_runtime_put(&efifb_pci_dev->dev);
return 0;
}
diff --git a/drivers/video/fbdev/omap/hwa742.c b/drivers/video/fbdev/omap/hwa742.c
index cfe63932f825..b191bef22d98 100644
--- a/drivers/video/fbdev/omap/hwa742.c
+++ b/drivers/video/fbdev/omap/hwa742.c
@@ -100,6 +100,14 @@ struct {
struct hwa742_request req_pool[REQ_POOL_SIZE];
struct list_head pending_req_list;
struct list_head free_req_list;
+
+ /*
+ * @req_lock: protect request slots pool and its tracking lists
+ * @req_sema: counter; slot allocators from task contexts must
+ * push it down before acquiring a slot. This
+ * guarantees that atomic contexts will always have
+ * a minimum of IRQ_REQ_POOL_SIZE slots available.
+ */
struct semaphore req_sema;
spinlock_t req_lock;
@@ -224,13 +232,13 @@ static void disable_tearsync(void)
hwa742_write_reg(HWA742_NDP_CTRL, b);
}
-static inline struct hwa742_request *alloc_req(void)
+static inline struct hwa742_request *alloc_req(bool can_sleep)
{
unsigned long flags;
struct hwa742_request *req;
int req_flags = 0;
- if (!in_interrupt())
+ if (can_sleep)
down(&hwa742.req_sema);
else
req_flags = REQ_FROM_IRQ_POOL;
@@ -399,8 +407,8 @@ static void send_frame_complete(void *data)
hwa742.int_ctrl->enable_plane(OMAPFB_PLANE_GFX, 0);
}
-#define ADD_PREQ(_x, _y, _w, _h) do { \
- req = alloc_req(); \
+#define ADD_PREQ(_x, _y, _w, _h, can_sleep) do {\
+ req = alloc_req(can_sleep); \
req->handler = send_frame_handler; \
req->complete = send_frame_complete; \
req->par.update.x = _x; \
@@ -413,7 +421,8 @@ static void send_frame_complete(void *data)
} while(0)
static void create_req_list(struct omapfb_update_window *win,
- struct list_head *req_head)
+ struct list_head *req_head,
+ bool can_sleep)
{
struct hwa742_request *req;
int x = win->x;
@@ -427,7 +436,7 @@ static void create_req_list(struct omapfb_update_window *win,
color_mode = win->format & OMAPFB_FORMAT_MASK;
if (x & 1) {
- ADD_PREQ(x, y, 1, height);
+ ADD_PREQ(x, y, 1, height, can_sleep);
width--;
x++;
flags &= ~OMAPFB_FORMAT_FLAG_TEARSYNC;
@@ -439,19 +448,19 @@ static void create_req_list(struct omapfb_update_window *win,
if (xspan * height * 2 > hwa742.max_transmit_size) {
yspan = hwa742.max_transmit_size / (xspan * 2);
- ADD_PREQ(x, ystart, xspan, yspan);
+ ADD_PREQ(x, ystart, xspan, yspan, can_sleep);
ystart += yspan;
yspan = height - yspan;
flags &= ~OMAPFB_FORMAT_FLAG_TEARSYNC;
}
- ADD_PREQ(x, ystart, xspan, yspan);
+ ADD_PREQ(x, ystart, xspan, yspan, can_sleep);
x += xspan;
width -= xspan;
flags &= ~OMAPFB_FORMAT_FLAG_TEARSYNC;
}
if (width)
- ADD_PREQ(x, y, 1, height);
+ ADD_PREQ(x, y, 1, height, can_sleep);
}
static void auto_update_complete(void *data)
@@ -461,12 +470,12 @@ static void auto_update_complete(void *data)
jiffies + HWA742_AUTO_UPDATE_TIME);
}
-static void hwa742_update_window_auto(struct timer_list *unused)
+static void __hwa742_update_window_auto(bool can_sleep)
{
LIST_HEAD(req_list);
struct hwa742_request *last;
- create_req_list(&hwa742.auto_update_window, &req_list);
+ create_req_list(&hwa742.auto_update_window, &req_list, can_sleep);
last = list_entry(req_list.prev, struct hwa742_request, entry);
last->complete = auto_update_complete;
@@ -475,6 +484,11 @@ static void hwa742_update_window_auto(struct timer_list *unused)
submit_req_list(&req_list);
}
+static void hwa742_update_window_auto(struct timer_list *unused)
+{
+ __hwa742_update_window_auto(false);
+}
+
int hwa742_update_window_async(struct fb_info *fbi,
struct omapfb_update_window *win,
void (*complete_callback)(void *arg),
@@ -497,7 +511,7 @@ int hwa742_update_window_async(struct fb_info *fbi,
goto out;
}
- create_req_list(win, &req_list);
+ create_req_list(win, &req_list, true);
last = list_entry(req_list.prev, struct hwa742_request, entry);
last->complete = complete_callback;
@@ -544,7 +558,7 @@ static void hwa742_sync(void)
struct hwa742_request *req;
struct completion comp;
- req = alloc_req();
+ req = alloc_req(true);
req->handler = sync_handler;
req->complete = NULL;
@@ -599,7 +613,7 @@ static int hwa742_set_update_mode(enum omapfb_update_mode mode)
omapfb_notify_clients(hwa742.fbdev, OMAPFB_EVENT_READY);
break;
case OMAPFB_AUTO_UPDATE:
- hwa742_update_window_auto(0);
+ __hwa742_update_window_auto(true);
break;
case OMAPFB_UPDATE_DISABLED:
break;
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c
index daa313f14335..d43b081d592f 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c
@@ -2376,8 +2376,6 @@ static int dsi_sync_vc(struct platform_device *dsidev, int channel)
WARN_ON(!dsi_bus_is_locked(dsidev));
- WARN_ON(in_interrupt());
-
if (!dsi_vc_is_enabled(dsidev, channel))
return 0;
diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c
index 533a047d07a2..62f0ded70681 100644
--- a/drivers/video/fbdev/simplefb.c
+++ b/drivers/video/fbdev/simplefb.c
@@ -477,9 +477,8 @@ static int simplefb_probe(struct platform_device *pdev)
simplefb_clocks_enable(par, pdev);
simplefb_regulators_enable(par, pdev);
- dev_info(&pdev->dev, "framebuffer at 0x%lx, 0x%x bytes, mapped to 0x%p\n",
- info->fix.smem_start, info->fix.smem_len,
- info->screen_base);
+ dev_info(&pdev->dev, "framebuffer at 0x%lx, 0x%x bytes\n",
+ info->fix.smem_start, info->fix.smem_len);
dev_info(&pdev->dev, "format=%s, mode=%dx%dx%d, linelength=%d\n",
params.format->name,
info->var.xres, info->var.yres,