From 3a38ed53bebd1c14925a711123c911e07dd11adf Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Wed, 13 Jan 2016 18:41:31 +0200 Subject: drm/omap: DISPC: support double-pixel mode We need double-pixel mode (pixel repetition) for interlace modes. This patch adds the necessary support to DISPC to output double-pixel mode. Signed-off-by: Tomi Valkeinen Acked-by: Laurent Pinchart --- drivers/gpu/drm/omapdrm/dss/dispc.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'drivers/gpu/drm/omapdrm/dss/dispc.c') diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c index 6b50476ec669..1e7f26985bda 100644 --- a/drivers/gpu/drm/omapdrm/dss/dispc.c +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c @@ -104,6 +104,8 @@ struct dispc_features { bool supports_sync_align:1; bool has_writeback:1; + + bool supports_double_pixel:1; }; #define DISPC_MAX_NR_FIFOS 5 @@ -3287,6 +3289,10 @@ void dispc_mgr_set_timings(enum omap_channel channel, } else { if (t.interlace) t.y_res /= 2; + + if (dispc.feat->supports_double_pixel) + REG_FLD_MOD(DISPC_CONTROL, t.double_pixel ? 1 : 0, + 19, 17); } dispc_mgr_set_size(channel, t.x_res, t.y_res); @@ -3951,6 +3957,7 @@ static const struct dispc_features omap44xx_dispc_feats = { .set_max_preload = true, .supports_sync_align = true, .has_writeback = true, + .supports_double_pixel = true, }; static const struct dispc_features omap54xx_dispc_feats = { @@ -3974,6 +3981,7 @@ static const struct dispc_features omap54xx_dispc_feats = { .set_max_preload = true, .supports_sync_align = true, .has_writeback = true, + .supports_double_pixel = true, }; static int dispc_init_features(struct platform_device *pdev) -- cgit v1.2.3 From b7536d674575248fb8a7b09992496cf7110a875b Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Wed, 13 Jan 2016 18:41:36 +0200 Subject: drm/omap: DISPC: Fix field order for HDMI Interlace field order is different between VENC and HDMI. The driver currently sets the field order for VENC. This patch adds the code to set the field order for HDMI. Signed-off-by: Tomi Valkeinen Acked-by: Laurent Pinchart --- drivers/gpu/drm/omapdrm/dss/dispc.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'drivers/gpu/drm/omapdrm/dss/dispc.c') diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c index 1e7f26985bda..a4274dca384a 100644 --- a/drivers/gpu/drm/omapdrm/dss/dispc.c +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c @@ -106,6 +106,13 @@ struct dispc_features { bool has_writeback:1; bool supports_double_pixel:1; + + /* + * Field order for VENC is different than HDMI. We should handle this in + * some intelligent manner, but as the SoCs have either HDMI or VENC, + * never both, we can just use this flag for now. + */ + bool reverse_ilace_field_order:1; }; #define DISPC_MAX_NR_FIFOS 5 @@ -2749,6 +2756,9 @@ static int dispc_ovl_setup_common(enum omap_plane plane, dispc_ovl_configure_burst_type(plane, rotation_type); + if (dispc.feat->reverse_ilace_field_order) + swap(offset0, offset1); + dispc_ovl_set_ba0(plane, paddr + offset0); dispc_ovl_set_ba1(plane, paddr + offset1); @@ -3958,6 +3968,7 @@ static const struct dispc_features omap44xx_dispc_feats = { .supports_sync_align = true, .has_writeback = true, .supports_double_pixel = true, + .reverse_ilace_field_order = true, }; static const struct dispc_features omap54xx_dispc_feats = { @@ -3982,6 +3993,7 @@ static const struct dispc_features omap54xx_dispc_feats = { .supports_sync_align = true, .has_writeback = true, .supports_double_pixel = true, + .reverse_ilace_field_order = true, }; static int dispc_init_features(struct platform_device *pdev) -- cgit v1.2.3 From 7b9cb5eeb4d0b1db63e198dfd02aadddaf245de4 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Wed, 4 Nov 2015 15:11:25 +0200 Subject: drm/omap: Add dispc_mgr_get_supported_outputs() We are removing the use of the 'struct omap_overlay_manager' from omapdrm, and one part of that is removing the use of mgr->supported_outputs field. This patch adds dispc_mgr_get_supported_outputs() function which can be used instead of mgr->supported_outputs. omap_crtc.c is changed to use the new function. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/dss/dispc.c | 6 ++++++ drivers/gpu/drm/omapdrm/dss/omapdss.h | 2 ++ drivers/gpu/drm/omapdrm/omap_crtc.c | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/drm/omapdrm/dss/dispc.c') diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c index a4274dca384a..a5940892a788 100644 --- a/drivers/gpu/drm/omapdrm/dss/dispc.c +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c @@ -2910,6 +2910,12 @@ bool dispc_ovl_enabled(enum omap_plane plane) } EXPORT_SYMBOL(dispc_ovl_enabled); +enum omap_dss_output_id dispc_mgr_get_supported_outputs(enum omap_channel channel) +{ + return dss_feat_get_supported_outputs(channel); +} +EXPORT_SYMBOL(dispc_mgr_get_supported_outputs); + void dispc_mgr_enable(enum omap_channel channel, bool enable) { mgr_fld_write(channel, DISPC_MGR_FLD_ENABLE, enable); diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h index 7712ffef2836..0a213489f133 100644 --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h @@ -58,6 +58,8 @@ int dispc_ovl_setup(enum omap_plane plane, const struct omap_overlay_info *oi, bool replication, const struct omap_video_timings *mgr_timings, bool mem_to_mem); +enum omap_dss_output_id dispc_mgr_get_supported_outputs(enum omap_channel channel); + struct dss_mgr_ops { int (*connect)(struct omap_overlay_manager *mgr, struct omap_dss_device *dst); diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c index 8c5caf8bb1b9..6daf0bd67d06 100644 --- a/drivers/gpu/drm/omapdrm/omap_crtc.c +++ b/drivers/gpu/drm/omapdrm/omap_crtc.c @@ -112,7 +112,7 @@ static int omap_crtc_dss_connect(struct omap_overlay_manager *mgr, if (mgr->output) return -EINVAL; - if ((mgr->supported_outputs & dst->id) == 0) + if ((dispc_mgr_get_supported_outputs(mgr->id) & dst->id) == 0) return -EINVAL; dst->manager = mgr; -- cgit v1.2.3 From 9198891b4e1d336a77137a9327de05acc10896e2 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Mon, 22 Feb 2016 16:11:45 +0200 Subject: drm/omap: remove dss compat code We have removed all the uses of compat code from omapdrm and the non-compat parts of omapdss, so now we can remove all the compat code itself. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/dss/Makefile | 3 - drivers/gpu/drm/omapdrm/dss/apply.c | 1711 --------------------------- drivers/gpu/drm/omapdrm/dss/dispc-compat.c | 667 ----------- drivers/gpu/drm/omapdrm/dss/dispc-compat.h | 30 - drivers/gpu/drm/omapdrm/dss/dispc.c | 4 - drivers/gpu/drm/omapdrm/dss/display-sysfs.c | 356 ------ drivers/gpu/drm/omapdrm/dss/dss.h | 37 - drivers/gpu/drm/omapdrm/dss/manager-sysfs.c | 531 --------- drivers/gpu/drm/omapdrm/dss/manager.c | 263 ---- drivers/gpu/drm/omapdrm/dss/overlay-sysfs.c | 456 ------- drivers/gpu/drm/omapdrm/dss/overlay.c | 202 ---- 11 files changed, 4260 deletions(-) delete mode 100644 drivers/gpu/drm/omapdrm/dss/apply.c delete mode 100644 drivers/gpu/drm/omapdrm/dss/dispc-compat.c delete mode 100644 drivers/gpu/drm/omapdrm/dss/dispc-compat.h delete mode 100644 drivers/gpu/drm/omapdrm/dss/display-sysfs.c delete mode 100644 drivers/gpu/drm/omapdrm/dss/manager-sysfs.c delete mode 100644 drivers/gpu/drm/omapdrm/dss/manager.c delete mode 100644 drivers/gpu/drm/omapdrm/dss/overlay-sysfs.c delete mode 100644 drivers/gpu/drm/omapdrm/dss/overlay.c (limited to 'drivers/gpu/drm/omapdrm/dss/dispc.c') diff --git a/drivers/gpu/drm/omapdrm/dss/Makefile b/drivers/gpu/drm/omapdrm/dss/Makefile index b5136d3d4b77..b651ec9751e6 100644 --- a/drivers/gpu/drm/omapdrm/dss/Makefile +++ b/drivers/gpu/drm/omapdrm/dss/Makefile @@ -3,9 +3,6 @@ obj-$(CONFIG_OMAP2_DSS) += omapdss.o # Core DSS files omapdss-y := core.o dss.o dss_features.o dispc.o dispc_coefs.o display.o \ output.o dss-of.o pll.o video-pll.o -# DSS compat layer files -omapdss-y += manager.o manager-sysfs.o overlay.o overlay-sysfs.o apply.o \ - dispc-compat.o display-sysfs.o omapdss-$(CONFIG_OMAP2_DSS_DPI) += dpi.o omapdss-$(CONFIG_OMAP2_DSS_RFBI) += rfbi.o omapdss-$(CONFIG_OMAP2_DSS_VENC) += venc.o diff --git a/drivers/gpu/drm/omapdrm/dss/apply.c b/drivers/gpu/drm/omapdrm/dss/apply.c deleted file mode 100644 index 1b7c718c08b2..000000000000 --- a/drivers/gpu/drm/omapdrm/dss/apply.c +++ /dev/null @@ -1,1711 +0,0 @@ -/* - * Copyright (C) 2011 Texas Instruments - * Author: Tomi Valkeinen - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published by - * the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - */ - -#define DSS_SUBSYS_NAME "APPLY" - -#include -#include -#include -#include -#include - -#include