From: Matt Roper <matthew.d.roper@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Subject: [PATCH 2/4] drm/atomic/helper: Allow duplication of in-flight states
Date: Wed, 9 Sep 2015 18:57:53 -0700 [thread overview]
Message-ID: <1441850275-20353-3-git-send-email-matthew.d.roper@intel.com> (raw)
In-Reply-To: <1441850275-20353-1-git-send-email-matthew.d.roper@intel.com>
Drivers may wish to duplicate in-flight states internally, but the
__drm_atomic_helper_{crtc,plane}_duplicate_state helper functions can
only be used to make a copy of state that has already been committed to
obj->state. Let's update the helpers to take any existing state object
as their first parameter rather than the DRM object pointer. We can
update handful of existing callsites to just pass obj->state for it.
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
---
drivers/gpu/drm/drm_atomic_helper.c | 12 ++++++------
drivers/gpu/drm/i915/intel_atomic.c | 2 +-
drivers/gpu/drm/i915/intel_atomic_plane.c | 2 +-
drivers/gpu/drm/omapdrm/omap_plane.c | 2 +-
drivers/gpu/drm/rcar-du/rcar_du_plane.c | 2 +-
drivers/gpu/drm/tegra/dc.c | 4 ++--
include/drm/drm_atomic_helper.h | 4 ++--
7 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 9941167..915b462 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -2149,10 +2149,10 @@ EXPORT_SYMBOL(drm_atomic_helper_crtc_reset);
* Copies atomic state from a CRTC's current state and resets inferred values.
* This is useful for drivers that subclass the CRTC state.
*/
-void __drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc,
+void __drm_atomic_helper_crtc_duplicate_state(struct drm_crtc_state *from,
struct drm_crtc_state *state)
{
- memcpy(state, crtc->state, sizeof(*state));
+ memcpy(state, from, sizeof(*state));
if (state->mode_blob)
drm_property_reference_blob(state->mode_blob);
@@ -2181,7 +2181,7 @@ drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc)
state = kmalloc(sizeof(*state), GFP_KERNEL);
if (state)
- __drm_atomic_helper_crtc_duplicate_state(crtc, state);
+ __drm_atomic_helper_crtc_duplicate_state(crtc->state, state);
return state;
}
@@ -2248,10 +2248,10 @@ EXPORT_SYMBOL(drm_atomic_helper_plane_reset);
* Copies atomic state from a plane's current state. This is useful for
* drivers that subclass the plane state.
*/
-void __drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane,
+void __drm_atomic_helper_plane_duplicate_state(struct drm_plane_state *from,
struct drm_plane_state *state)
{
- memcpy(state, plane->state, sizeof(*state));
+ memcpy(state, from, sizeof(*state));
if (state->fb)
drm_framebuffer_reference(state->fb);
@@ -2275,7 +2275,7 @@ drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane)
state = kmalloc(sizeof(*state), GFP_KERNEL);
if (state)
- __drm_atomic_helper_plane_duplicate_state(plane, state);
+ __drm_atomic_helper_plane_duplicate_state(plane->state, state);
return state;
}
diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c
index 3ffc385..45b21ac 100644
--- a/drivers/gpu/drm/i915/intel_atomic.c
+++ b/drivers/gpu/drm/i915/intel_atomic.c
@@ -97,7 +97,7 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc)
if (!crtc_state)
return NULL;
- __drm_atomic_helper_crtc_duplicate_state(crtc, &crtc_state->base);
+ __drm_atomic_helper_crtc_duplicate_state(crtc->state, &crtc_state->base);
crtc_state->base.crtc = crtc;
diff --git a/drivers/gpu/drm/i915/intel_atomic_plane.c b/drivers/gpu/drm/i915/intel_atomic_plane.c
index f1ab8e4..afbbfe0 100644
--- a/drivers/gpu/drm/i915/intel_atomic_plane.c
+++ b/drivers/gpu/drm/i915/intel_atomic_plane.c
@@ -87,7 +87,7 @@ intel_plane_duplicate_state(struct drm_plane *plane)
state = &intel_state->base;
- __drm_atomic_helper_plane_duplicate_state(plane, state);
+ __drm_atomic_helper_plane_duplicate_state(plane->state, state);
return state;
}
diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c
index 09e363b..8962e6b 100644
--- a/drivers/gpu/drm/omapdrm/omap_plane.c
+++ b/drivers/gpu/drm/omapdrm/omap_plane.c
@@ -258,7 +258,7 @@ omap_plane_atomic_duplicate_state(struct drm_plane *plane)
if (copy == NULL)
return NULL;
- __drm_atomic_helper_plane_duplicate_state(plane, ©->base);
+ __drm_atomic_helper_plane_duplicate_state(plane->state, ©->base);
return ©->base;
}
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_plane.c b/drivers/gpu/drm/rcar-du/rcar_du_plane.c
index c669864..e050f54 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_plane.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_plane.c
@@ -310,7 +310,7 @@ rcar_du_plane_atomic_duplicate_state(struct drm_plane *plane)
if (copy == NULL)
return NULL;
- __drm_atomic_helper_plane_duplicate_state(plane, ©->state);
+ __drm_atomic_helper_plane_duplicate_state(plane->state, ©->state);
return ©->state;
}
diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index b4af4ab..efd1fc1 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -455,7 +455,7 @@ static struct drm_plane_state *tegra_plane_atomic_duplicate_state(struct drm_pla
if (!copy)
return NULL;
- __drm_atomic_helper_plane_duplicate_state(plane, ©->base);
+ __drm_atomic_helper_plane_duplicate_state(plane->state, ©->base);
copy->tiling = state->tiling;
copy->format = state->format;
copy->swap = state->swap;
@@ -1036,7 +1036,7 @@ tegra_crtc_atomic_duplicate_state(struct drm_crtc *crtc)
if (!copy)
return NULL;
- __drm_atomic_helper_crtc_duplicate_state(crtc, ©->base);
+ __drm_atomic_helper_crtc_duplicate_state(crtc->state, ©->base);
copy->clk = state->clk;
copy->pclk = state->pclk;
copy->div = state->div;
diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helper.h
index 1547eb4..570ebff 100644
--- a/include/drm/drm_atomic_helper.h
+++ b/include/drm/drm_atomic_helper.h
@@ -93,7 +93,7 @@ int drm_atomic_helper_connector_dpms(struct drm_connector *connector,
/* default implementations for state handling */
void drm_atomic_helper_crtc_reset(struct drm_crtc *crtc);
-void __drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc,
+void __drm_atomic_helper_crtc_duplicate_state(struct drm_crtc_state *from,
struct drm_crtc_state *state);
struct drm_crtc_state *
drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc);
@@ -103,7 +103,7 @@ void drm_atomic_helper_crtc_destroy_state(struct drm_crtc *crtc,
struct drm_crtc_state *state);
void drm_atomic_helper_plane_reset(struct drm_plane *plane);
-void __drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane,
+void __drm_atomic_helper_plane_duplicate_state(struct drm_plane_state *from,
struct drm_plane_state *state);
struct drm_plane_state *
drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane);
--
2.1.4
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2015-09-10 1:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-10 1:57 [PATCH 0/4] Intermediate state for modesets Matt Roper
2015-09-10 1:57 ` [PATCH 1/4] drm/i915: Roll intel_crtc->atomic into intel_crtc_state Matt Roper
2015-09-10 1:57 ` Matt Roper [this message]
2015-09-10 1:57 ` [PATCH 3/4] drm/i915: Calculate an intermediate atomic state for modesets (v2) Matt Roper
2015-09-10 1:57 ` [PATCH 4/4] drm/i915: Update modeset programming to use intermediate state (v2) Matt Roper
2015-09-10 5:40 ` Maarten Lankhorst
2015-09-22 19:55 ` Ville Syrjälä
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=1441850275-20353-3-git-send-email-matthew.d.roper@intel.com \
--to=matthew.d.roper@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox