diff mbox series

[RFC,14/20] drm/omap: Convert to generic image format library

Message ID 49fd5e9fe1712ca4c6aee2e376ffda2cec11bc13.1553032382.git-series.maxime.ripard@bootlin.com (mailing list archive)
State New, archived
Headers show
Series drm: Split out the formats API and move it to a common place | expand

Commit Message

Maxime Ripard March 19, 2019, 9:57 p.m. UTC
Now that we have a generic image format libary, let's convert drivers to
use it so that we can deprecate the old DRM one.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
 drivers/gpu/drm/omapdrm/dss/dispc.c |  9 +++++----
 drivers/gpu/drm/omapdrm/omap_fb.c   |  7 ++++---
 2 files changed, 9 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c
index ba82d916719c..bf60d49ad6ca 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -25,6 +25,7 @@ 
 #include <linux/vmalloc.h>
 #include <linux/export.h>
 #include <linux/clk.h>
+#include <linux/image-formats.h>
 #include <linux/io.h>
 #include <linux/jiffies.h>
 #include <linux/seq_file.h>
@@ -1898,9 +1899,9 @@  static void dispc_ovl_set_scaling_uv(struct dispc_device *dispc,
 	int scale_x = out_width != orig_width;
 	int scale_y = out_height != orig_height;
 	bool chroma_upscale = plane != OMAP_DSS_WB;
-	const struct drm_format_info *info;
+	const struct image_format_info *info;
 
-	info = drm_format_info(fourcc);
+	info = image_format_drm_lookup(fourcc);
 
 	if (!dispc_has_feature(dispc, FEAT_HANDLE_UV_SEPARATE))
 		return;
@@ -2623,9 +2624,9 @@  static int dispc_ovl_setup_common(struct dispc_device *dispc,
 	bool ilace = !!(vm->flags & DISPLAY_FLAGS_INTERLACED);
 	unsigned long pclk = dispc_plane_pclk_rate(dispc, plane);
 	unsigned long lclk = dispc_plane_lclk_rate(dispc, plane);
-	const struct drm_format_info *info;
+	const struct image_format_info *info;
 
-	info = drm_format_info(fourcc);
+	info = image_format_drm_lookup(fourcc);
 
 	/* when setting up WB, dispc_plane_pclk_rate() returns 0 */
 	if (plane == OMAP_DSS_WB)
diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c b/drivers/gpu/drm/omapdrm/omap_fb.c
index 1d4143adf829..8caecfc8d1db 100644
--- a/drivers/gpu/drm/omapdrm/omap_fb.c
+++ b/drivers/gpu/drm/omapdrm/omap_fb.c
@@ -15,6 +15,7 @@ 
  * this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <linux/image-formats.h>
 #include <linux/seq_file.h>
 
 #include <drm/drm_crtc.h>
@@ -60,7 +61,7 @@  struct plane {
 struct omap_framebuffer {
 	struct drm_framebuffer base;
 	int pin_count;
-	const struct drm_format_info *format;
+	const struct image_format_info *format;
 	struct plane planes[2];
 	/* lock for pinning (pin_count and planes.dma_addr) */
 	struct mutex lock;
@@ -72,7 +73,7 @@  static const struct drm_framebuffer_funcs omap_framebuffer_funcs = {
 };
 
 static u32 get_linear_addr(struct drm_framebuffer *fb,
-		const struct drm_format_info *format, int n, int x, int y)
+		const struct image_format_info *format, int n, int x, int y)
 {
 	struct omap_framebuffer *omap_fb = to_omap_framebuffer(fb);
 	struct plane *plane = &omap_fb->planes[n];
@@ -126,7 +127,7 @@  void omap_framebuffer_update_scanout(struct drm_framebuffer *fb,
 		struct drm_plane_state *state, struct omap_overlay_info *info)
 {
 	struct omap_framebuffer *omap_fb = to_omap_framebuffer(fb);
-	const struct drm_format_info *format = omap_fb->format;
+	const struct image_format_info *format = omap_fb->format;
 	struct plane *plane = &omap_fb->planes[0];
 	u32 x, y, orient = 0;