Lines Matching +full:vga +full:- +full:connector
1 // SPDX-License-Identifier: GPL-2.0-only
6 * Copyright (C) 2006-2008 Intel Corporation
14 #include <linux/dma-buf.h>
33 stat = readl(priv->regs + TVE200_INT_STAT); in tve200_irq()
50 val = readl(priv->regs + TVE200_CTRL); in tve200_irq()
53 drm_crtc_handle_vblank(&priv->pipe.crtc); in tve200_irq()
60 writel(val, priv->regs + TVE200_CTRL); in tve200_irq()
62 dev_err(priv->drm->dev, "stray IRQ %08x\n", stat); in tve200_irq()
65 writel(stat, priv->regs + TVE200_INT_CLR); in tve200_irq()
74 const struct drm_display_mode *mode = &cstate->mode; in tve200_display_check()
75 struct drm_framebuffer *old_fb = pipe->plane.state->fb; in tve200_display_check()
76 struct drm_framebuffer *fb = pstate->fb; in tve200_display_check()
81 if (!(mode->hdisplay == 352 && mode->vdisplay == 240) && /* SIF(525) */ in tve200_display_check()
82 !(mode->hdisplay == 352 && mode->vdisplay == 288) && /* CIF(625) */ in tve200_display_check()
83 !(mode->hdisplay == 640 && mode->vdisplay == 480) && /* VGA */ in tve200_display_check()
84 !(mode->hdisplay == 720 && mode->vdisplay == 480) && /* D1 */ in tve200_display_check()
85 !(mode->hdisplay == 720 && mode->vdisplay == 576)) { /* D1 */ in tve200_display_check()
87 mode->hdisplay, mode->vdisplay); in tve200_display_check()
88 return -EINVAL; in tve200_display_check()
96 DRM_DEBUG_KMS("FB not 32-bit aligned\n"); in tve200_display_check()
97 return -EINVAL; in tve200_display_check()
104 if (fb->pitches[0] != mode->hdisplay * fb->format->cpp[0]) { in tve200_display_check()
106 return -EINVAL; in tve200_display_check()
110 * We can't change the FB format in a flicker-free in tve200_display_check()
113 if (old_fb && old_fb->format != fb->format) in tve200_display_check()
114 cstate->mode_changed = true; in tve200_display_check()
124 struct drm_crtc *crtc = &pipe->crtc; in tve200_display_enable()
125 struct drm_plane *plane = &pipe->plane; in tve200_display_enable()
126 struct drm_device *drm = crtc->dev; in tve200_display_enable()
127 struct tve200_drm_dev_private *priv = drm->dev_private; in tve200_display_enable()
128 const struct drm_display_mode *mode = &cstate->mode; in tve200_display_enable()
129 struct drm_framebuffer *fb = plane->state->fb; in tve200_display_enable()
130 struct drm_connector *connector = priv->connector; in tve200_display_enable() local
131 u32 format = fb->format->format; in tve200_display_enable()
135 clk_prepare_enable(priv->clk); in tve200_display_enable()
138 writel(TVE200_CTRL_4_RESET, priv->regs + TVE200_CTRL_4); in tve200_display_enable()
141 if (readl(priv->regs + TVE200_CTRL_4) & TVE200_CTRL_4_RESET) in tve200_display_enable()
147 readl(priv->regs + TVE200_CTRL_4) & TVE200_CTRL_4_RESET) { in tve200_display_enable()
148 dev_err(drm->dev, "can't get hardware out of reset\n"); in tve200_display_enable()
166 if (connector->display_info.bus_flags & in tve200_display_enable()
170 if ((mode->hdisplay == 352 && mode->vdisplay == 240) || /* SIF(525) */ in tve200_display_enable()
171 (mode->hdisplay == 352 && mode->vdisplay == 288)) { /* CIF(625) */ in tve200_display_enable()
173 dev_info(drm->dev, "CIF mode\n"); in tve200_display_enable()
174 } else if (mode->hdisplay == 640 && mode->vdisplay == 480) { in tve200_display_enable()
176 dev_info(drm->dev, "VGA mode\n"); in tve200_display_enable()
177 } else if ((mode->hdisplay == 720 && mode->vdisplay == 480) || in tve200_display_enable()
178 (mode->hdisplay == 720 && mode->vdisplay == 576)) { in tve200_display_enable()
180 dev_info(drm->dev, "D1 mode\n"); in tve200_display_enable()
228 dev_err(drm->dev, "Unknown FB format 0x%08x\n", in tve200_display_enable()
229 fb->format->format); in tve200_display_enable()
236 writel(ctrl1, priv->regs + TVE200_CTRL); in tve200_display_enable()
243 struct drm_crtc *crtc = &pipe->crtc; in tve200_display_disable()
244 struct drm_device *drm = crtc->dev; in tve200_display_disable()
245 struct tve200_drm_dev_private *priv = drm->dev_private; in tve200_display_disable()
250 writel(0, priv->regs + TVE200_CTRL); in tve200_display_disable()
251 writel(TVE200_CTRL_4_RESET, priv->regs + TVE200_CTRL_4); in tve200_display_disable()
253 clk_disable_unprepare(priv->clk); in tve200_display_disable()
259 struct drm_crtc *crtc = &pipe->crtc; in tve200_display_update()
260 struct drm_device *drm = crtc->dev; in tve200_display_update()
261 struct tve200_drm_dev_private *priv = drm->dev_private; in tve200_display_update()
262 struct drm_pending_vblank_event *event = crtc->state->event; in tve200_display_update()
263 struct drm_plane *plane = &pipe->plane; in tve200_display_update()
264 struct drm_plane_state *pstate = plane->state; in tve200_display_update()
265 struct drm_framebuffer *fb = pstate->fb; in tve200_display_update()
270 priv->regs + TVE200_Y_FRAME_BASE_ADDR); in tve200_display_update()
273 if (fb->format->format == DRM_FORMAT_YUV420) { in tve200_display_update()
275 priv->regs + TVE200_U_FRAME_BASE_ADDR); in tve200_display_update()
277 priv->regs + TVE200_V_FRAME_BASE_ADDR); in tve200_display_update()
282 crtc->state->event = NULL; in tve200_display_update()
284 spin_lock_irq(&crtc->dev->event_lock); in tve200_display_update()
285 if (crtc->state->active && drm_crtc_vblank_get(crtc) == 0) in tve200_display_update()
289 spin_unlock_irq(&crtc->dev->event_lock); in tve200_display_update()
295 struct drm_crtc *crtc = &pipe->crtc; in tve200_display_enable_vblank()
296 struct drm_device *drm = crtc->dev; in tve200_display_enable_vblank()
297 struct tve200_drm_dev_private *priv = drm->dev_private; in tve200_display_enable_vblank()
300 writel(0xFF, priv->regs + TVE200_INT_CLR); in tve200_display_enable_vblank()
301 writel(TVE200_INT_V_STATUS, priv->regs + TVE200_INT_EN); in tve200_display_enable_vblank()
307 struct drm_crtc *crtc = &pipe->crtc; in tve200_display_disable_vblank()
308 struct drm_device *drm = crtc->dev; in tve200_display_disable_vblank()
309 struct tve200_drm_dev_private *priv = drm->dev_private; in tve200_display_disable_vblank()
311 writel(0, priv->regs + TVE200_INT_EN); in tve200_display_disable_vblank()
325 struct tve200_drm_dev_private *priv = drm->dev_private; in tve200_display_init()
347 ret = drm_simple_display_pipe_init(drm, &priv->pipe, in tve200_display_init()
351 priv->connector); in tve200_display_init()