From: Russell King <rmk+kernel@armlinux.org.uk>
To: dri-devel@lists.freedesktop.org
Cc: David Airlie <airlied@linux.ie>
Subject: [PATCH 16/17] drm/armada: remove crtc YUV colourspace properties
Date: Tue, 10 Jul 2018 11:33:31 +0100 [thread overview]
Message-ID: <E1fcpxb-00042A-Cs@rmk-PC.armlinux.org.uk> (raw)
In-Reply-To: <20180710103106.GI17271@n2100.armlinux.org.uk>
Remove the unused CRTC colourspace properties - userspace does not make
use of these. In any case, these are not a property of the CRTC, since
they demonstrably only affect the video (overlay) plane, irrespective
of the format of the graphics (primary) plane.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
---
drivers/gpu/drm/armada/armada_crtc.c | 118 -----------------------------------
drivers/gpu/drm/armada/armada_crtc.h | 2 -
drivers/gpu/drm/armada/armada_drm.h | 2 -
3 files changed, 122 deletions(-)
diff --git a/drivers/gpu/drm/armada/armada_crtc.c b/drivers/gpu/drm/armada/armada_crtc.c
index b9b0a508793d..35b2df0fc21c 100644
--- a/drivers/gpu/drm/armada/armada_crtc.c
+++ b/drivers/gpu/drm/armada/armada_crtc.c
@@ -23,14 +23,6 @@
#include "armada_plane.h"
#include "armada_trace.h"
-enum csc_mode {
- CSC_AUTO = 0,
- CSC_YUV_CCIR601 = 1,
- CSC_YUV_CCIR709 = 2,
- CSC_RGB_COMPUTER = 1,
- CSC_RGB_STUDIO = 2,
-};
-
/*
* A note about interlacing. Let's consider HDMI 1920x1080i.
* The timing parameters we have from X are:
@@ -438,42 +430,6 @@ static irqreturn_t armada_drm_irq(int irq, void *arg)
return IRQ_NONE;
}
-static uint32_t armada_drm_crtc_calculate_csc(struct armada_crtc *dcrtc)
-{
- struct drm_display_mode *adj = &dcrtc->crtc.mode;
- uint32_t val = 0;
-
- if (dcrtc->csc_yuv_mode == CSC_YUV_CCIR709)
- val |= CFG_CSC_YUV_CCIR709;
- if (dcrtc->csc_rgb_mode == CSC_RGB_STUDIO)
- val |= CFG_CSC_RGB_STUDIO;
-
- /*
- * In auto mode, set the colorimetry, based upon the HDMI spec.
- * 1280x720p, 1920x1080p and 1920x1080i use ITU709, others use
- * ITU601. It may be more appropriate to set this depending on
- * the source - but what if the graphic frame is YUV and the
- * video frame is RGB?
- */
- if ((adj->hdisplay == 1280 && adj->vdisplay == 720 &&
- !(adj->flags & DRM_MODE_FLAG_INTERLACE)) ||
- (adj->hdisplay == 1920 && adj->vdisplay == 1080)) {
- if (dcrtc->csc_yuv_mode == CSC_AUTO)
- val |= CFG_CSC_YUV_CCIR709;
- }
-
- /*
- * We assume we're connected to a TV-like device, so the YUV->RGB
- * conversion should produce a limited range. We should set this
- * depending on the connectors attached to this CRTC, and what
- * kind of device they report being connected.
- */
- if (dcrtc->csc_rgb_mode == CSC_AUTO)
- val |= CFG_CSC_RGB_STUDIO;
-
- return val;
-}
-
/* The mode_config.mutex will be held for this call */
static void armada_drm_crtc_mode_set_nofb(struct drm_crtc *crtc)
{
@@ -560,9 +516,6 @@ static void armada_drm_crtc_mode_set_nofb(struct drm_crtc *crtc)
val = adj->flags & DRM_MODE_FLAG_NVSYNC ? CFG_VSYNC_INV : 0;
armada_reg_queue_mod(regs, i, val, CFG_VSYNC_INV, LCD_SPU_DMA_CTRL1);
-
- val = dcrtc->spu_iopad_ctrl | armada_drm_crtc_calculate_csc(dcrtc);
- armada_reg_queue_set(regs, i, val, LCD_SPU_IOPAD_CONTROL);
armada_reg_queue_end(regs, i);
armada_drm_crtc_update_regs(dcrtc, regs);
@@ -937,33 +890,6 @@ static int armada_drm_crtc_page_flip(struct drm_crtc *crtc,
return ret;
}
-static int
-armada_drm_crtc_set_property(struct drm_crtc *crtc,
- struct drm_property *property, uint64_t val)
-{
- struct armada_private *priv = crtc->dev->dev_private;
- struct armada_crtc *dcrtc = drm_to_armada_crtc(crtc);
- bool update_csc = false;
-
- if (property == priv->csc_yuv_prop) {
- dcrtc->csc_yuv_mode = val;
- update_csc = true;
- } else if (property == priv->csc_rgb_prop) {
- dcrtc->csc_rgb_mode = val;
- update_csc = true;
- }
-
- if (update_csc) {
- uint32_t val;
-
- val = dcrtc->spu_iopad_ctrl |
- armada_drm_crtc_calculate_csc(dcrtc);
- writel_relaxed(val, dcrtc->base + LCD_SPU_IOPAD_CONTROL);
- }
-
- return 0;
-}
-
/* These are called under the vbl_lock. */
static int armada_drm_crtc_enable_vblank(struct drm_crtc *crtc)
{
@@ -993,45 +919,12 @@ static const struct drm_crtc_funcs armada_crtc_funcs = {
.destroy = armada_drm_crtc_destroy,
.set_config = drm_crtc_helper_set_config,
.page_flip = armada_drm_crtc_page_flip,
- .set_property = armada_drm_crtc_set_property,
.atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state,
.atomic_destroy_state = drm_atomic_helper_crtc_destroy_state,
.enable_vblank = armada_drm_crtc_enable_vblank,
.disable_vblank = armada_drm_crtc_disable_vblank,
};
-static const struct drm_prop_enum_list armada_drm_csc_yuv_enum_list[] = {
- { CSC_AUTO, "Auto" },
- { CSC_YUV_CCIR601, "CCIR601" },
- { CSC_YUV_CCIR709, "CCIR709" },
-};
-
-static const struct drm_prop_enum_list armada_drm_csc_rgb_enum_list[] = {
- { CSC_AUTO, "Auto" },
- { CSC_RGB_COMPUTER, "Computer system" },
- { CSC_RGB_STUDIO, "Studio" },
-};
-
-static int armada_drm_crtc_create_properties(struct drm_device *dev)
-{
- struct armada_private *priv = dev->dev_private;
-
- if (priv->csc_yuv_prop)
- return 0;
-
- priv->csc_yuv_prop = drm_property_create_enum(dev, 0,
- "CSC_YUV", armada_drm_csc_yuv_enum_list,
- ARRAY_SIZE(armada_drm_csc_yuv_enum_list));
- priv->csc_rgb_prop = drm_property_create_enum(dev, 0,
- "CSC_RGB", armada_drm_csc_rgb_enum_list,
- ARRAY_SIZE(armada_drm_csc_rgb_enum_list));
-
- if (!priv->csc_yuv_prop || !priv->csc_rgb_prop)
- return -ENOMEM;
-
- return 0;
-}
-
static int armada_drm_crtc_create(struct drm_device *drm, struct device *dev,
struct resource *res, int irq, const struct armada_variant *variant,
struct device_node *port)
@@ -1042,10 +935,6 @@ static int armada_drm_crtc_create(struct drm_device *drm, struct device *dev,
void __iomem *base;
int ret;
- ret = armada_drm_crtc_create_properties(drm);
- if (ret)
- return ret;
-
base = devm_ioremap_resource(dev, res);
if (IS_ERR(base))
return PTR_ERR(base);
@@ -1063,8 +952,6 @@ static int armada_drm_crtc_create(struct drm_device *drm, struct device *dev,
dcrtc->base = base;
dcrtc->num = drm->mode_config.num_crtc;
dcrtc->clk = ERR_PTR(-EINVAL);
- dcrtc->csc_yuv_mode = CSC_AUTO;
- dcrtc->csc_rgb_mode = CSC_AUTO;
dcrtc->cfg_dumb_ctrl = DUMB24_RGB888_0;
dcrtc->spu_iopad_ctrl = CFG_VSCALE_LN_EN | CFG_IOPAD_DUMB24;
spin_lock_init(&dcrtc->irq_lock);
@@ -1121,11 +1008,6 @@ static int armada_drm_crtc_create(struct drm_device *drm, struct device *dev,
drm_crtc_helper_add(&dcrtc->crtc, &armada_crtc_helper_funcs);
- drm_object_attach_property(&dcrtc->crtc.base, priv->csc_yuv_prop,
- dcrtc->csc_yuv_mode);
- drm_object_attach_property(&dcrtc->crtc.base, priv->csc_rgb_prop,
- dcrtc->csc_rgb_mode);
-
return armada_overlay_plane_create(drm, 1 << dcrtc->num);
err_crtc_init:
diff --git a/drivers/gpu/drm/armada/armada_crtc.h b/drivers/gpu/drm/armada/armada_crtc.h
index c27435a8776a..21338f7c3d7d 100644
--- a/drivers/gpu/drm/armada/armada_crtc.h
+++ b/drivers/gpu/drm/armada/armada_crtc.h
@@ -72,8 +72,6 @@ struct armada_crtc {
} v[2];
bool interlaced;
bool cursor_update;
- uint8_t csc_yuv_mode;
- uint8_t csc_rgb_mode;
struct drm_plane *plane;
diff --git a/drivers/gpu/drm/armada/armada_drm.h b/drivers/gpu/drm/armada/armada_drm.h
index cc4c557c9f66..28087e4b9b81 100644
--- a/drivers/gpu/drm/armada/armada_drm.h
+++ b/drivers/gpu/drm/armada/armada_drm.h
@@ -60,8 +60,6 @@ struct armada_private {
struct armada_crtc *dcrtc[2];
struct drm_mm linear; /* protected by linear_lock */
struct mutex linear_lock;
- struct drm_property *csc_yuv_prop;
- struct drm_property *csc_rgb_prop;
struct drm_property *colorkey_prop;
struct drm_property *colorkey_min_prop;
struct drm_property *colorkey_max_prop;
--
2.7.4
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2018-07-10 10:33 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-10 10:23 [PATCH 0/3] Finish Armada DRM DT support Russell King - ARM Linux
2018-07-10 10:23 ` Russell King - ARM Linux
2018-07-10 10:24 ` [PATCH 1/3] drm/armada: fix compare_of() for LCD controllers Russell King
2018-07-10 10:24 ` Russell King
2018-07-10 10:24 ` [PATCH 2/3] drm/armada: add OF reserved memory support Russell King
2018-07-10 10:24 ` Russell King
2018-12-18 15:18 ` Lubomir Rintel
2018-12-18 15:18 ` Lubomir Rintel
2018-07-10 10:24 ` [PATCH 3/3] ARM: dts: cubox: add LCD controller and TDA998x configuration Russell King
2018-07-10 10:24 ` Russell King
2018-07-18 14:53 ` Gregory CLEMENT
2018-07-18 14:53 ` Gregory CLEMENT
2018-07-10 10:31 ` [PATCH 00/17] Transition Armada DRM planes to atomic state Russell King - ARM Linux
2018-07-10 10:32 ` [PATCH 01/17] drm/armada: clean up armada_drm_crtc_page_flip() Russell King
2018-07-10 10:32 ` [PATCH 02/17] drm/armada: add rectangle helpers Russell King
2018-07-10 10:32 ` [PATCH 03/17] drm/armada: move mode set vblank handling and disable/enable Russell King
2018-07-10 10:32 ` [PATCH 04/17] drm/armada: use core of primary update_plane for mode set Russell King
2018-07-10 10:32 ` [PATCH 05/17] drm/armada: merge armada_drm_gra_plane_regs() into only caller Russell King
2018-07-10 10:32 ` [PATCH 06/17] drm/armada: reset all atomic state during driver initialisation Russell King
2018-07-10 10:32 ` [PATCH 07/17] drm/armada: convert primary plane to atomic state Russell King
2018-07-10 10:32 ` [PATCH 08/17] drm/armada: convert page_flip to use primary plane atomic_update() Russell King
2018-07-10 10:32 ` [PATCH 09/17] drm/armada: convert overlay plane to atomic state Russell King
2018-07-10 10:33 ` [PATCH 10/17] drm/armada: remove temporary crtc state Russell King
2018-07-10 10:33 ` [PATCH 11/17] drm/armada: use old_state for update tracking in atomic_update() Russell King
2018-07-10 10:33 ` [PATCH 12/17] drm/armada: move primary plane to separate file Russell King
2018-07-10 10:33 ` [PATCH 13/17] drm/armada: move plane works to overlay Russell King
2018-07-10 10:33 ` [PATCH 14/17] drm/armada: move CBSH properties into overlay plane state Russell King
2018-07-10 10:33 ` [PATCH 15/17] drm/armada: move colorkey " Russell King
2018-07-10 10:33 ` Russell King [this message]
2018-07-10 10:33 ` [PATCH 17/17] drm/armada: add plane colorspace properties Russell King
2018-07-10 10:40 ` [PATCH 00/20] Finish Armada DRM transition to atomic modeset Russell King - ARM Linux
2018-07-10 10:41 ` [PATCH 01/20] drm/armada: move armada_drm_mode_config_funcs to armada_drv.c Russell King
2018-07-10 10:41 ` [PATCH 02/20] drm/armada: pass plane state into armada_drm_plane_calc_addrs() Russell King
2018-07-10 10:41 ` [PATCH 03/20] drm/armada: provide pitches from armada_drm_plane_calc_addrs() Russell King
2018-07-10 10:41 ` [PATCH 04/20] drm/armada: push interlace calculation into armada_drm_plane_calc() Russell King
2018-07-10 10:41 ` [PATCH 05/20] drm/armada: move sync signal polarity to mode_set_nofb() method Russell King
2018-07-10 10:41 ` [PATCH 06/20] drm/armada: update debug in armada_drm_crtc_mode_set_nofb() Russell King
2018-07-10 10:41 ` [PATCH 07/20] drm/armada: clean up SPU_ADV_REG Russell King
2018-07-10 10:41 ` [PATCH 08/20] drm/armada: handle atomic modeset crtc events Russell King
2018-07-10 10:41 ` [PATCH 09/20] drm/armada: push responsibility for clock management to backend Russell King
2018-07-10 10:42 ` [PATCH 10/20] drm/armada: unhook dpms state from armada_drm_crtc_update() Russell King
2018-07-10 10:42 ` [PATCH 11/20] drm/armada: implement atomic_enable()/atomic_disable() methods Russell King
2018-07-10 10:42 ` [PATCH 12/20] drm/armada: enable atomic modeset support Russell King
2018-07-10 10:42 ` [PATCH 13/20] drm/armada: switch legacy modeset to atomic modeset Russell King
2018-07-10 10:42 ` [PATCH 14/20] drm/armada: switch primary plane " Russell King
2018-07-10 10:42 ` [PATCH 15/20] drm/armada: switch overlay " Russell King
2018-07-10 10:42 ` [PATCH 16/20] drm/armada: update planes after the dumb frame is complete Russell King
2018-07-10 10:42 ` [PATCH 17/20] drm/armada: update primary framebuffer parameters on mode change Russell King
2018-07-10 10:42 ` [PATCH 18/20] drm/armada: remove unnecessary armada_ovl_plane structure Russell King
2018-07-10 10:42 ` [PATCH 19/20] drm/armada: remove unnecessary armada_plane structure Russell King
2018-07-10 10:42 ` [PATCH 20/20] drm/armada: remove obsolete fb unreferencing kfifo and workqueue Russell King
2018-07-25 20:01 ` [PATCH 00/20] Finish Armada DRM transition to atomic modeset Dave Airlie
2018-12-18 15:21 ` [PATCH 0/3] Finish Armada DRM DT support Lubomir Rintel
2018-12-18 15:21 ` Lubomir Rintel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1fcpxb-00042A-Cs@rmk-PC.armlinux.org.uk \
--to=rmk+kernel@armlinux.org.uk \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.