drm/sti: Fix sparse warnings
[cascardo/linux.git] / drivers / gpu / drm / sti / sti_gdp.c
index b8d942c..27b617d 100644 (file)
@@ -473,8 +473,8 @@ static void sti_gdp_disable(struct sti_gdp *gdp)
  * RETURNS:
  * 0 on success.
  */
-int sti_gdp_field_cb(struct notifier_block *nb,
-               unsigned long event, void *data)
+static int sti_gdp_field_cb(struct notifier_block *nb,
+                           unsigned long event, void *data)
 {
        struct sti_gdp *gdp = container_of(nb, struct sti_gdp, vtg_field_nb);
 
@@ -719,7 +719,7 @@ static void sti_gdp_atomic_update(struct drm_plane *drm_plane,
        u32 dma_updated_top;
        u32 dma_updated_btm;
        int format;
-       unsigned int depth, bpp;
+       unsigned int bpp;
        u32 ydo, xdo, yds, xds;
 
        if (!crtc || !fb)
@@ -758,9 +758,9 @@ static void sti_gdp_atomic_update(struct drm_plane *drm_plane,
                         (unsigned long)cma_obj->paddr);
 
        /* pixel memory location */
-       drm_fb_get_bpp_depth(fb->pixel_format, &depth, &bpp);
+       bpp = drm_format_plane_cpp(fb->pixel_format, 0);
        top_field->gam_gdp_pml = (u32)cma_obj->paddr + fb->offsets[0];
-       top_field->gam_gdp_pml += src_x * (bpp >> 3);
+       top_field->gam_gdp_pml += src_x * bpp;
        top_field->gam_gdp_pml += src_y * fb->pitches[0];
 
        /* output parameters (clamped / cropped) */
@@ -882,7 +882,7 @@ static int sti_gdp_late_register(struct drm_plane *drm_plane)
        return gdp_debugfs_init(gdp, drm_plane->dev->primary);
 }
 
-struct drm_plane_funcs sti_gdp_plane_helpers_funcs = {
+static const struct drm_plane_funcs sti_gdp_plane_helpers_funcs = {
        .update_plane = drm_atomic_helper_update_plane,
        .disable_plane = drm_atomic_helper_disable_plane,
        .destroy = sti_gdp_destroy,