Skip to content

Commit

Permalink
Merge tag 'meson-drm-fixes-for-4.10' of git://people.freedesktop.org/…
Browse files Browse the repository at this point in the history
…~narmstrong/linux into drm-fixes

- plan atomic check oops fix
- fix CVBS init when HDMI is configured by bootloader
- fix CVBS VDAC disable

* tag 'meson-drm-fixes-for-4.10' of git://people.freedesktop.org/~narmstrong/linux:
  drm/meson: Fix CVBS VDAC disable
  drm/meson: Fix CVBS initialization when HDMI is configured by bootloader
  drm/meson: Fix plane atomic check when no crtc for the plane
  • Loading branch information
Dave Airlie committed Jan 8, 2017
2 parents 13fe46b + 5db60ea commit 90e5d2d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
3 changes: 3 additions & 0 deletions drivers/gpu/drm/meson/meson_plane.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ static int meson_plane_atomic_check(struct drm_plane *plane,
struct drm_crtc_state *crtc_state;
struct drm_rect clip = { 0, };

if (!state->crtc)
return 0;

crtc_state = drm_atomic_get_crtc_state(state->state, state->crtc);
if (IS_ERR(crtc_state))
return PTR_ERR(crtc_state);
Expand Down
19 changes: 19 additions & 0 deletions drivers/gpu/drm/meson/meson_venc.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@
* - TV Panel encoding via ENCT
*/

/* HHI Registers */
#define HHI_VDAC_CNTL0 0x2F4 /* 0xbd offset in data sheet */
#define HHI_VDAC_CNTL1 0x2F8 /* 0xbe offset in data sheet */
#define HHI_HDMI_PHY_CNTL0 0x3a0 /* 0xe8 offset in data sheet */

struct meson_cvbs_enci_mode meson_cvbs_enci_pal = {
.mode_tag = MESON_VENC_MODE_CVBS_PAL,
.hso_begin = 3,
Expand Down Expand Up @@ -242,6 +247,20 @@ void meson_venc_disable_vsync(struct meson_drm *priv)

void meson_venc_init(struct meson_drm *priv)
{
/* Disable CVBS VDAC */
regmap_write(priv->hhi, HHI_VDAC_CNTL0, 0);
regmap_write(priv->hhi, HHI_VDAC_CNTL1, 8);

/* Power Down Dacs */
writel_relaxed(0xff, priv->io_base + _REG(VENC_VDAC_SETTING));

/* Disable HDMI PHY */
regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, 0);

/* Disable HDMI */
writel_bits_relaxed(0x3, 0,
priv->io_base + _REG(VPU_HDMI_SETTING));

/* Disable all encoders */
writel_relaxed(0, priv->io_base + _REG(ENCI_VIDEO_EN));
writel_relaxed(0, priv->io_base + _REG(ENCP_VIDEO_EN));
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/meson/meson_venc_cvbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ static void meson_venc_cvbs_encoder_disable(struct drm_encoder *encoder)

/* Disable CVBS VDAC */
regmap_write(priv->hhi, HHI_VDAC_CNTL0, 0);
regmap_write(priv->hhi, HHI_VDAC_CNTL1, 0);
regmap_write(priv->hhi, HHI_VDAC_CNTL1, 8);
}

static void meson_venc_cvbs_encoder_enable(struct drm_encoder *encoder)
Expand Down

0 comments on commit 90e5d2d

Please sign in to comment.