Commit 5b6edb88 authored by Maarten Lankhorst's avatar Maarten Lankhorst

drm/i915: Add aliases for uapi and hw to plane_state

Prepare to split up hw and uapi machinally, by adding a uapi and
hw alias. We will remove the base in a bit. This is a split from the
original uapi/hw patch, which did it all in one go.
Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191031112610.27608-7-maarten.lankhorst@linux.intel.comReviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
parent 58d124ea
...@@ -80,22 +80,20 @@ void intel_plane_free(struct intel_plane *plane) ...@@ -80,22 +80,20 @@ void intel_plane_free(struct intel_plane *plane)
struct drm_plane_state * struct drm_plane_state *
intel_plane_duplicate_state(struct drm_plane *plane) intel_plane_duplicate_state(struct drm_plane *plane)
{ {
struct drm_plane_state *state;
struct intel_plane_state *intel_state; struct intel_plane_state *intel_state;
intel_state = kmemdup(plane->state, sizeof(*intel_state), GFP_KERNEL); intel_state = to_intel_plane_state(plane->state);
intel_state = kmemdup(intel_state, sizeof(*intel_state), GFP_KERNEL);
if (!intel_state) if (!intel_state)
return NULL; return NULL;
state = &intel_state->base; __drm_atomic_helper_plane_duplicate_state(plane, &intel_state->base);
__drm_atomic_helper_plane_duplicate_state(plane, state);
intel_state->vma = NULL; intel_state->vma = NULL;
intel_state->flags = 0; intel_state->flags = 0;
return state; return &intel_state->base;
} }
/** /**
...@@ -110,9 +108,11 @@ void ...@@ -110,9 +108,11 @@ void
intel_plane_destroy_state(struct drm_plane *plane, intel_plane_destroy_state(struct drm_plane *plane,
struct drm_plane_state *state) struct drm_plane_state *state)
{ {
WARN_ON(to_intel_plane_state(state)->vma); struct intel_plane_state *plane_state = to_intel_plane_state(state);
WARN_ON(plane_state->vma);
drm_atomic_helper_plane_destroy_state(plane, state); __drm_atomic_helper_plane_destroy_state(&plane_state->base);
kfree(plane_state);
} }
unsigned int intel_plane_data_rate(const struct intel_crtc_state *crtc_state, unsigned int intel_plane_data_rate(const struct intel_crtc_state *crtc_state,
......
...@@ -523,7 +523,11 @@ struct intel_atomic_state { ...@@ -523,7 +523,11 @@ struct intel_atomic_state {
}; };
struct intel_plane_state { struct intel_plane_state {
struct drm_plane_state base; union {
struct drm_plane_state base;
struct drm_plane_state uapi;
struct drm_plane_state hw;
};
struct i915_ggtt_view view; struct i915_ggtt_view view;
struct i915_vma *vma; struct i915_vma *vma;
unsigned long flags; unsigned long flags;
...@@ -1143,7 +1147,7 @@ struct cxsr_latency { ...@@ -1143,7 +1147,7 @@ struct cxsr_latency {
#define to_intel_encoder(x) container_of(x, struct intel_encoder, base) #define to_intel_encoder(x) container_of(x, struct intel_encoder, base)
#define to_intel_framebuffer(x) container_of(x, struct intel_framebuffer, base) #define to_intel_framebuffer(x) container_of(x, struct intel_framebuffer, base)
#define to_intel_plane(x) container_of(x, struct intel_plane, base) #define to_intel_plane(x) container_of(x, struct intel_plane, base)
#define to_intel_plane_state(x) container_of(x, struct intel_plane_state, base) #define to_intel_plane_state(x) container_of(x, struct intel_plane_state, uapi)
#define intel_fb_obj(x) ((x) ? to_intel_bo((x)->obj[0]) : NULL) #define intel_fb_obj(x) ((x) ? to_intel_bo((x)->obj[0]) : NULL)
struct intel_hdmi { struct intel_hdmi {
......
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