}
if (private->domain) {
- int prot = IOMMU_READ | IOMMU_WRITE;
-
memset(&logo->mm, 0, sizeof(logo->mm));
ret = drm_mm_insert_node_generic(&private->mm, &logo->mm,
size, PAGE_SIZE,
logo->dma_addr = logo->mm.start;
- if (iommu_map_sg(private->domain, logo->dma_addr, sgt->sgl,
- sgt->nents, prot) < size) {
+ logo->iommu_map_size = iommu_map_sg(private->domain,
+ logo->dma_addr, sgt->sgl,
+ sgt->nents, IOMMU_READ);
+ if (logo->iommu_map_size < size) {
DRM_ERROR("failed to map buffer");
ret = -ENOMEM;
goto err_remove_node;
!connector_helper_funcs->best_encoder)
return -ENXIO;
encoder = connector_helper_funcs->best_encoder(connector);
+ if (!encoder)
+ return -ENXIO;
encoder_helper_funcs = encoder->helper_private;
- if (!encoder || !encoder_helper_funcs->atomic_check)
+ if (!encoder_helper_funcs->atomic_check)
return -ENXIO;
ret = encoder_helper_funcs->atomic_check(encoder, crtc->state,
conn_state);
int pipe = drm_crtc_index(crtc);
struct rockchip_drm_private *priv = crtc->dev->dev_private;
- if (pipe > ROCKCHIP_MAX_CRTC)
+ if (pipe >= ROCKCHIP_MAX_CRTC)
return -EINVAL;
priv->crtc_funcs[pipe] = crtc_funcs;
int pipe = drm_crtc_index(crtc);
struct rockchip_drm_private *priv = crtc->dev->dev_private;
- if (pipe > ROCKCHIP_MAX_CRTC)
+ if (pipe >= ROCKCHIP_MAX_CRTC)
return;
priv->crtc_funcs[pipe] = NULL;