Skip to content

Commit a088eb0

Browse files
committed
Merge tag 'drm-misc-fixes-2020-07-08' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes
* meson: OSD burst-length fixes * hibmc: fix runtime warning by setting up generic fbdev after registering device Signed-off-by: Dave Airlie <[email protected]> From: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/20200708121050.GA29420@linux-uq9g
2 parents 46a20c9 + 00debf8 commit a088eb0

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,6 @@ static int hibmc_load(struct drm_device *dev)
307307
/* reset all the states of crtc/plane/encoder/connector */
308308
drm_mode_config_reset(dev);
309309

310-
drm_fbdev_generic_setup(dev, dev->mode_config.preferred_depth);
311-
312310
return 0;
313311

314312
err:
@@ -355,6 +353,9 @@ static int hibmc_pci_probe(struct pci_dev *pdev,
355353
ret);
356354
goto err_unload;
357355
}
356+
357+
drm_fbdev_generic_setup(dev, dev->mode_config.preferred_depth);
358+
358359
return 0;
359360

360361
err_unload:

drivers/gpu/drm/meson/meson_registers.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,12 @@
261261
#define VIU_OSD_FIFO_DEPTH_VAL(val) ((val & 0x7f) << 12)
262262
#define VIU_OSD_WORDS_PER_BURST(words) (((words & 0x4) >> 1) << 22)
263263
#define VIU_OSD_FIFO_LIMITS(size) ((size & 0xf) << 24)
264+
#define VIU_OSD_BURST_LENGTH_24 (0x0 << 31 | 0x0 << 10)
265+
#define VIU_OSD_BURST_LENGTH_32 (0x0 << 31 | 0x1 << 10)
266+
#define VIU_OSD_BURST_LENGTH_48 (0x0 << 31 | 0x2 << 10)
267+
#define VIU_OSD_BURST_LENGTH_64 (0x0 << 31 | 0x3 << 10)
268+
#define VIU_OSD_BURST_LENGTH_96 (0x1 << 31 | 0x0 << 10)
269+
#define VIU_OSD_BURST_LENGTH_128 (0x1 << 31 | 0x1 << 10)
264270

265271
#define VD1_IF0_GEN_REG 0x1a50
266272
#define VD1_IF0_CANVAS0 0x1a51

drivers/gpu/drm/meson/meson_viu.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -411,13 +411,6 @@ void meson_viu_gxm_disable_osd1_afbc(struct meson_drm *priv)
411411
priv->io_base + _REG(VIU_MISC_CTRL1));
412412
}
413413

414-
static inline uint32_t meson_viu_osd_burst_length_reg(uint32_t length)
415-
{
416-
uint32_t val = (((length & 0x80) % 24) / 12);
417-
418-
return (((val & 0x3) << 10) | (((val & 0x4) >> 2) << 31));
419-
}
420-
421414
void meson_viu_init(struct meson_drm *priv)
422415
{
423416
uint32_t reg;
@@ -444,9 +437,9 @@ void meson_viu_init(struct meson_drm *priv)
444437
VIU_OSD_FIFO_LIMITS(2); /* fifo_lim: 2*16=32 */
445438

446439
if (meson_vpu_is_compatible(priv, VPU_COMPATIBLE_G12A))
447-
reg |= meson_viu_osd_burst_length_reg(32);
440+
reg |= VIU_OSD_BURST_LENGTH_32;
448441
else
449-
reg |= meson_viu_osd_burst_length_reg(64);
442+
reg |= VIU_OSD_BURST_LENGTH_64;
450443

451444
writel_relaxed(reg, priv->io_base + _REG(VIU_OSD1_FIFO_CTRL_STAT));
452445
writel_relaxed(reg, priv->io_base + _REG(VIU_OSD2_FIFO_CTRL_STAT));

0 commit comments

Comments
 (0)