Commit 3e1d65cd authored by Tomi Valkeinen's avatar Tomi Valkeinen

drm/omap: use DRM_FORMAT_* instead of OMAP_DSS_COLOR_*

This patch changes omapdrm to use DRM_FORMAT_* values instead of
OMAP_DSS_COLOR_* enum.
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
parent 9c39d17e
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/component.h> #include <linux/component.h>
#include <drm/drm_fourcc.h>
#include "omapdss.h" #include "omapdss.h"
#include "dss.h" #include "dss.h"
...@@ -158,7 +159,7 @@ enum omap_color_component { ...@@ -158,7 +159,7 @@ enum omap_color_component {
*/ */
DISPC_COLOR_COMPONENT_RGB_Y = 1 << 0, DISPC_COLOR_COMPONENT_RGB_Y = 1 << 0,
/* used for UV component for /* used for UV component for
* OMAP_DSS_COLOR_YUV2, OMAP_DSS_COLOR_UYVY, OMAP_DSS_COLOR_NV12 * DRM_FORMAT_YUYV, DRM_FORMAT_UYVY, DRM_FORMAT_NV12
* color formats on OMAP4 * color formats on OMAP4
*/ */
DISPC_COLOR_COMPONENT_UV = 1 << 1, DISPC_COLOR_COMPONENT_UV = 1 << 1,
...@@ -911,64 +912,64 @@ static void dispc_ovl_set_color_mode(enum omap_plane_id plane, ...@@ -911,64 +912,64 @@ static void dispc_ovl_set_color_mode(enum omap_plane_id plane,
u32 m = 0; u32 m = 0;
if (plane != OMAP_DSS_GFX) { if (plane != OMAP_DSS_GFX) {
switch (color_mode) { switch (color_mode) {
case OMAP_DSS_COLOR_NV12: case DRM_FORMAT_NV12:
m = 0x0; break; m = 0x0; break;
case OMAP_DSS_COLOR_RGBX16: case DRM_FORMAT_XRGB4444:
m = 0x1; break; m = 0x1; break;
case OMAP_DSS_COLOR_RGBA16: case DRM_FORMAT_RGBA4444:
m = 0x2; break; m = 0x2; break;
case OMAP_DSS_COLOR_RGB12U: case DRM_FORMAT_RGBX4444:
m = 0x4; break; m = 0x4; break;
case OMAP_DSS_COLOR_ARGB16: case DRM_FORMAT_ARGB4444:
m = 0x5; break; m = 0x5; break;
case OMAP_DSS_COLOR_RGB16: case DRM_FORMAT_RGB565:
m = 0x6; break; m = 0x6; break;
case OMAP_DSS_COLOR_ARGB16_1555: case DRM_FORMAT_ARGB1555:
m = 0x7; break; m = 0x7; break;
case OMAP_DSS_COLOR_RGB24U: case DRM_FORMAT_XRGB8888:
m = 0x8; break; m = 0x8; break;
case OMAP_DSS_COLOR_RGB24P: case DRM_FORMAT_RGB888:
m = 0x9; break; m = 0x9; break;
case OMAP_DSS_COLOR_YUV2: case DRM_FORMAT_YUYV:
m = 0xa; break; m = 0xa; break;
case OMAP_DSS_COLOR_UYVY: case DRM_FORMAT_UYVY:
m = 0xb; break; m = 0xb; break;
case OMAP_DSS_COLOR_ARGB32: case DRM_FORMAT_ARGB8888:
m = 0xc; break; m = 0xc; break;
case OMAP_DSS_COLOR_RGBA32: case DRM_FORMAT_RGBA8888:
m = 0xd; break; m = 0xd; break;
case OMAP_DSS_COLOR_RGBX32: case DRM_FORMAT_RGBX8888:
m = 0xe; break; m = 0xe; break;
case OMAP_DSS_COLOR_XRGB16_1555: case DRM_FORMAT_XRGB1555:
m = 0xf; break; m = 0xf; break;
default: default:
BUG(); return; BUG(); return;
} }
} else { } else {
switch (color_mode) { switch (color_mode) {
case OMAP_DSS_COLOR_RGB12U: case DRM_FORMAT_RGBX4444:
m = 0x4; break; m = 0x4; break;
case OMAP_DSS_COLOR_ARGB16: case DRM_FORMAT_ARGB4444:
m = 0x5; break; m = 0x5; break;
case OMAP_DSS_COLOR_RGB16: case DRM_FORMAT_RGB565:
m = 0x6; break; m = 0x6; break;
case OMAP_DSS_COLOR_ARGB16_1555: case DRM_FORMAT_ARGB1555:
m = 0x7; break; m = 0x7; break;
case OMAP_DSS_COLOR_RGB24U: case DRM_FORMAT_XRGB8888:
m = 0x8; break; m = 0x8; break;
case OMAP_DSS_COLOR_RGB24P: case DRM_FORMAT_RGB888:
m = 0x9; break; m = 0x9; break;
case OMAP_DSS_COLOR_RGBX16: case DRM_FORMAT_XRGB4444:
m = 0xa; break; m = 0xa; break;
case OMAP_DSS_COLOR_RGBA16: case DRM_FORMAT_RGBA4444:
m = 0xb; break; m = 0xb; break;
case OMAP_DSS_COLOR_ARGB32: case DRM_FORMAT_ARGB8888:
m = 0xc; break; m = 0xc; break;
case OMAP_DSS_COLOR_RGBA32: case DRM_FORMAT_RGBA8888:
m = 0xd; break; m = 0xd; break;
case OMAP_DSS_COLOR_RGBX32: case DRM_FORMAT_RGBX8888:
m = 0xe; break; m = 0xe; break;
case OMAP_DSS_COLOR_XRGB16_1555: case DRM_FORMAT_XRGB1555:
m = 0xf; break; m = 0xf; break;
default: default:
BUG(); return; BUG(); return;
...@@ -981,9 +982,9 @@ static void dispc_ovl_set_color_mode(enum omap_plane_id plane, ...@@ -981,9 +982,9 @@ static void dispc_ovl_set_color_mode(enum omap_plane_id plane,
static bool format_is_yuv(u32 color_mode) static bool format_is_yuv(u32 color_mode)
{ {
switch (color_mode) { switch (color_mode) {
case OMAP_DSS_COLOR_YUV2: case DRM_FORMAT_YUYV:
case OMAP_DSS_COLOR_UYVY: case DRM_FORMAT_UYVY:
case OMAP_DSS_COLOR_NV12: case DRM_FORMAT_NV12:
return true; return true;
default: default:
return false; return false;
...@@ -1619,14 +1620,14 @@ static void dispc_ovl_set_accu_uv(enum omap_plane_id plane, ...@@ -1619,14 +1620,14 @@ static void dispc_ovl_set_accu_uv(enum omap_plane_id plane,
} }
switch (color_mode) { switch (color_mode) {
case OMAP_DSS_COLOR_NV12: case DRM_FORMAT_NV12:
if (ilace) if (ilace)
accu_table = accu_nv12_ilace; accu_table = accu_nv12_ilace;
else else
accu_table = accu_nv12; accu_table = accu_nv12;
break; break;
case OMAP_DSS_COLOR_YUV2: case DRM_FORMAT_YUYV:
case OMAP_DSS_COLOR_UYVY: case DRM_FORMAT_UYVY:
accu_table = accu_yuv; accu_table = accu_yuv;
break; break;
default: default:
...@@ -1727,7 +1728,7 @@ static void dispc_ovl_set_scaling_uv(enum omap_plane_id plane, ...@@ -1727,7 +1728,7 @@ static void dispc_ovl_set_scaling_uv(enum omap_plane_id plane,
out_height, ilace, color_mode, rotation); out_height, ilace, color_mode, rotation);
switch (color_mode) { switch (color_mode) {
case OMAP_DSS_COLOR_NV12: case DRM_FORMAT_NV12:
if (chroma_upscale) { if (chroma_upscale) {
/* UV is subsampled by 2 horizontally and vertically */ /* UV is subsampled by 2 horizontally and vertically */
orig_height >>= 1; orig_height >>= 1;
...@@ -1739,8 +1740,8 @@ static void dispc_ovl_set_scaling_uv(enum omap_plane_id plane, ...@@ -1739,8 +1740,8 @@ static void dispc_ovl_set_scaling_uv(enum omap_plane_id plane,
} }
break; break;
case OMAP_DSS_COLOR_YUV2: case DRM_FORMAT_YUYV:
case OMAP_DSS_COLOR_UYVY: case DRM_FORMAT_UYVY:
/* For YUV422 with 90/270 rotation, we don't upsample chroma */ /* For YUV422 with 90/270 rotation, we don't upsample chroma */
if (rotation == OMAP_DSS_ROT_0 || if (rotation == OMAP_DSS_ROT_0 ||
rotation == OMAP_DSS_ROT_180) { rotation == OMAP_DSS_ROT_180) {
...@@ -1812,8 +1813,8 @@ static void dispc_ovl_set_rotation_attrs(enum omap_plane_id plane, u8 rotation, ...@@ -1812,8 +1813,8 @@ static void dispc_ovl_set_rotation_attrs(enum omap_plane_id plane, u8 rotation,
bool row_repeat = false; bool row_repeat = false;
int vidrot = 0; int vidrot = 0;
if (color_mode == OMAP_DSS_COLOR_YUV2 || if (color_mode == DRM_FORMAT_YUYV ||
color_mode == OMAP_DSS_COLOR_UYVY) { color_mode == DRM_FORMAT_UYVY) {
if (mirroring) { if (mirroring) {
switch (rotation) { switch (rotation) {
...@@ -1858,7 +1859,7 @@ static void dispc_ovl_set_rotation_attrs(enum omap_plane_id plane, u8 rotation, ...@@ -1858,7 +1859,7 @@ static void dispc_ovl_set_rotation_attrs(enum omap_plane_id plane, u8 rotation,
* NV12 in 1D mode must use ROTATION=1. Otherwise DSS will fetch extra * NV12 in 1D mode must use ROTATION=1. Otherwise DSS will fetch extra
* rows beyond the framebuffer, which may cause OCP error. * rows beyond the framebuffer, which may cause OCP error.
*/ */
if (color_mode == OMAP_DSS_COLOR_NV12 && if (color_mode == DRM_FORMAT_NV12 &&
rotation_type != OMAP_DSS_ROT_TILER) rotation_type != OMAP_DSS_ROT_TILER)
vidrot = 1; vidrot = 1;
...@@ -1867,9 +1868,9 @@ static void dispc_ovl_set_rotation_attrs(enum omap_plane_id plane, u8 rotation, ...@@ -1867,9 +1868,9 @@ static void dispc_ovl_set_rotation_attrs(enum omap_plane_id plane, u8 rotation,
REG_FLD_MOD(DISPC_OVL_ATTRIBUTES(plane), REG_FLD_MOD(DISPC_OVL_ATTRIBUTES(plane),
row_repeat ? 1 : 0, 18, 18); row_repeat ? 1 : 0, 18, 18);
if (dss_feat_color_mode_supported(plane, OMAP_DSS_COLOR_NV12)) { if (dss_feat_color_mode_supported(plane, DRM_FORMAT_NV12)) {
bool doublestride = bool doublestride =
color_mode == OMAP_DSS_COLOR_NV12 && color_mode == DRM_FORMAT_NV12 &&
rotation_type == OMAP_DSS_ROT_TILER && rotation_type == OMAP_DSS_ROT_TILER &&
(rotation == OMAP_DSS_ROT_0 || rotation == OMAP_DSS_ROT_180); (rotation == OMAP_DSS_ROT_0 || rotation == OMAP_DSS_ROT_180);
...@@ -1881,24 +1882,24 @@ static void dispc_ovl_set_rotation_attrs(enum omap_plane_id plane, u8 rotation, ...@@ -1881,24 +1882,24 @@ static void dispc_ovl_set_rotation_attrs(enum omap_plane_id plane, u8 rotation,
static int color_mode_to_bpp(u32 color_mode) static int color_mode_to_bpp(u32 color_mode)
{ {
switch (color_mode) { switch (color_mode) {
case OMAP_DSS_COLOR_NV12: case DRM_FORMAT_NV12:
return 8; return 8;
case OMAP_DSS_COLOR_RGB12U: case DRM_FORMAT_RGBX4444:
case OMAP_DSS_COLOR_RGB16: case DRM_FORMAT_RGB565:
case OMAP_DSS_COLOR_ARGB16: case DRM_FORMAT_ARGB4444:
case OMAP_DSS_COLOR_YUV2: case DRM_FORMAT_YUYV:
case OMAP_DSS_COLOR_UYVY: case DRM_FORMAT_UYVY:
case OMAP_DSS_COLOR_RGBA16: case DRM_FORMAT_RGBA4444:
case OMAP_DSS_COLOR_RGBX16: case DRM_FORMAT_XRGB4444:
case OMAP_DSS_COLOR_ARGB16_1555: case DRM_FORMAT_ARGB1555:
case OMAP_DSS_COLOR_XRGB16_1555: case DRM_FORMAT_XRGB1555:
return 16; return 16;
case OMAP_DSS_COLOR_RGB24P: case DRM_FORMAT_RGB888:
return 24; return 24;
case OMAP_DSS_COLOR_RGB24U: case DRM_FORMAT_XRGB8888:
case OMAP_DSS_COLOR_ARGB32: case DRM_FORMAT_ARGB8888:
case OMAP_DSS_COLOR_RGBA32: case DRM_FORMAT_RGBA8888:
case OMAP_DSS_COLOR_RGBX32: case DRM_FORMAT_RGBX8888:
return 32; return 32;
default: default:
BUG(); BUG();
...@@ -1939,8 +1940,8 @@ static void calc_offset(u16 screen_width, u16 width, ...@@ -1939,8 +1940,8 @@ static void calc_offset(u16 screen_width, u16 width,
*row_inc = pixinc(1 + (y_predecim * screen_width - width * x_predecim) + *row_inc = pixinc(1 + (y_predecim * screen_width - width * x_predecim) +
(fieldmode ? screen_width : 0), ps); (fieldmode ? screen_width : 0), ps);
if (color_mode == OMAP_DSS_COLOR_YUV2 || if (color_mode == DRM_FORMAT_YUYV ||
color_mode == OMAP_DSS_COLOR_UYVY) color_mode == DRM_FORMAT_UYVY)
*pix_inc = pixinc(x_predecim, 2 * ps); *pix_inc = pixinc(x_predecim, 2 * ps);
else else
*pix_inc = pixinc(x_predecim, ps); *pix_inc = pixinc(x_predecim, ps);
...@@ -2037,7 +2038,7 @@ static unsigned long calc_core_clk_five_taps(unsigned long pclk, ...@@ -2037,7 +2038,7 @@ static unsigned long calc_core_clk_five_taps(unsigned long pclk,
do_div(tmp, out_width); do_div(tmp, out_width);
core_clk = max_t(u32, core_clk, tmp); core_clk = max_t(u32, core_clk, tmp);
if (color_mode == OMAP_DSS_COLOR_RGB24U) if (color_mode == DRM_FORMAT_XRGB8888)
core_clk <<= 1; core_clk <<= 1;
} }
...@@ -2265,7 +2266,7 @@ static int dispc_ovl_calc_scaling_44xx(unsigned long pclk, unsigned long lclk, ...@@ -2265,7 +2266,7 @@ static int dispc_ovl_calc_scaling_44xx(unsigned long pclk, unsigned long lclk,
return -EINVAL; return -EINVAL;
} }
if (*decim_x > 4 && color_mode != OMAP_DSS_COLOR_NV12) { if (*decim_x > 4 && color_mode != DRM_FORMAT_NV12) {
/* /*
* Let's disable all scaling that requires horizontal * Let's disable all scaling that requires horizontal
* decimation with higher factor than 4, until we have * decimation with higher factor than 4, until we have
...@@ -2494,7 +2495,7 @@ static int dispc_ovl_setup_common(enum omap_plane_id plane, ...@@ -2494,7 +2495,7 @@ static int dispc_ovl_setup_common(enum omap_plane_id plane,
dispc_ovl_set_ba0(plane, paddr + offset0); dispc_ovl_set_ba0(plane, paddr + offset0);
dispc_ovl_set_ba1(plane, paddr + offset1); dispc_ovl_set_ba1(plane, paddr + offset1);
if (OMAP_DSS_COLOR_NV12 == color_mode) { if (color_mode == DRM_FORMAT_NV12) {
dispc_ovl_set_ba0_uv(plane, p_uv_addr + offset0); dispc_ovl_set_ba0_uv(plane, p_uv_addr + offset0);
dispc_ovl_set_ba1_uv(plane, p_uv_addr + offset1); dispc_ovl_set_ba1_uv(plane, p_uv_addr + offset1);
} }
...@@ -2585,14 +2586,14 @@ int dispc_wb_setup(const struct omap_dss_writeback_info *wi, ...@@ -2585,14 +2586,14 @@ int dispc_wb_setup(const struct omap_dss_writeback_info *wi,
replication, vm, mem_to_mem); replication, vm, mem_to_mem);
switch (wi->color_mode) { switch (wi->color_mode) {
case OMAP_DSS_COLOR_RGB16: case DRM_FORMAT_RGB565:
case OMAP_DSS_COLOR_RGB24P: case DRM_FORMAT_RGB888:
case OMAP_DSS_COLOR_ARGB16: case DRM_FORMAT_ARGB4444:
case OMAP_DSS_COLOR_RGBA16: case DRM_FORMAT_RGBA4444:
case OMAP_DSS_COLOR_RGB12U: case DRM_FORMAT_RGBX4444:
case OMAP_DSS_COLOR_ARGB16_1555: case DRM_FORMAT_ARGB1555:
case OMAP_DSS_COLOR_XRGB16_1555: case DRM_FORMAT_XRGB1555:
case OMAP_DSS_COLOR_RGBX16: case DRM_FORMAT_XRGB4444:
truncation = true; truncation = true;
break; break;
default: default:
...@@ -3918,7 +3919,7 @@ static const struct dispc_errata_i734_data { ...@@ -3918,7 +3919,7 @@ static const struct dispc_errata_i734_data {
.ovli = { .ovli = {
.screen_width = 1, .screen_width = 1,
.width = 1, .height = 1, .width = 1, .height = 1,
.color_mode = OMAP_DSS_COLOR_RGB24U, .color_mode = DRM_FORMAT_XRGB8888,
.rotation = OMAP_DSS_ROT_0, .rotation = OMAP_DSS_ROT_0,
.rotation_type = OMAP_DSS_ROT_NONE, .rotation_type = OMAP_DSS_ROT_NONE,
.mirror = 0, .mirror = 0,
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <drm/drm_fourcc.h>
#include "omapdss.h" #include "omapdss.h"
#include "dss.h" #include "dss.h"
...@@ -235,98 +236,98 @@ static const u32 *omap2_dss_supported_color_modes[] = { ...@@ -235,98 +236,98 @@ static const u32 *omap2_dss_supported_color_modes[] = {
/* OMAP_DSS_GFX */ /* OMAP_DSS_GFX */
COLOR_ARRAY( COLOR_ARRAY(
OMAP_DSS_COLOR_RGB12U, OMAP_DSS_COLOR_RGB16, DRM_FORMAT_RGBX4444, DRM_FORMAT_RGB565,
OMAP_DSS_COLOR_RGB24U, OMAP_DSS_COLOR_RGB24P), DRM_FORMAT_XRGB8888, DRM_FORMAT_RGB888),
/* OMAP_DSS_VIDEO1 */ /* OMAP_DSS_VIDEO1 */
COLOR_ARRAY( COLOR_ARRAY(
OMAP_DSS_COLOR_RGB16, OMAP_DSS_COLOR_RGB24U, DRM_FORMAT_RGB565, DRM_FORMAT_XRGB8888,
OMAP_DSS_COLOR_RGB24P, OMAP_DSS_COLOR_YUV2, DRM_FORMAT_RGB888, DRM_FORMAT_YUYV,
OMAP_DSS_COLOR_UYVY), DRM_FORMAT_UYVY),
/* OMAP_DSS_VIDEO2 */ /* OMAP_DSS_VIDEO2 */
COLOR_ARRAY( COLOR_ARRAY(
OMAP_DSS_COLOR_RGB16, OMAP_DSS_COLOR_RGB24U, DRM_FORMAT_RGB565, DRM_FORMAT_XRGB8888,
OMAP_DSS_COLOR_RGB24P, OMAP_DSS_COLOR_YUV2, DRM_FORMAT_RGB888, DRM_FORMAT_YUYV,
OMAP_DSS_COLOR_UYVY), DRM_FORMAT_UYVY),
}; };
static const u32 *omap3_dss_supported_color_modes[] = { static const u32 *omap3_dss_supported_color_modes[] = {
/* OMAP_DSS_GFX */ /* OMAP_DSS_GFX */
COLOR_ARRAY( COLOR_ARRAY(
OMAP_DSS_COLOR_RGB12U, OMAP_DSS_COLOR_ARGB16, DRM_FORMAT_RGBX4444, DRM_FORMAT_ARGB4444,
OMAP_DSS_COLOR_RGB16, OMAP_DSS_COLOR_RGB24U, DRM_FORMAT_RGB565, DRM_FORMAT_XRGB8888,
OMAP_DSS_COLOR_RGB24P, OMAP_DSS_COLOR_ARGB32, DRM_FORMAT_RGB888, DRM_FORMAT_ARGB8888,
OMAP_DSS_COLOR_RGBA32, OMAP_DSS_COLOR_RGBX32), DRM_FORMAT_RGBA8888, DRM_FORMAT_RGBX8888),
/* OMAP_DSS_VIDEO1 */ /* OMAP_DSS_VIDEO1 */
COLOR_ARRAY( COLOR_ARRAY(
OMAP_DSS_COLOR_RGB24U, OMAP_DSS_COLOR_RGB24P, DRM_FORMAT_XRGB8888, DRM_FORMAT_RGB888,
OMAP_DSS_COLOR_RGB12U, OMAP_DSS_COLOR_RGB16, DRM_FORMAT_RGBX4444, DRM_FORMAT_RGB565,
OMAP_DSS_COLOR_YUV2, OMAP_DSS_COLOR_UYVY), DRM_FORMAT_YUYV, DRM_FORMAT_UYVY),
/* OMAP_DSS_VIDEO2 */ /* OMAP_DSS_VIDEO2 */
COLOR_ARRAY( COLOR_ARRAY(
OMAP_DSS_COLOR_RGB12U, OMAP_DSS_COLOR_ARGB16, DRM_FORMAT_RGBX4444, DRM_FORMAT_ARGB4444,
OMAP_DSS_COLOR_RGB16, OMAP_DSS_COLOR_RGB24U, DRM_FORMAT_RGB565, DRM_FORMAT_XRGB8888,
OMAP_DSS_COLOR_RGB24P, OMAP_DSS_COLOR_YUV2, DRM_FORMAT_RGB888, DRM_FORMAT_YUYV,
OMAP_DSS_COLOR_UYVY, OMAP_DSS_COLOR_ARGB32, DRM_FORMAT_UYVY, DRM_FORMAT_ARGB8888,
OMAP_DSS_COLOR_RGBA32, OMAP_DSS_COLOR_RGBX32), DRM_FORMAT_RGBA8888, DRM_FORMAT_RGBX8888),
}; };
static const u32 *omap4_dss_supported_color_modes[] = { static const u32 *omap4_dss_supported_color_modes[] = {
/* OMAP_DSS_GFX */ /* OMAP_DSS_GFX */
COLOR_ARRAY( COLOR_ARRAY(
OMAP_DSS_COLOR_RGB12U, OMAP_DSS_COLOR_ARGB16, DRM_FORMAT_RGBX4444, DRM_FORMAT_ARGB4444,
OMAP_DSS_COLOR_RGB16, OMAP_DSS_COLOR_RGB24U, DRM_FORMAT_RGB565, DRM_FORMAT_XRGB8888,
OMAP_DSS_COLOR_RGB24P, OMAP_DSS_COLOR_ARGB32, DRM_FORMAT_RGB888, DRM_FORMAT_ARGB8888,
OMAP_DSS_COLOR_RGBA32, OMAP_DSS_COLOR_RGBX32, DRM_FORMAT_RGBA8888, DRM_FORMAT_RGBX8888,
OMAP_DSS_COLOR_ARGB16_1555, OMAP_DSS_COLOR_RGBX16, DRM_FORMAT_ARGB1555, DRM_FORMAT_XRGB4444,
OMAP_DSS_COLOR_RGBA16, OMAP_DSS_COLOR_XRGB16_1555), DRM_FORMAT_RGBA4444, DRM_FORMAT_XRGB1555),
/* OMAP_DSS_VIDEO1 */ /* OMAP_DSS_VIDEO1 */
COLOR_ARRAY( COLOR_ARRAY(
OMAP_DSS_COLOR_RGB16, OMAP_DSS_COLOR_RGB12U, DRM_FORMAT_RGB565, DRM_FORMAT_RGBX4444,
OMAP_DSS_COLOR_YUV2, OMAP_DSS_COLOR_ARGB16_1555, DRM_FORMAT_YUYV, DRM_FORMAT_ARGB1555,
OMAP_DSS_COLOR_RGBA32, OMAP_DSS_COLOR_NV12, DRM_FORMAT_RGBA8888, DRM_FORMAT_NV12,
OMAP_DSS_COLOR_RGBA16, OMAP_DSS_COLOR_RGB24U, DRM_FORMAT_RGBA4444, DRM_FORMAT_XRGB8888,
OMAP_DSS_COLOR_RGB24P, OMAP_DSS_COLOR_UYVY, DRM_FORMAT_RGB888, DRM_FORMAT_UYVY,
OMAP_DSS_COLOR_ARGB16, OMAP_DSS_COLOR_XRGB16_1555, DRM_FORMAT_ARGB4444, DRM_FORMAT_XRGB1555,
OMAP_DSS_COLOR_ARGB32, OMAP_DSS_COLOR_RGBX16, DRM_FORMAT_ARGB8888, DRM_FORMAT_XRGB4444,
OMAP_DSS_COLOR_RGBX32), DRM_FORMAT_RGBX8888),
/* OMAP_DSS_VIDEO2 */ /* OMAP_DSS_VIDEO2 */
COLOR_ARRAY( COLOR_ARRAY(
OMAP_DSS_COLOR_RGB16, OMAP_DSS_COLOR_RGB12U, DRM_FORMAT_RGB565, DRM_FORMAT_RGBX4444,
OMAP_DSS_COLOR_YUV2, OMAP_DSS_COLOR_ARGB16_1555, DRM_FORMAT_YUYV, DRM_FORMAT_ARGB1555,
OMAP_DSS_COLOR_RGBA32, OMAP_DSS_COLOR_NV12, DRM_FORMAT_RGBA8888, DRM_FORMAT_NV12,
OMAP_DSS_COLOR_RGBA16, OMAP_DSS_COLOR_RGB24U, DRM_FORMAT_RGBA4444, DRM_FORMAT_XRGB8888,
OMAP_DSS_COLOR_RGB24P, OMAP_DSS_COLOR_UYVY, DRM_FORMAT_RGB888, DRM_FORMAT_UYVY,
OMAP_DSS_COLOR_ARGB16, OMAP_DSS_COLOR_XRGB16_1555, DRM_FORMAT_ARGB4444, DRM_FORMAT_XRGB1555,
OMAP_DSS_COLOR_ARGB32, OMAP_DSS_COLOR_RGBX16, DRM_FORMAT_ARGB8888, DRM_FORMAT_XRGB4444,
OMAP_DSS_COLOR_RGBX32), DRM_FORMAT_RGBX8888),
/* OMAP_DSS_VIDEO3 */ /* OMAP_DSS_VIDEO3 */
COLOR_ARRAY( COLOR_ARRAY(
OMAP_DSS_COLOR_RGB16, OMAP_DSS_COLOR_RGB12U, DRM_FORMAT_RGB565, DRM_FORMAT_RGBX4444,
OMAP_DSS_COLOR_YUV2, OMAP_DSS_COLOR_ARGB16_1555, DRM_FORMAT_YUYV, DRM_FORMAT_ARGB1555,
OMAP_DSS_COLOR_RGBA32, OMAP_DSS_COLOR_NV12, DRM_FORMAT_RGBA8888, DRM_FORMAT_NV12,
OMAP_DSS_COLOR_RGBA16, OMAP_DSS_COLOR_RGB24U, DRM_FORMAT_RGBA4444, DRM_FORMAT_XRGB8888,
OMAP_DSS_COLOR_RGB24P, OMAP_DSS_COLOR_UYVY, DRM_FORMAT_RGB888, DRM_FORMAT_UYVY,
OMAP_DSS_COLOR_ARGB16, OMAP_DSS_COLOR_XRGB16_1555, DRM_FORMAT_ARGB4444, DRM_FORMAT_XRGB1555,
OMAP_DSS_COLOR_ARGB32, OMAP_DSS_COLOR_RGBX16, DRM_FORMAT_ARGB8888, DRM_FORMAT_XRGB4444,
OMAP_DSS_COLOR_RGBX32), DRM_FORMAT_RGBX8888),
/* OMAP_DSS_WB */ /* OMAP_DSS_WB */
COLOR_ARRAY( COLOR_ARRAY(
OMAP_DSS_COLOR_RGB16, OMAP_DSS_COLOR_RGB12U, DRM_FORMAT_RGB565, DRM_FORMAT_RGBX4444,
OMAP_DSS_COLOR_YUV2, OMAP_DSS_COLOR_ARGB16_1555, DRM_FORMAT_YUYV, DRM_FORMAT_ARGB1555,
OMAP_DSS_COLOR_RGBA32, OMAP_DSS_COLOR_NV12, DRM_FORMAT_RGBA8888, DRM_FORMAT_NV12,
OMAP_DSS_COLOR_RGBA16, OMAP_DSS_COLOR_RGB24U, DRM_FORMAT_RGBA4444, DRM_FORMAT_XRGB8888,
OMAP_DSS_COLOR_RGB24P, OMAP_DSS_COLOR_UYVY, DRM_FORMAT_RGB888, DRM_FORMAT_UYVY,
OMAP_DSS_COLOR_ARGB16, OMAP_DSS_COLOR_XRGB16_1555, DRM_FORMAT_ARGB4444, DRM_FORMAT_XRGB1555,
OMAP_DSS_COLOR_ARGB32, OMAP_DSS_COLOR_RGBX16, DRM_FORMAT_ARGB8888, DRM_FORMAT_XRGB4444,
OMAP_DSS_COLOR_RGBX32), DRM_FORMAT_RGBX8888),
}; };
static const enum omap_overlay_caps omap2_dss_overlay_caps[] = { static const enum omap_overlay_caps omap2_dss_overlay_caps[] = {
......
...@@ -92,21 +92,7 @@ enum omap_channel { ...@@ -92,21 +92,7 @@ enum omap_channel {
}; };
enum omap_color_mode { enum omap_color_mode {
OMAP_DSS_COLOR_RGB12U = 1 << 4, /* RGB12, 16-bit container */ _UNUSED_,
OMAP_DSS_COLOR_ARGB16 = 1 << 5, /* ARGB16 */
OMAP_DSS_COLOR_RGB16 = 1 << 6, /* RGB16 */
OMAP_DSS_COLOR_RGB24U = 1 << 7, /* RGB24, 32-bit container */
OMAP_DSS_COLOR_RGB24P = 1 << 8, /* RGB24, 24-bit container */
OMAP_DSS_COLOR_YUV2 = 1 << 9, /* YUV2 4:2:2 co-sited */
OMAP_DSS_COLOR_UYVY = 1 << 10, /* UYVY 4:2:2 co-sited */
OMAP_DSS_COLOR_ARGB32 = 1 << 11, /* ARGB32 */
OMAP_DSS_COLOR_RGBA32 = 1 << 12, /* RGBA32 */
OMAP_DSS_COLOR_RGBX32 = 1 << 13, /* RGBx32 */
OMAP_DSS_COLOR_NV12 = 1 << 14, /* NV12 format: YUV 4:2:0 */
OMAP_DSS_COLOR_RGBA16 = 1 << 15, /* RGBA16 - 4444 */
OMAP_DSS_COLOR_RGBX16 = 1 << 16, /* RGBx16 - 4444 */
OMAP_DSS_COLOR_ARGB16_1555 = 1 << 17, /* ARGB16 - 1555 */
OMAP_DSS_COLOR_XRGB16_1555 = 1 << 18, /* xRGB16 - 1555 */
}; };
enum omap_dss_load_mode { enum omap_dss_load_mode {
......
...@@ -35,24 +35,24 @@ static const struct { ...@@ -35,24 +35,24 @@ static const struct {
uint32_t pixel_format; uint32_t pixel_format;
} formats[] = { } formats[] = {
/* 16bpp [A]RGB: */ /* 16bpp [A]RGB: */
{ OMAP_DSS_COLOR_RGB16, DRM_FORMAT_RGB565 }, /* RGB16-565 */ { DRM_FORMAT_RGB565, DRM_FORMAT_RGB565 }, /* RGB16-565 */
{ OMAP_DSS_COLOR_RGB12U, DRM_FORMAT_RGBX4444 }, /* RGB12x-4444 */ { DRM_FORMAT_RGBX4444, DRM_FORMAT_RGBX4444 }, /* RGB12x-4444 */
{ OMAP_DSS_COLOR_RGBX16, DRM_FORMAT_XRGB4444 }, /* xRGB12-4444 */ { DRM_FORMAT_XRGB4444, DRM_FORMAT_XRGB4444 }, /* xRGB12-4444 */
{ OMAP_DSS_COLOR_RGBA16, DRM_FORMAT_RGBA4444 }, /* RGBA12-4444 */ { DRM_FORMAT_RGBA4444, DRM_FORMAT_RGBA4444 }, /* RGBA12-4444 */
{ OMAP_DSS_COLOR_ARGB16, DRM_FORMAT_ARGB4444 }, /* ARGB16-4444 */ { DRM_FORMAT_ARGB4444, DRM_FORMAT_ARGB4444 }, /* ARGB16-4444 */
{ OMAP_DSS_COLOR_XRGB16_1555, DRM_FORMAT_XRGB1555 }, /* xRGB15-1555 */ { DRM_FORMAT_XRGB1555, DRM_FORMAT_XRGB1555 }, /* xRGB15-1555 */
{ OMAP_DSS_COLOR_ARGB16_1555, DRM_FORMAT_ARGB1555 }, /* ARGB16-1555 */ { DRM_FORMAT_ARGB1555, DRM_FORMAT_ARGB1555 }, /* ARGB16-1555 */
/* 24bpp RGB: */ /* 24bpp RGB: */
{ OMAP_DSS_COLOR_RGB24P, DRM_FORMAT_RGB888 }, /* RGB24-888 */ { DRM_FORMAT_RGB888, DRM_FORMAT_RGB888 }, /* RGB24-888 */
/* 32bpp [A]RGB: */ /* 32bpp [A]RGB: */
{ OMAP_DSS_COLOR_RGBX32, DRM_FORMAT_RGBX8888 }, /* RGBx24-8888 */ { DRM_FORMAT_RGBX8888, DRM_FORMAT_RGBX8888 }, /* RGBx24-8888 */
{ OMAP_DSS_COLOR_RGB24U, DRM_FORMAT_XRGB8888 }, /* xRGB24-8888 */ { DRM_FORMAT_XRGB8888, DRM_FORMAT_XRGB8888 }, /* xRGB24-8888 */
{ OMAP_DSS_COLOR_RGBA32, DRM_FORMAT_RGBA8888 }, /* RGBA32-8888 */ { DRM_FORMAT_RGBA8888, DRM_FORMAT_RGBA8888 }, /* RGBA32-8888 */
{ OMAP_DSS_COLOR_ARGB32, DRM_FORMAT_ARGB8888 }, /* ARGB32-8888 */ { DRM_FORMAT_ARGB8888, DRM_FORMAT_ARGB8888 }, /* ARGB32-8888 */
/* YUV: */ /* YUV: */
{ OMAP_DSS_COLOR_NV12, DRM_FORMAT_NV12 }, { DRM_FORMAT_NV12, DRM_FORMAT_NV12 },
{ OMAP_DSS_COLOR_YUV2, DRM_FORMAT_YUYV }, { DRM_FORMAT_YUYV, DRM_FORMAT_YUYV },
{ OMAP_DSS_COLOR_UYVY, DRM_FORMAT_UYVY }, { DRM_FORMAT_UYVY, DRM_FORMAT_UYVY },
}; };
/* convert from overlay's pixel formats bitmask to an array of fourcc's */ /* convert from overlay's pixel formats bitmask to an array of fourcc's */
...@@ -236,7 +236,7 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, ...@@ -236,7 +236,7 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb,
/* convert to pixels: */ /* convert to pixels: */
info->screen_width /= format->cpp[0]; info->screen_width /= format->cpp[0];
if (omap_fb->dss_format == OMAP_DSS_COLOR_NV12) { if (omap_fb->dss_format == DRM_FORMAT_NV12) {
plane = &omap_fb->planes[1]; plane = &omap_fb->planes[1];
if (info->rotation_type == OMAP_DSS_ROT_TILER) { if (info->rotation_type == OMAP_DSS_ROT_TILER) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment