static void ch7xxx_dump_regs(struct intel_dvo_device *dvo) { int i; for (i = 0; i < CH7xxx_NUM_REGS; i++) { uint8_t val; if ((i % 8) == 0) DRM_LOG_KMS("\n %02X: ", i); ch7xxx_readb(dvo, i, &val); DRM_LOG_KMS("%02X ", val); } }
static void sil164_dump_regs(struct intel_dvo_device *dvo) { uint8_t val; sil164_readb(dvo, SIL164_FREQ_LO, &val); DRM_LOG_KMS("SIL164_FREQ_LO: 0x%02x\n", val); sil164_readb(dvo, SIL164_FREQ_HI, &val); DRM_LOG_KMS("SIL164_FREQ_HI: 0x%02x\n", val); sil164_readb(dvo, SIL164_REG8, &val); DRM_LOG_KMS("SIL164_REG8: 0x%02x\n", val); sil164_readb(dvo, SIL164_REG9, &val); DRM_LOG_KMS("SIL164_REG9: 0x%02x\n", val); sil164_readb(dvo, SIL164_REGC, &val); DRM_LOG_KMS("SIL164_REGC: 0x%02x\n", val); }
static int __devinit exynos_drm_hdmi_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct exynos_drm_subdrv *subdrv; struct drm_hdmi_context *ctx; DRM_DEBUG_KMS("%s\n", __FILE__); ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); if (!ctx) { DRM_LOG_KMS("failed to alloc common hdmi context.\n"); return -ENOMEM; } subdrv = &ctx->subdrv; subdrv->probe = hdmi_subdrv_probe; subdrv->manager.pipe = -1; subdrv->manager.ops = &drm_hdmi_manager_ops; subdrv->manager.overlay_ops = &drm_hdmi_overlay_ops; subdrv->manager.display_ops = &drm_hdmi_display_ops; subdrv->manager.dev = dev; platform_set_drvdata(pdev, subdrv); exynos_drm_subdrv_register(subdrv); return 0; }
static int __devinit exynos_drm_hdmi_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct exynos_drm_subdrv *subdrv; struct drm_hdmi_context *ctx; DRM_DEBUG_KMS("%s\n", __FILE__); ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); if (!ctx) { DRM_LOG_KMS("failed to alloc common hdmi context.\n"); return -ENOMEM; } subdrv = &ctx->subdrv; subdrv->dev = dev; subdrv->manager = &hdmi_manager; subdrv->probe = hdmi_subdrv_probe; subdrv->open = hdmi_subdrv_open; subdrv->close = hdmi_subdrv_close; #if defined(CONFIG_BUSFREQ_OPP) || defined(CONFIG_BUSFREQ_LOCK_WRAPPER) /* To lock bus frequency in OPP mode */ ctx->bus_dev = dev_get("exynos-busfreq"); #endif platform_set_drvdata(pdev, subdrv); exynos_drm_subdrv_register(subdrv); return 0; }
static int ipu_drm_set_base(struct drm_crtc *crtc, int x, int y) { struct ipu_crtc *ipu_crtc = to_ipu_crtc(crtc); struct drm_gem_cma_object *cma_obj; struct drm_framebuffer *fb = crtc->fb; unsigned long phys; cma_obj = drm_fb_cma_get_gem_obj(fb, 0); if (!cma_obj) { DRM_LOG_KMS("entry is null.\n"); return -EFAULT; } phys = cma_obj->paddr; phys += x * (fb->bits_per_pixel >> 3); phys += y * fb->pitches[0]; dev_dbg(ipu_crtc->dev, "%s: phys: 0x%lx\n", __func__, phys); dev_dbg(ipu_crtc->dev, "%s: xy: %dx%d\n", __func__, x, y); ipu_cpmem_set_stride(ipu_get_cpmem(ipu_crtc->ipu_ch), fb->pitches[0]); ipu_cpmem_set_buffer(ipu_get_cpmem(ipu_crtc->ipu_ch), 0, phys); return 0; }
static int exynos_drm_hdmi_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct exynos_drm_subdrv *subdrv; struct drm_hdmi_context *ctx; DRM_DEBUG_KMS("%s\n", __FILE__); ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); if (!ctx) { DRM_LOG_KMS("failed to alloc common hdmi context.\n"); return -ENOMEM; } subdrv = &ctx->subdrv; subdrv->dev = dev; subdrv->manager = &hdmi_manager; subdrv->probe = hdmi_subdrv_probe; subdrv->remove = hdmi_subdrv_remove; platform_set_drvdata(pdev, subdrv); exynos_drm_subdrv_register(subdrv); return 0; }
int exynos_drm_overlay_update(struct exynos_drm_overlay *overlay, struct drm_framebuffer *fb, struct drm_display_mode *mode, struct exynos_drm_crtc_pos *pos) { struct exynos_drm_gem_buf *buffer; unsigned int actual_w; unsigned int actual_h; int nr = exynos_drm_format_num_buffers(fb->pixel_format); int i; for (i = 0; i < nr; i++) { buffer = exynos_drm_fb_buffer(fb, i); if (!buffer) { DRM_LOG_KMS("buffer is null\n"); return -EFAULT; } overlay->dma_addr[i] = buffer->dma_addr; overlay->vaddr[i] = buffer->kvaddr; DRM_DEBUG_KMS("buffer: %d, vaddr = 0x%lx, dma_addr = 0x%lx\n", i, (unsigned long)overlay->vaddr[i], (unsigned long)overlay->dma_addr[i]); } actual_w = min((mode->hdisplay - pos->crtc_x), pos->crtc_w); actual_h = min((mode->vdisplay - pos->crtc_y), pos->crtc_h); /* set drm framebuffer data. */ overlay->fb_x = pos->fb_x; overlay->fb_y = pos->fb_y; overlay->fb_width = fb->width; overlay->fb_height = fb->height; overlay->src_width = pos->src_w; overlay->src_height = pos->src_h; overlay->bpp = fb->bits_per_pixel; overlay->pitch = fb->pitches[0]; overlay->pixel_format = fb->pixel_format; /* set overlay range to be displayed. */ overlay->crtc_x = pos->crtc_x; overlay->crtc_y = pos->crtc_y; overlay->crtc_width = actual_w; overlay->crtc_height = actual_h; /* set drm mode data. */ overlay->mode_width = mode->hdisplay; overlay->mode_height = mode->vdisplay; overlay->refresh = mode->vrefresh; overlay->scan_flag = mode->flags; DRM_DEBUG_KMS("overlay : offset_x/y(%d,%d), width/height(%d,%d)", overlay->crtc_x, overlay->crtc_y, overlay->crtc_width, overlay->crtc_height); return 0; }
static int rockchip_drm_fbdev_update(struct drm_fb_helper *helper, struct drm_framebuffer *fb) { struct fb_info *fbi = helper->fbdev; struct drm_device *dev = helper->dev; struct rockchip_drm_gem_buf *buffer; unsigned int size = fb->width * fb->height * (fb->bits_per_pixel >> 3); unsigned long offset; DRM_DEBUG_KMS("%s\n", __FILE__); drm_fb_helper_fill_fix(fbi, fb->pitches[0], fb->depth); drm_fb_helper_fill_var(fbi, helper, fb->width, fb->height); /* RGB formats use only one buffer */ buffer = rockchip_drm_fb_buffer(fb, 0); if (!buffer) { DRM_LOG_KMS("buffer is null.\n"); return -EFAULT; } /* map pages with kernel virtual space. */ if (!buffer->kvaddr) { if (is_drm_iommu_supported(dev)) { unsigned int nr_pages = buffer->size >> PAGE_SHIFT; buffer->kvaddr = vmap(buffer->pages, nr_pages, VM_MAP, pgprot_writecombine(PAGE_KERNEL)); } else { phys_addr_t dma_addr = buffer->dma_addr; if (dma_addr) buffer->kvaddr = phys_to_virt(dma_addr); else buffer->kvaddr = (void __iomem *)NULL; } if (!buffer->kvaddr) { DRM_ERROR("failed to map pages to kernel space.\n"); return -EIO; } }