All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrzej Hajda <a.hajda@samsung.com>
To: Inki Dae <inki.dae@samsung.com>
Cc: Andrzej Hajda <a.hajda@samsung.com>,
	"moderated list:ARM/S5P EXYNOS AR..."
	<linux-samsung-soc@vger.kernel.org>,
	"open list:DRM DRIVERS FOR E..."
	<dri-devel@lists.freedesktop.org>,
	Marek Szyprowski <m.szyprowski@samsung.com>
Subject: [PATCH 08/14] drm/exynos/hdmi: stop using display->ctx pointer
Date: Mon, 17 Nov 2014 09:54:21 +0100	[thread overview]
Message-ID: <1416214467-6179-9-git-send-email-a.hajda@samsung.com> (raw)
In-Reply-To: <1416214467-6179-1-git-send-email-a.hajda@samsung.com>

The patch replaces accesses to display->ctx pointer by container_of
construct. It will allow to remove ctx field in the future.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_hdmi.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
index f8ed123..37bb423 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -213,6 +213,11 @@ struct hdmi_context {
 	enum hdmi_type			type;
 };
 
+static inline struct hdmi_context *display_to_hdmi(struct exynos_drm_display *d)
+{
+	return container_of(d, struct hdmi_context, display);
+}
+
 struct hdmiphy_config {
 	int pixel_clock;
 	u8 conf[32];
@@ -1128,7 +1133,7 @@ static struct drm_connector_helper_funcs hdmi_connector_helper_funcs = {
 static int hdmi_create_connector(struct exynos_drm_display *display,
 			struct drm_encoder *encoder)
 {
-	struct hdmi_context *hdata = display->ctx;
+	struct hdmi_context *hdata = display_to_hdmi(display);
 	struct drm_connector *connector = &hdata->connector;
 	int ret;
 
@@ -2005,7 +2010,7 @@ static void hdmi_v14_mode_set(struct hdmi_context *hdata,
 static void hdmi_mode_set(struct exynos_drm_display *display,
 			struct drm_display_mode *mode)
 {
-	struct hdmi_context *hdata = display->ctx;
+	struct hdmi_context *hdata = display_to_hdmi(display);
 	struct drm_display_mode *m = mode;
 
 	DRM_DEBUG_KMS("xres=%d, yres=%d, refresh=%d, intl=%s\n",
@@ -2024,7 +2029,7 @@ static void hdmi_mode_set(struct exynos_drm_display *display,
 
 static void hdmi_commit(struct exynos_drm_display *display)
 {
-	struct hdmi_context *hdata = display->ctx;
+	struct hdmi_context *hdata = display_to_hdmi(display);
 
 	mutex_lock(&hdata->hdmi_mutex);
 	if (!hdata->powered) {
@@ -2038,7 +2043,7 @@ static void hdmi_commit(struct exynos_drm_display *display)
 
 static void hdmi_poweron(struct exynos_drm_display *display)
 {
-	struct hdmi_context *hdata = display->ctx;
+	struct hdmi_context *hdata = display_to_hdmi(display);
 	struct hdmi_resources *res = &hdata->res;
 
 	mutex_lock(&hdata->hdmi_mutex);
@@ -2069,7 +2074,7 @@ static void hdmi_poweron(struct exynos_drm_display *display)
 
 static void hdmi_poweroff(struct exynos_drm_display *display)
 {
-	struct hdmi_context *hdata = display->ctx;
+	struct hdmi_context *hdata = display_to_hdmi(display);
 	struct hdmi_resources *res = &hdata->res;
 
 	mutex_lock(&hdata->hdmi_mutex);
@@ -2104,7 +2109,7 @@ out:
 
 static void hdmi_dpms(struct exynos_drm_display *display, int mode)
 {
-	struct hdmi_context *hdata = display->ctx;
+	struct hdmi_context *hdata = display_to_hdmi(display);
 	struct drm_encoder *encoder = hdata->encoder;
 	struct drm_crtc *crtc = encoder->crtc;
 	struct drm_crtc_helper_funcs *funcs = NULL;
@@ -2481,7 +2486,6 @@ out_get_phy_port:
 	}
 
 	pm_runtime_enable(dev);
-	hdata->display.ctx = hdata;
 
 	ret = component_add(&pdev->dev, &hdmi_component_ops);
 	if (ret)
-- 
1.9.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2014-11-17  8:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-17  8:54 [PATCH 00/14] drm/exynos: embed exynos-drm framework objects into driver private context Andrzej Hajda
2014-11-17  8:54 ` [PATCH 01/14] drm/exynos/mixer: embed manager into " Andrzej Hajda
2014-11-17  8:54 ` [PATCH 02/14] drm/exynos/mixer: stop using manager->ctx pointer Andrzej Hajda
2014-11-17  8:54 ` [PATCH 03/14] drm/exynos/vidi: embed manager into private context Andrzej Hajda
2014-11-17  8:54 ` [PATCH 04/14] drm/exynos/vidi: stop using manager->ctx pointer Andrzej Hajda
2014-11-17  8:54 ` [PATCH 05/14] drm/exynos/fimd: embed manager into private context Andrzej Hajda
2014-11-17  8:54 ` [PATCH 06/14] drm/exynos/fimd: stop using manager->ctx pointer Andrzej Hajda
2014-11-17  8:54 ` [PATCH 07/14] drm/exynos/hdmi: embed display into private context Andrzej Hajda
2014-11-17  8:54 ` Andrzej Hajda [this message]
2014-11-17  8:54 ` [PATCH 09/14] drm/exynos/vidi: " Andrzej Hajda
2014-11-17  8:54 ` [PATCH 10/14] drm/exynos/vidi: stop using display->ctx pointer Andrzej Hajda
2014-11-17  8:54 ` [PATCH 11/14] drm/exynos/dp: embed display into private context Andrzej Hajda
2014-11-17  8:54 ` [PATCH 12/14] drm/exynos/dp: stop using display->ctx pointer Andrzej Hajda
2014-11-17  8:54 ` [PATCH 13/14] drm/exynos/dpi: embed display into private context Andrzej Hajda
2014-11-17  8:54 ` [PATCH 14/14] drm/exynos/dpi: stop using display->ctx pointer Andrzej Hajda

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=1416214467-6179-9-git-send-email-a.hajda@samsung.com \
    --to=a.hajda@samsung.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=inki.dae@samsung.com \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    /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.