Commit cce1a877 authored by Noralf Trønnes's avatar Noralf Trønnes
Browse files

drm/tinydrm: Use drm_gem_framebuffer_helper



Use drm_gem_framebuffer_helper directly instead of the cma
library wrappers.

Signed-off-by: default avatarNoralf Trønnes <noralf@tronnes.org>
Reviewed-by: default avatarEric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/1506255985-61113-2-git-send-email-noralf@tronnes.org
parent 320e421e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_crtc_helper.h>
#include <drm/drm_gem_framebuffer_helper.h>
#include <drm/tinydrm/tinydrm.h>
#include <linux/device.h>
#include <linux/dma-buf.h>
@@ -128,7 +129,7 @@ tinydrm_fb_create(struct drm_device *drm, struct drm_file *file_priv,
{
	struct tinydrm_device *tdev = drm->dev_private;

	return drm_fb_cma_create_with_funcs(drm, file_priv, mode_cmd,
	return drm_gem_fb_create_with_funcs(drm, file_priv, mode_cmd,
					    tdev->fb_funcs);
}

+3 −2
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@

#include <drm/drm_atomic_helper.h>
#include <drm/drm_crtc_helper.h>
#include <drm/drm_gem_framebuffer_helper.h>
#include <drm/drm_modes.h>
#include <drm/tinydrm/tinydrm.h>

@@ -144,7 +145,7 @@ EXPORT_SYMBOL(tinydrm_display_pipe_update);
 * @pipe: Simple display pipe
 * @plane_state: Plane state
 *
 * This function uses drm_fb_cma_prepare_fb() to check if the plane FB has an
 * This function uses drm_gem_fb_prepare_fb() to check if the plane FB has an
 * dma-buf attached, extracts the exclusive fence and attaches it to plane
 * state for the atomic helper to wait on. Drivers can use this as their
 * &drm_simple_display_pipe_funcs->prepare_fb callback.
@@ -152,7 +153,7 @@ EXPORT_SYMBOL(tinydrm_display_pipe_update);
int tinydrm_display_pipe_prepare_fb(struct drm_simple_display_pipe *pipe,
				    struct drm_plane_state *plane_state)
{
	return drm_fb_cma_prepare_fb(&pipe->plane, plane_state);
	return drm_gem_fb_prepare_fb(&pipe->plane, plane_state);
}
EXPORT_SYMBOL(tinydrm_display_pipe_prepare_fb);

+3 −2
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@
 * (at your option) any later version.
 */

#include <drm/drm_gem_framebuffer_helper.h>
#include <drm/tinydrm/mipi-dbi.h>
#include <drm/tinydrm/tinydrm-helpers.h>
#include <linux/debugfs.h>
@@ -253,8 +254,8 @@ static int mipi_dbi_fb_dirty(struct drm_framebuffer *fb,
}

static const struct drm_framebuffer_funcs mipi_dbi_fb_funcs = {
	.destroy	= drm_fb_cma_destroy,
	.create_handle	= drm_fb_cma_create_handle,
	.destroy	= drm_gem_fb_destroy,
	.create_handle	= drm_gem_fb_create_handle,
	.dirty		= mipi_dbi_fb_dirty,
};

+3 −2
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@
#include <linux/spi/spi.h>
#include <linux/thermal.h>

#include <drm/drm_gem_framebuffer_helper.h>
#include <drm/tinydrm/tinydrm.h>
#include <drm/tinydrm/tinydrm-helpers.h>

@@ -636,8 +637,8 @@ static int repaper_fb_dirty(struct drm_framebuffer *fb,
}

static const struct drm_framebuffer_funcs repaper_fb_funcs = {
	.destroy	= drm_fb_cma_destroy,
	.create_handle	= drm_fb_cma_create_handle,
	.destroy	= drm_gem_fb_destroy,
	.create_handle	= drm_gem_fb_create_handle,
	.dirty		= repaper_fb_dirty,
};

+3 −2
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
#include <linux/spi/spi.h>
#include <video/mipi_display.h>

#include <drm/drm_gem_framebuffer_helper.h>
#include <drm/tinydrm/mipi-dbi.h>
#include <drm/tinydrm/tinydrm-helpers.h>

@@ -167,8 +168,8 @@ static int st7586_fb_dirty(struct drm_framebuffer *fb,
}

static const struct drm_framebuffer_funcs st7586_fb_funcs = {
	.destroy	= drm_fb_cma_destroy,
	.create_handle	= drm_fb_cma_create_handle,
	.destroy	= drm_gem_fb_destroy,
	.create_handle	= drm_gem_fb_create_handle,
	.dirty		= st7586_fb_dirty,
};