i915 nuclear pageflip (v2)
Subsystems (3)
cover i915 nuclear pageflip (v2)
Previous version of this series was here:
http://lists.freedesktop.org/archives/intel-gfx/2015-January/058631.html
This round incorporates feedback from Daniel, Ander, and Bob. The biggest change here is that Daniel convinced me that the transitional helper for property updates wouldn't really be useful for other drivers, so I dropped that helper completely and instead just move i915 straight to the full atomic helper a little bit later in the series.
Matt Roper (10):
drm: Add rotation value to plane state
drm/i915: Move rotation from intel_plane to drm_plane_state drm/i915: Consolidate plane handler vtables
drm/i915: Add .atomic_{get,set}_property() entrypoints to planes drm/i915: Add main atomic entrypoints (v2)
drm/i915: Setup dummy atomic state for connectors (v2) drm/i915: Add atomic_get_property entrypoint for connectors drm/i915: Add crtc state duplication/destruction functions drm/i915: Switch plane properties to full atomic helper. drm/i915: Add i915.nuclear_pageflip command line param to force atomic
(v3)
drivers/gpu/drm/drm_atomic.c | 2 + drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/i915_drv.c | 8 + drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_params.c | 5 + drivers/gpu/drm/i915/intel_atomic.c | 237 ++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_atomic_plane.c | 112 ++++++++++++-- drivers/gpu/drm/i915/intel_crt.c | 3 + drivers/gpu/drm/i915/intel_display.c | 83 +++++++---- drivers/gpu/drm/i915/intel_dp.c | 3 + drivers/gpu/drm/i915/intel_dp_mst.c | 3 + drivers/gpu/drm/i915/intel_drv.h | 31 +++- drivers/gpu/drm/i915/intel_dsi.c | 2 + drivers/gpu/drm/i915/intel_dvo.c | 2 + drivers/gpu/drm/i915/intel_fbc.c | 2 +- drivers/gpu/drm/i915/intel_hdmi.c | 3 + drivers/gpu/drm/i915/intel_lvds.c | 3 + drivers/gpu/drm/i915/intel_sdvo.c | 3 + drivers/gpu/drm/i915/intel_sprite.c | 60 ++------ drivers/gpu/drm/i915/intel_tv.c | 3 + include/drm/drm_crtc.h | 3 + 21 files changed, 483 insertions(+), 87 deletions(-) create mode 100644 drivers/gpu/drm/i915/intel_atomic.c
Signature · 6 lines
1.8.5.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/10 drm: Add rotation value to plane state
The rotation property is shared by multiple drivers, so it makes sense to store the rotation value (for atomic-converted drivers) in the common plane state so that core code can eventually access it as well.
--- drivers/gpu/drm/drm_atomic.c | 2 ++ include/drm/drm_crtc.h | 3 +++ 2 files changed, 5 insertions(+)
drivers/gpu/drm/drm_atomic.c +2 -0
@@ -387,6 +387,8 @@ int drm_atomic_plane_set_property(struct drm_plane *plane, state->src_w = val; }else if (property == config->prop_src_h) { state->src_h = val; + }else if (property == config->rotation_property) { + state->rotation = val; }else if (plane->funcs->atomic_set_property) {return plane->funcs->atomic_set_property (plane, state, property, val);
include/drm/drm_crtc.h +3 -0
@@ -760,6 +760,9 @@ struct drm_plane_state {uint32_t src_x, src_y;uint32_t src_h, src_w; +/* Plane rotation */ +unsigned int rotation; +struct drm_atomic_state *state; };
Signature · 6 lines
1.8.5.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/10 drm/i915: Move rotation from intel_plane to drm_plane_state
In reply to Matt RoperRuntime state that can be manipulated via properties should now go in intel_plane_state/drm_plane_state so that it can be tracked as part of an atomic transaction.
We add a new 'intel_create_plane_state' function so that the proper initial value for this property (and future properties) doesn't have to be repeated at each plane initialization site.
v2:
- Stick rotation in common drm_plane_state rather than intel_plane_state. (Daniel)
- Add intel_create_plane_state() to consolidate the places where we have to set initial state values. (Ander)
--- drivers/gpu/drm/i915/intel_atomic_plane.c | 45 ++++++++++++++++++++++++------- drivers/gpu/drm/i915/intel_display.c | 31 ++++++++++----------- drivers/gpu/drm/i915/intel_drv.h | 8 +++++- drivers/gpu/drm/i915/intel_fbc.c | 2 +- drivers/gpu/drm/i915/intel_sprite.c | 31 +++++++++++---------- 5 files changed, 75 insertions(+), 42 deletions(-)
drivers/gpu/drm/i915/intel_atomic_plane.c +36 -9
@@ -37,31 +37,58 @@#include "intel_drv.h" /** +* intel_create_plane_state - create plane state object +* @plane: drm plane +* +* Allocates a fresh plane state for the given plane and sets some of +* the state values to sensible initial values. +* +* Returns: A newly allocated plane state, or NULL on failure +*/ +struct intel_plane_state * +intel_create_plane_state (struct drm_plane *plane) +{ +struct intel_plane_state *state; + + state =kzalloc (sizeof (*state),GFP_KERNEL ); +if (!state) +return NULL ; + + state->base.plane = plane; + state->base.rotation =BIT (DRM_ROTATE_0 ); + +return state; +} + +/** * intel_plane_duplicate_state - duplicate plane state * @plane: drm plane * * Allocates and returns a copy of the plane state (both common and * Intel-specific) for the specified plane. * -* Returns: The newly allocated plane state, or NULL or failure. +* Returns: The newly allocated plane state, or NULL on failure. */ struct drm_plane_state *intel_plane_duplicate_state (struct drm_plane *plane) { -struct intel_plane_state *state; +struct drm_plane_state *state; +struct intel_plane_state *intel_state; -if (plane->state) - state =kmemdup (plane->state,sizeof (*state),GFP_KERNEL ); +if (WARN_ON (!plane->state)) + intel_state =intel_create_plane_state (plane);else - state =kzalloc (sizeof (*state),GFP_KERNEL ); + intel_state =kmemdup (plane->state,sizeof (*intel_state), +GFP_KERNEL ); -if (!state) +if (!intel_state)return NULL ; -if (state->base.fb) -drm_framebuffer_reference (state->base.fb); + state = &intel_state->base; +if (state->fb) +drm_framebuffer_reference (state->fb); -return &state->base; +return state; }/**
drivers/gpu/drm/i915/intel_display.c +16 -15
@@ -2560,7 +2560,7 @@ static void i9xx_update_primary_plane(struct drm_crtc *crtc, intel_crtc->dspaddr_offset = linear_offset; } -if (to_intel_plane (crtc->primary)->rotation ==BIT (DRM_ROTATE_180 )) { +if (crtc->primary->state->rotation ==BIT (DRM_ROTATE_180 )) { dspcntr |=DISPPLANE_ROTATE_180 ; x += (intel_crtc->config->pipe_src_w -1 );
@@ -2662,7 +2662,7 @@ static void ironlake_update_primary_plane(struct drm_crtc *crtc, pixel_size, fb->pitches[0]); linear_offset -= intel_crtc->dspaddr_offset; -if (to_intel_plane (crtc->primary)->rotation ==BIT (DRM_ROTATE_180 )) { +if (crtc->primary->state->rotation ==BIT (DRM_ROTATE_180 )) { dspcntr |=DISPPLANE_ROTATE_180 ;if (!IS_HASWELL (dev) && !IS_BROADWELL (dev)) {
@@ -2759,7 +2759,7 @@ static void skylake_update_primary_plane(struct drm_crtc *crtc, } plane_ctl |=PLANE_CTL_PLANE_GAMMA_DISABLE ; -if (to_intel_plane (crtc->primary)->rotation ==BIT (DRM_ROTATE_180 )) +if (crtc->primary->state->rotation ==BIT (DRM_ROTATE_180 )) plane_ctl |=PLANE_CTL_ROTATE_180 ;I915_WRITE (PLANE_CTL (pipe,0 ), plane_ctl);
@@ -8332,7 +8332,7 @@ static void i9xx_update_cursor(struct drm_crtc *crtc, u32 base) cntl |=CURSOR_PIPE_CSC_ENABLE ; } -if (to_intel_plane (crtc->cursor)->rotation ==BIT (DRM_ROTATE_180 )) +if (crtc->cursor->state->rotation ==BIT (DRM_ROTATE_180 )) cntl |=CURSOR_ROTATE_180 ;if (intel_crtc->cursor_cntl != cntl) {
@@ -8394,7 +8394,7 @@ static void intel_crtc_update_cursor(struct drm_crtc *crtc,/* ILK+ do this automagically */ if (HAS_GMCH_DISPLAY (dev) && -to_intel_plane (crtc->cursor)->rotation ==BIT (DRM_ROTATE_180 )) { + crtc->cursor->state->rotation ==BIT (DRM_ROTATE_180 )) { base += (intel_crtc->cursor_height * intel_crtc->cursor_width -1 ) *4 ; }
@@ -11846,7 +11846,6 @@ intel_check_primary_plane(struct drm_plane *plane,struct drm_i915_private *dev_priv = dev->dev_private;struct drm_crtc *crtc = state->base.crtc;struct intel_crtc *intel_crtc; -struct intel_plane *intel_plane =to_intel_plane (plane);struct drm_framebuffer *fb = state->base.fb;struct drm_rect *dest = &state->dst;struct drm_rect *src = &state->src;
@@ -11880,7 +11879,7 @@ intel_check_primary_plane(struct drm_plane *plane,if (intel_crtc->primary_enabled &&INTEL_INFO (dev)->gen <=4 && !IS_G4X (dev) && dev_priv->fbc.plane == intel_crtc->plane && - intel_plane->rotation !=BIT (DRM_ROTATE_0 )) { + state->base.rotation !=BIT (DRM_ROTATE_0 )) { intel_crtc->atomic.disable_fbc = true; }
@@ -12064,6 +12063,7 @@ static struct drm_plane *intel_primary_plane_create(struct drm_device *dev, int pipe) {struct intel_plane *primary; +struct intel_plane_state *state;const uint32_t *intel_primary_formats;int num_formats;
@@ -12071,17 +12071,17 @@ static struct drm_plane *intel_primary_plane_create(struct drm_device *dev,if (primary ==NULL )return NULL ; - primary->base.state =intel_plane_duplicate_state (&primary->base); -if (primary->base.state ==NULL ) { + state =intel_create_plane_state (&primary->base); +if (!state) {kfree (primary);return NULL ; } + primary->base.state = &state->base; primary->can_scale = false; primary->max_downscale =1 ; primary->pipe = pipe; primary->plane = pipe; - primary->rotation =BIT (DRM_ROTATE_0 ); primary->check_plane = intel_check_primary_plane; primary->commit_plane = intel_commit_primary_plane;if (HAS_FBC (dev) &&INTEL_INFO (dev)->gen <4 )
@@ -12109,7 +12109,7 @@ static struct drm_plane *intel_primary_plane_create(struct drm_device *dev,if (dev->mode_config.rotation_property)drm_object_attach_property (&primary->base.base, dev->mode_config.rotation_property, - primary->rotation); + state->base.rotation); }drm_plane_helper_add (&primary->base, &intel_plane_helper_funcs);
@@ -12237,22 +12237,23 @@ static struct drm_plane *intel_cursor_plane_create(struct drm_device *dev, int pipe) {struct intel_plane *cursor; +struct intel_plane_state *state; cursor =kzalloc (sizeof (*cursor),GFP_KERNEL );if (cursor ==NULL )return NULL ; - cursor->base.state =intel_plane_duplicate_state (&cursor->base); -if (cursor->base.state ==NULL ) { + state =intel_create_plane_state (&cursor->base); +if (!state) {kfree (cursor);return NULL ; } + cursor->base.state = &state->base; cursor->can_scale = false; cursor->max_downscale =1 ; cursor->pipe = pipe; cursor->plane = pipe; - cursor->rotation =BIT (DRM_ROTATE_0 ); cursor->check_plane = intel_check_cursor_plane; cursor->commit_plane = intel_commit_cursor_plane;
@@ -12271,7 +12272,7 @@ static struct drm_plane *intel_cursor_plane_create(struct drm_device *dev,if (dev->mode_config.rotation_property)drm_object_attach_property (&cursor->base.base, dev->mode_config.rotation_property, - cursor->rotation); + state->base.rotation); }drm_plane_helper_add (&cursor->base, &intel_plane_helper_funcs);
drivers/gpu/drm/i915/intel_drv.h +7 -1
@@ -509,7 +509,6 @@ struct intel_plane {struct drm_i915_gem_object *obj;bool can_scale;int max_downscale; -unsigned int rotation;/* Since we need to change the watermarks before/after * enabling/disabling the planes, we need to store the parameters here
@@ -518,6 +517,12 @@ struct intel_plane {*/ struct intel_plane_wm_parameters wm; +/* +* NOTE: Do not place new plane state fields here (e.g., when adding +* new plane properties). New runtime state should now be placed in +* the intel_plane_state structure and accessed via drm_plane->state. +*/ + void (*update_plane)(struct drm_plane *plane, struct drm_crtc *crtc, struct drm_framebuffer *fb,
@@ -1230,6 +1235,7 @@ void intel_pre_disable_primary(struct drm_crtc *crtc);void intel_tv_init (struct drm_device *dev);/* intel_atomic.c */ +struct intel_plane_state *intel_create_plane_state (struct drm_plane *plane);struct drm_plane_state *intel_plane_duplicate_state (struct drm_plane *plane);void intel_plane_destroy_state (struct drm_plane *plane,struct drm_plane_state *state);
drivers/gpu/drm/i915/intel_fbc.c +1 -1
@@ -595,7 +595,7 @@ void intel_fbc_update(struct drm_device *dev) goto out_disable; }if (INTEL_INFO (dev)->gen <=4 && !IS_G4X (dev) && -to_intel_plane (crtc->primary)->rotation !=BIT (DRM_ROTATE_0 )) { + crtc->primary->state->rotation !=BIT (DRM_ROTATE_0 )) {if (set_no_fbc_reason (dev_priv,FBC_UNSUPPORTED_MODE ))DRM_DEBUG_KMS ("Rotation unsupported, disabling\n" ); goto out_disable;
drivers/gpu/drm/i915/intel_sprite.c +15 -16
@@ -256,7 +256,7 @@ skl_update_plane(struct drm_plane *drm_plane, struct drm_crtc *crtc,default :BUG (); } -if (intel_plane->rotation ==BIT (DRM_ROTATE_180 )) +if (drm_plane->state->rotation ==BIT (DRM_ROTATE_180 )) plane_ctl |=PLANE_CTL_ROTATE_180 ; plane_ctl |=PLANE_CTL_ENABLE ;
@@ -493,7 +493,7 @@ vlv_update_plane(struct drm_plane *dplane, struct drm_crtc *crtc, fb->pitches[0]); linear_offset -= sprsurf_offset; -if (intel_plane->rotation ==BIT (DRM_ROTATE_180 )) { +if (dplane->state->rotation ==BIT (DRM_ROTATE_180 )) { sprctl |=SP_ROTATE_180 ; x += src_w;
@@ -684,7 +684,7 @@ ivb_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, pixel_size, fb->pitches[0]); linear_offset -= sprsurf_offset; -if (intel_plane->rotation ==BIT (DRM_ROTATE_180 )) { +if (plane->state->rotation ==BIT (DRM_ROTATE_180 )) { sprctl |=SPRITE_ROTATE_180 ;/* HSW and BDW does this automagically in hardware */
@@ -884,7 +884,7 @@ ilk_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, pixel_size, fb->pitches[0]); linear_offset -= dvssurf_offset; -if (intel_plane->rotation ==BIT (DRM_ROTATE_180 )) { +if (plane->state->rotation ==BIT (DRM_ROTATE_180 )) { dvscntr |=DVS_ROTATE_180 ; x += src_w;
@@ -1125,7 +1125,7 @@ intel_check_sprite_plane(struct drm_plane *plane, min_scale = intel_plane->can_scale ?1 : (1 <<16 );drm_rect_rotate (src, fb->width <<16 , fb->height <<16 , - intel_plane->rotation); + state->base.rotation); hscale =drm_rect_calc_hscale_relaxed (src, dst, min_scale, max_scale);BUG_ON (hscale <0 );
@@ -1166,7 +1166,7 @@ intel_check_sprite_plane(struct drm_plane *plane, drm_rect_height(dst) * vscale - drm_rect_height(src));drm_rect_rotate_inv (src, fb->width <<16 , fb->height <<16 , - intel_plane->rotation); + state->base.rotation);/* sanity check to make sure the src viewport wasn't enlarged */ WARN_ON(src->x1 < (int) state->base.src_x ||
@@ -1367,7 +1367,6 @@ int intel_plane_set_property(struct drm_plane *plane, uint64_t val) {struct drm_device *dev = plane->dev; -struct intel_plane *intel_plane =to_intel_plane (plane);uint64_t old_val;int ret = -ENOENT ;
@@ -1376,14 +1375,14 @@ int intel_plane_set_property(struct drm_plane *plane,if (hweight32 (val &0xf ) !=1 )return -EINVAL ; -if (intel_plane->rotation == val) +if (plane->state->rotation == val)return 0 ; - old_val = intel_plane->rotation; - intel_plane->rotation = val; + old_val = plane->state->rotation; + plane->state->rotation = val; ret =intel_plane_restore (plane);if (ret) - intel_plane->rotation = old_val; + plane->state->rotation = old_val; }return ret;
@@ -1457,6 +1456,7 @@ int intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane) { struct intel_plane *intel_plane; +struct intel_plane_state *state;unsigned long possible_crtcs;const uint32_t *plane_formats;int num_plane_formats;
@@ -1469,12 +1469,12 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane)if (!intel_plane)return -ENOMEM ; - intel_plane->base.state = -intel_plane_duplicate_state (&intel_plane->base); -if (intel_plane->base.state ==NULL ) { + state =intel_create_plane_state (&intel_plane->base); +if (!state) {kfree (intel_plane);return -ENOMEM ; } + intel_plane->base.state = &state->base;switch (INTEL_INFO (dev)->gen) {case 5 :
@@ -1545,7 +1545,6 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane) intel_plane->pipe = pipe; intel_plane->plane = plane; - intel_plane->rotation =BIT (DRM_ROTATE_0 ); intel_plane->check_plane = intel_check_sprite_plane; intel_plane->commit_plane = intel_commit_sprite_plane; possible_crtcs = (1 << pipe);
@@ -1567,7 +1566,7 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane)if (dev->mode_config.rotation_property)drm_object_attach_property (&intel_plane->base.base, dev->mode_config.rotation_property, - intel_plane->rotation); + state->base.rotation);drm_plane_helper_add (&intel_plane->base, &intel_plane_helper_funcs);
Signature · 6 lines
1.8.5.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 02/10] drm/i915: Move rotation from intel_plane to drm_plane_state
Quoted 400 lines · Matt Roper
Runtime state that can be manipulated via properties should now go in intel_plane_state/drm_plane_state so that it can be tracked as part of an atomic transaction.
We add a new '
intel_create_plane_state' function so that the proper initial value for this property (and future properties) doesn't have to be repeated at each plane initialization site.v2:
- Stick rotation in commondrm_plane_staterather thanintel_plane_state. (Daniel)
- Addintel_create_plane_state()to consolidate the places where we have to set initial state values. (Ander)Signed-off-by Matt Roper <[email protected]>--- drivers/gpu/drm/i915/intel_atomic_plane.c | 45 ++++++++++++++++++++++++------- drivers/gpu/drm/i915/intel_display.c | 31 ++++++++++----------- drivers/gpu/drm/i915/intel_drv.h | 8 +++++- drivers/gpu/drm/i915/intel_fbc.c | 2 +- drivers/gpu/drm/i915/intel_sprite.c | 31 +++++++++++---------- 5 files changed, 75 insertions(+), 42 deletions(-)drivers/gpu/drm/i915/intel_atomic_plane.c +36
-9@@ -37,31 +37,58 @@#include "intel_drv.h" /** +* intel_create_plane_state - create plane state object +* @plane: drm plane +* +* Allocates a fresh plane state for the given plane and sets some of +* the state values to sensible initial values. +* +* Returns: A newly allocated plane state, or NULL on failure +*/ +struct intel_plane_state * +intel_create_plane_state (struct drm_plane *plane) +{ +struct intel_plane_state *state; + + state =kzalloc (sizeof (*state),GFP_KERNEL ); +if (!state) +return NULL ; + + state->base.plane = plane; + state->base.rotation =BIT (DRM_ROTATE_0 ); + +return state; +} + +/** * intel_plane_duplicate_state - duplicate plane state * @plane: drm plane * * Allocates and returns a copy of the plane state (both common and * Intel-specific) for the specified plane. * -* Returns: The newly allocated plane state, or NULL or failure. +* Returns: The newly allocated plane state, or NULL on failure. */ struct drm_plane_state *intel_plane_duplicate_state (struct drm_plane *plane) { -struct intel_plane_state *state; +struct drm_plane_state *state; +struct intel_plane_state *intel_state; -if (plane->state) - state =kmemdup (plane->state,sizeof (*state),GFP_KERNEL ); +if (WARN_ON (!plane->state)) + intel_state =intel_create_plane_state (plane);else - state =kzalloc (sizeof (*state),GFP_KERNEL ); + intel_state =kmemdup (plane->state,sizeof (*intel_state), +GFP_KERNEL ); -if (!state) +if (!intel_state)return NULL ; -if (state->base.fb) -drm_framebuffer_reference (state->base.fb); + state = &intel_state->base; +if (state->fb) +drm_framebuffer_reference (state->fb); -return &state->base; +return state; }/** drivers/gpu/drm/i915/intel_display.c +16
-15@@ -2560,7 +2560,7 @@ static void i9xx_update_primary_plane(struct drm_crtc *crtc, intel_crtc->dspaddr_offset = linear_offset; } -if (to_intel_plane (crtc->primary)->rotation ==BIT (DRM_ROTATE_180 )) { +if (crtc->primary->state->rotation ==BIT (DRM_ROTATE_180 )) { dspcntr |=DISPPLANE_ROTATE_180 ; x += (intel_crtc->config->pipe_src_w -1 );@@ -2662,7 +2662,7 @@ static void ironlake_update_primary_plane(struct drm_crtc *crtc, pixel_size, fb->pitches[0]); linear_offset -= intel_crtc->dspaddr_offset; -if (to_intel_plane (crtc->primary)->rotation ==BIT (DRM_ROTATE_180 )) { +if (crtc->primary->state->rotation ==BIT (DRM_ROTATE_180 )) { dspcntr |=DISPPLANE_ROTATE_180 ;if (!IS_HASWELL (dev) && !IS_BROADWELL (dev)) {@@ -2759,7 +2759,7 @@ static void skylake_update_primary_plane(struct drm_crtc *crtc, } plane_ctl |=PLANE_CTL_PLANE_GAMMA_DISABLE ; -if (to_intel_plane (crtc->primary)->rotation ==BIT (DRM_ROTATE_180 )) +if (crtc->primary->state->rotation ==BIT (DRM_ROTATE_180 )) plane_ctl |=PLANE_CTL_ROTATE_180 ;I915_WRITE (PLANE_CTL (pipe,0 ), plane_ctl);@@ -8332,7 +8332,7 @@ static void i9xx_update_cursor(struct drm_crtc *crtc, u32 base) cntl |=CURSOR_PIPE_CSC_ENABLE ; } -if (to_intel_plane (crtc->cursor)->rotation ==BIT (DRM_ROTATE_180 )) +if (crtc->cursor->state->rotation ==BIT (DRM_ROTATE_180 )) cntl |=CURSOR_ROTATE_180 ;if (intel_crtc->cursor_cntl != cntl) {@@ -8394,7 +8394,7 @@ static void intel_crtc_update_cursor(struct drm_crtc *crtc,/* ILK+ do this automagically */ if (HAS_GMCH_DISPLAY (dev) && -to_intel_plane (crtc->cursor)->rotation ==BIT (DRM_ROTATE_180 )) { + crtc->cursor->state->rotation ==BIT (DRM_ROTATE_180 )) { base += (intel_crtc->cursor_height * intel_crtc->cursor_width -1 ) *4 ; }@@ -11846,7 +11846,6 @@ intel_check_primary_plane(struct drm_plane *plane,struct drm_i915_private *dev_priv = dev->dev_private;struct drm_crtc *crtc = state->base.crtc;struct intel_crtc *intel_crtc; -struct intel_plane *intel_plane =to_intel_plane (plane);struct drm_framebuffer *fb = state->base.fb;struct drm_rect *dest = &state->dst;struct drm_rect *src = &state->src;@@ -11880,7 +11879,7 @@ intel_check_primary_plane(struct drm_plane *plane,if (intel_crtc->primary_enabled &&INTEL_INFO (dev)->gen <=4 && !IS_G4X (dev) && dev_priv->fbc.plane == intel_crtc->plane && - intel_plane->rotation !=BIT (DRM_ROTATE_0 )) { + state->base.rotation !=BIT (DRM_ROTATE_0 )) { intel_crtc->atomic.disable_fbc = true; }@@ -12064,6 +12063,7 @@ static struct drm_plane *intel_primary_plane_create(struct drm_device *dev, int pipe) {struct intel_plane *primary; +struct intel_plane_state *state;const uint32_t *intel_primary_formats;int num_formats;@@ -12071,17 +12071,17 @@ static struct drm_plane *intel_primary_plane_create(struct drm_device *dev,if (primary ==NULL )return NULL ; - primary->base.state =intel_plane_duplicate_state (&primary->base); -if (primary->base.state ==NULL ) { + state =intel_create_plane_state (&primary->base); +if (!state) {kfree (primary);return NULL ; } + primary->base.state = &state->base; primary->can_scale = false; primary->max_downscale =1 ; primary->pipe = pipe; primary->plane = pipe; - primary->rotation =BIT (DRM_ROTATE_0 ); primary->check_plane = intel_check_primary_plane; primary->commit_plane = intel_commit_primary_plane;if (HAS_FBC (dev) &&INTEL_INFO (dev)->gen <4 )@@ -12109,7 +12109,7 @@ static struct drm_plane *intel_primary_plane_create(struct drm_device *dev,if (dev->mode_config.rotation_property)drm_object_attach_property (&primary->base.base, dev->mode_config.rotation_property, - primary->rotation); + state->base.rotation); }drm_plane_helper_add (&primary->base, &intel_plane_helper_funcs);@@ -12237,22 +12237,23 @@ static struct drm_plane *intel_cursor_plane_create(struct drm_device *dev, int pipe) {struct intel_plane *cursor; +struct intel_plane_state *state; cursor =kzalloc (sizeof (*cursor),GFP_KERNEL );if (cursor ==NULL )return NULL ; - cursor->base.state =intel_plane_duplicate_state (&cursor->base); -if (cursor->base.state ==NULL ) { + state =intel_create_plane_state (&cursor->base); +if (!state) {kfree (cursor);return NULL ; } + cursor->base.state = &state->base; cursor->can_scale = false; cursor->max_downscale =1 ; cursor->pipe = pipe; cursor->plane = pipe; - cursor->rotation =BIT (DRM_ROTATE_0 ); cursor->check_plane = intel_check_cursor_plane; cursor->commit_plane = intel_commit_cursor_plane;@@ -12271,7 +12272,7 @@ static struct drm_plane *intel_cursor_plane_create(struct drm_device *dev,if (dev->mode_config.rotation_property)drm_object_attach_property (&cursor->base.base, dev->mode_config.rotation_property, - cursor->rotation); + state->base.rotation); }drm_plane_helper_add (&cursor->base, &intel_plane_helper_funcs);drivers/gpu/drm/i915/intel_drv.h +7
-1@@ -509,7 +509,6 @@ struct intel_plane {struct drm_i915_gem_object *obj;bool can_scale;int max_downscale; -unsigned int rotation;/* Since we need to change the watermarks before/after * enabling/disabling the planes, we need to store the parameters here @@ -518,6 +517,12 @@ struct intel_plane {*/ struct intel_plane_wm_parameters wm; +/* +* NOTE: Do not place new plane state fields here (e.g., when adding +* new plane properties). New runtime state should now be placed in +* the intel_plane_state structure and accessed via drm_plane->state. +*/ + void (*update_plane)(struct drm_plane *plane, struct drm_crtc *crtc, struct drm_framebuffer *fb,@@ -1230,6 +1235,7 @@ void intel_pre_disable_primary(struct drm_crtc *crtc);void intel_tv_init (struct drm_device *dev);/* intel_atomic.c */ +struct intel_plane_state *intel_create_plane_state (struct drm_plane *plane);struct drm_plane_state *intel_plane_duplicate_state (struct drm_plane *plane);void intel_plane_destroy_state (struct drm_plane *plane,struct drm_plane_state *state);drivers/gpu/drm/i915/intel_fbc.c +1
-1@@ -595,7 +595,7 @@ void intel_fbc_update(struct drm_device *dev) goto out_disable; }if (INTEL_INFO (dev)->gen <=4 && !IS_G4X (dev) && -to_intel_plane (crtc->primary)->rotation !=BIT (DRM_ROTATE_0 )) { + crtc->primary->state->rotation !=BIT (DRM_ROTATE_0 )) {if (set_no_fbc_reason (dev_priv,FBC_UNSUPPORTED_MODE ))DRM_DEBUG_KMS ("Rotation unsupported, disabling\n" ); goto out_disable;drivers/gpu/drm/i915/intel_sprite.c +14
-15@@ -256,7 +256,7 @@ skl_update_plane(struct drm_plane *drm_plane, struct drm_crtc *crtc,default :BUG (); } -if (intel_plane->rotation ==BIT (DRM_ROTATE_180 )) +if (drm_plane->state->rotation ==BIT (DRM_ROTATE_180 )) plane_ctl |=PLANE_CTL_ROTATE_180 ; plane_ctl |=PLANE_CTL_ENABLE ;@@ -493,7 +493,7 @@ vlv_update_plane(struct drm_plane *dplane, struct drm_crtc *crtc, fb->pitches[0]); linear_offset -= sprsurf_offset; -if (intel_plane->rotation ==BIT (DRM_ROTATE_180 )) { +if (dplane->state->rotation ==BIT (DRM_ROTATE_180 )) { sprctl |=SP_ROTATE_180 ; x += src_w;@@ -684,7 +684,7 @@ ivb_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, pixel_size, fb->pitches[0]); linear_offset -= sprsurf_offset; -if (intel_plane->rotation ==BIT (DRM_ROTATE_180 )) { +if (plane->state->rotation ==BIT (DRM_ROTATE_180 )) { sprctl |=SPRITE_ROTATE_180 ;/* HSW and BDW does this automagically in hardware */ @@ -884,7 +884,7 @@ ilk_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, pixel_size, fb->pitches[0]); linear_offset -= dvssurf_offset; -if (intel_plane->rotation ==BIT (DRM_ROTATE_180 )) { +if (plane->state->rotation ==BIT (DRM_ROTATE_180 )) { dvscntr |=DVS_ROTATE_180 ; x += src_w;@@ -1125,7 +1125,7 @@ intel_check_sprite_plane(struct drm_plane *plane, min_scale = intel_plane->can_scale ?1 : (1 <<16 );drm_rect_rotate (src, fb->width <<16 , fb->height <<16 , - intel_plane->rotation); + state->base.rotation); hscale =drm_rect_calc_hscale_relaxed (src, dst, min_scale, max_scale);BUG_ON (hscale <0 );@@ -1166,7 +1166,7 @@ intel_check_sprite_plane(struct drm_plane *plane, drm_rect_height(dst) * vscale - drm_rect_height(src));drm_rect_rotate_inv (src, fb->width <<16 , fb->height <<16 , - intel_plane->rotation); + state->base.rotation);/* sanity check to make sure the src viewport wasn't enlarged */ WARN_ON(src->x1 < (int) state->base.src_x ||@@ -1367,7 +1367,6 @@ int intel_plane_set_property(struct drm_plane *plane, uint64_t val) {struct drm_device *dev = plane->dev; -struct intel_plane *intel_plane =to_intel_plane (plane);uint64_t old_val;int ret = -ENOENT ;@@ -1376,14 +1375,14 @@ int intel_plane_set_property(struct drm_plane *plane,if (hweight32 (val &0xf ) !=1 )return -EINVAL ; -if (intel_plane->rotation == val) +if (plane->state->rotation == val)return 0 ; - old_val = intel_plane->rotation; - intel_plane->rotation = val; + old_val = plane->state->rotation; + plane->state->rotation = val; ret =intel_plane_restore (plane);if (ret) - intel_plane->rotation = old_val; + plane->state->rotation = old_val; }return ret;@@ -1457,6 +1456,7 @@ int intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane) { struct intel_plane *intel_plane; +struct intel_plane_state *state;unsigned long possible_crtcs;const uint32_t *plane_formats;int num_plane_formats;@@ -1469,12 +1469,12 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane)if (!intel_plane)return -ENOMEM ; - intel_plane->base.state = -intel_plane_duplicate_state (&intel_plane->base); -if (intel_plane->base.state ==NULL ) { + state =intel_create_plane_state (&intel_plane->base); +if (!state) {kfree (intel_plane);return -ENOMEM ; } + intel_plane->base.state = &state->base;switch (INTEL_INFO (dev)->gen) {case 5 :@@ -1545,7 +1545,6 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane) intel_plane->pipe = pipe; intel_plane->plane = plane; - intel_plane->rotation =BIT (DRM_ROTATE_0 ); intel_plane->check_plane = intel_check_sprite_plane; intel_plane->commit_plane = intel_commit_sprite_plane; possible_crtcs = (1 << pipe);
drivers/gpu/drm/i915/intel_sprite.c intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane) · line 1572
Quoted 8 lines
drivers/gpu/drm/i915/intel_sprite.c +1
-1@@ -1567,7 +1566,7 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane)if (dev->mode_config.rotation_property)drm_object_attach_property (&intel_plane->base.base, dev->mode_config.rotation_property, - intel_plane->rotation); + state->base.rotation);drm_plane_helper_add (&intel_plane->base, &intel_plane_helper_funcs);
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/10 drm/i915: Consolidate plane handler vtables
In reply to Matt RoperAll of the previous refactoring/consolidation of plane code has resulted in intel_primary_plane_funcs, intel_cursor_plane_funcs, and intel_sprite_plane_funcs being identical. Replace all of these with a single 'intel_plane_funcs' vtable for simplicity.
--- drivers/gpu/drm/i915/intel_display.c | 15 +++------------ drivers/gpu/drm/i915/intel_drv.h | 1 + drivers/gpu/drm/i915/intel_sprite.c | 11 +---------- 3 files changed, 5 insertions(+), 22 deletions(-)
drivers/gpu/drm/i915/intel_display.c +3 -12
@@ -12049,7 +12049,7 @@ void intel_plane_destroy(struct drm_plane *plane)kfree (intel_plane); } -static const struct drm_plane_funcs intel_primary_plane_funcs = { +const struct drm_plane_funcs intel_plane_funcs = { .update_plane = drm_plane_helper_update, .disable_plane = drm_plane_helper_disable, .destroy = intel_plane_destroy,
@@ -12096,7 +12096,7 @@ static struct drm_plane *intel_primary_plane_create(struct drm_device *dev, }drm_universal_plane_init (dev, &primary->base,0 , - &intel_primary_plane_funcs, + &intel_plane_funcs, intel_primary_formats, num_formats,DRM_PLANE_TYPE_PRIMARY );
@@ -12224,15 +12224,6 @@ update:intel_crtc_update_cursor (crtc, state->visible); } -static const struct drm_plane_funcs intel_cursor_plane_funcs = { - .update_plane = drm_plane_helper_update, - .disable_plane = drm_plane_helper_disable, - .destroy = intel_plane_destroy, - .set_property = intel_plane_set_property, - .atomic_duplicate_state = intel_plane_duplicate_state, - .atomic_destroy_state = intel_plane_destroy_state, -}; -static struct drm_plane *intel_cursor_plane_create (struct drm_device *dev,int pipe) {
@@ -12258,7 +12249,7 @@ static struct drm_plane *intel_cursor_plane_create(struct drm_device *dev, cursor->commit_plane = intel_commit_cursor_plane;drm_universal_plane_init (dev, &cursor->base,0 , - &intel_cursor_plane_funcs, + &intel_plane_funcs, intel_cursor_formats,ARRAY_SIZE (intel_cursor_formats),DRM_PLANE_TYPE_CURSOR );
drivers/gpu/drm/i915/intel_drv.h +1 -0
@@ -890,6 +890,7 @@ void i915_audio_component_init(struct drm_i915_private *dev_priv);void i915_audio_component_cleanup (struct drm_i915_private *dev_priv);/* intel_display.c */ +extern const struct drm_plane_funcs intel_plane_funcs;bool intel_has_pending_fb_unpin (struct drm_device *dev);int intel_pch_rawclk (struct drm_device *dev);void intel_mark_busy (struct drm_device *dev);
drivers/gpu/drm/i915/intel_sprite.c +1 -10
@@ -1400,15 +1400,6 @@ int intel_plane_restore(struct drm_plane *plane) plane->state->src_w, plane->state->src_h); } -static const struct drm_plane_funcs intel_sprite_plane_funcs = { - .update_plane = drm_plane_helper_update, - .disable_plane = drm_plane_helper_disable, - .destroy = intel_plane_destroy, - .set_property = intel_plane_set_property, - .atomic_duplicate_state = intel_plane_duplicate_state, - .atomic_destroy_state = intel_plane_destroy_state, -}; -static uint32_t ilk_plane_formats[] = {DRM_FORMAT_XRGB8888 ,DRM_FORMAT_YUYV ,
@@ -1549,7 +1540,7 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane) intel_plane->commit_plane = intel_commit_sprite_plane; possible_crtcs = (1 << pipe); ret =drm_universal_plane_init (dev, &intel_plane->base, possible_crtcs, - &intel_sprite_plane_funcs, + &intel_plane_funcs, plane_formats, num_plane_formats,DRM_PLANE_TYPE_OVERLAY );if (ret) {
Signature · 6 lines
1.8.5.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/10 drm/i915: Add .atomic_{get, set}_property() entrypoints to planes
In reply to Matt RoperWhen we flip on the DRIVER_ATOMIC bit, the DRM core will start calling this entrypoint to set and lookup driver-specific plane property values, rather than maintaining a shadow copy in object->properties.
Note that although we add these functions to the plane vtable, they will not yet be called. Future patches that switch our .set_property() handler and/or enable full atomic functionality are required before these code paths will be executed.
--- drivers/gpu/drm/i915/intel_atomic_plane.c | 58 +++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_display.c | 2 ++ drivers/gpu/drm/i915/intel_drv.h | 8 +++++ 3 files changed, 68 insertions(+)
drivers/gpu/drm/i915/intel_atomic_plane.c +58 -0
@@ -177,3 +177,61 @@ const struct drm_plane_helper_funcs intel_plane_helper_funcs = { .atomic_update = intel_plane_atomic_update, }; +/** +* intel_plane_atomic_get_property - fetch plane property value +* @plane: plane to fetch property for +* @state: state containing the property value +* @property: property to look up +* @val: pointer to write property value into +* +* The DRM core does not store shadow copies of properties for +* atomic-capable drivers. This entrypoint is used to fetch +* the current value of a driver-specific plane property. +*/ +int +intel_plane_atomic_get_property (struct drm_plane *plane, +const struct drm_plane_state *state, +struct drm_property *property, +uint64_t *val) +{ +struct drm_mode_config *config = &plane->dev->mode_config; + +if (property == config->rotation_property) { + *val = state->rotation; + }else { +DRM_DEBUG_KMS ("Unknown plane property '%s'\n" , property->name); +return -EINVAL ; + } + +return 0 ; +} + +/** +* intel_plane_atomic_set_property - set plane property value +* @plane: plane to set property for +* @state: state to update property value in +* @property: property to set +* @val: value to set property to +* +* Writes the specified property value for a plane into the provided atomic +* state object. +* +* Returns 0 on success, -EINVAL on unrecognized properties +*/ +int +intel_plane_atomic_set_property (struct drm_plane *plane, +struct drm_plane_state *state, +struct drm_property *property, +uint64_t val) +{ +struct drm_mode_config *config = &plane->dev->mode_config; + +if (property == config->rotation_property) { + state->rotation = val; + }else { +DRM_DEBUG_KMS ("Unknown plane property '%s'\n" , property->name); +return -EINVAL ; + } + +return 0 ; +}
drivers/gpu/drm/i915/intel_display.c +2 -0
@@ -12054,6 +12054,8 @@ const struct drm_plane_funcs intel_plane_funcs = { .disable_plane = drm_plane_helper_disable, .destroy = intel_plane_destroy, .set_property = intel_plane_set_property, + .atomic_get_property = intel_plane_atomic_get_property, + .atomic_set_property = intel_plane_atomic_set_property, .atomic_duplicate_state = intel_plane_duplicate_state, .atomic_destroy_state = intel_plane_destroy_state,
drivers/gpu/drm/i915/intel_drv.h +8 -0
@@ -945,6 +945,14 @@ int intel_prepare_plane_fb(struct drm_plane *plane, struct drm_framebuffer *fb);void intel_cleanup_plane_fb (struct drm_plane *plane,struct drm_framebuffer *fb); +int intel_plane_atomic_get_property (struct drm_plane *plane, +const struct drm_plane_state *state, +struct drm_property *property, +uint64_t *val); +int intel_plane_atomic_set_property (struct drm_plane *plane, +struct drm_plane_state *state, +struct drm_property *property, +uint64_t val);/* shared dpll functions */ struct intel_shared_dpll *intel_crtc_to_shared_dpll (struct intel_crtc *crtc);
Signature · 6 lines
1.8.5.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 04/10] drm/i915: Add .atomic_{get, set}_property() entrypoints to planes
Quoted 105 lines · Matt Roper
When we flip on the
DRIVER_ATOMICbit, the DRM core will start calling this entrypoint to set and lookup driver-specific plane property values, rather than maintaining a shadow copy inobject->properties.Note that although we add these functions to the plane vtable, they will not yet be called. Future patches that switch our .set_property() handler and/or enable full atomic functionality are required before these code paths will be executed.
Signed-off-by Matt Roper <[email protected]>--- drivers/gpu/drm/i915/intel_atomic_plane.c | 58 +++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_display.c | 2 ++ drivers/gpu/drm/i915/intel_drv.h | 8 +++++ 3 files changed, 68 insertions(+)drivers/gpu/drm/i915/intel_atomic_plane.c +58
-0@@ -177,3 +177,61 @@ const struct drm_plane_helper_funcs intel_plane_helper_funcs = { .atomic_update = intel_plane_atomic_update, }; +/** +* intel_plane_atomic_get_property - fetch plane property value +* @plane: plane to fetch property for +* @state: state containing the property value +* @property: property to look up +* @val: pointer to write property value into +* +* The DRM core does not store shadow copies of properties for +* atomic-capable drivers. This entrypoint is used to fetch +* the current value of a driver-specific plane property. +*/ +int +intel_plane_atomic_get_property (struct drm_plane *plane, +const struct drm_plane_state *state, +struct drm_property *property, +uint64_t *val) +{ +struct drm_mode_config *config = &plane->dev->mode_config; + +if (property == config->rotation_property) { + *val = state->rotation; + }else { +DRM_DEBUG_KMS ("Unknown plane property '%s'\n" , property->name); +return -EINVAL ; + } + +return 0 ; +} + +/** +* intel_plane_atomic_set_property - set plane property value +* @plane: plane to set property for +* @state: state to update property value in +* @property: property to set +* @val: value to set property to +* +* Writes the specified property value for a plane into the provided atomic +* state object. +* +* Returns 0 on success, -EINVAL on unrecognized properties +*/ +int +intel_plane_atomic_set_property (struct drm_plane *plane, +struct drm_plane_state *state, +struct drm_property *property, +uint64_t val) +{ +struct drm_mode_config *config = &plane->dev->mode_config; + +if (property == config->rotation_property) { + state->rotation = val; + }else { +DRM_DEBUG_KMS ("Unknown plane property '%s'\n" , property->name); +return -EINVAL ; + } + +return 0 ; +}drivers/gpu/drm/i915/intel_display.c +2
-0@@ -12054,6 +12054,8 @@ const struct drm_plane_funcs intel_plane_funcs = { .disable_plane = drm_plane_helper_disable, .destroy = intel_plane_destroy, .set_property = intel_plane_set_property, + .atomic_get_property = intel_plane_atomic_get_property, + .atomic_set_property = intel_plane_atomic_set_property, .atomic_duplicate_state = intel_plane_duplicate_state, .atomic_destroy_state = intel_plane_destroy_state,drivers/gpu/drm/i915/intel_drv.h +1
-0@@ -945,6 +945,14 @@ int intel_prepare_plane_fb(struct drm_plane *plane, struct drm_framebuffer *fb);void intel_cleanup_plane_fb (struct drm_plane *plane,struct drm_framebuffer *fb); +int intel_plane_atomic_get_property(struct drm_plane *plane,
drivers/gpu/drm/i915/intel_drv.h int intel_prepare_plane_fb(struct drm_plane *plane, · line 958
Quoted 10 lines
drivers/gpu/drm/i915/intel_drv.h +7
-0+const struct drm_plane_state *state, + struct drm_property *property, + uint64_t *val); +int intel_plane_atomic_set_property (struct drm_plane *plane, +struct drm_plane_state *state, +struct drm_property *property, +uint64_t val);/* shared dpll functions */ struct intel_shared_dpll *intel_crtc_to_shared_dpll (struct intel_crtc *crtc);
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 5/10 drm/i915: Add main atomic entrypoints (v2)
In reply to Matt RoperAdd the top-level atomic entrypoints for check/commit. These won't get called yet; we still need to either enable the atomic ioctl or switch to using the non-transitional atomic helpers for legacy operations.
v2:
- Use plane->pipe rather than plane->possible_crtcs while ensuring that only a single CRTC is in use. Either way will work fine since i915 drm_plane's are always tied to a single CRTC, but plane->pipe is slightly more intuitive. (Ander)
- Simplify crtc/connector checking logic. (Ander)
--- drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/intel_atomic.c | 164 +++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_display.c | 2 + drivers/gpu/drm/i915/intel_drv.h | 7 ++ 4 files changed, 174 insertions(+) create mode 100644 drivers/gpu/drm/i915/intel_atomic.c
drivers/gpu/drm/i915/Makefile +1 -0
@@ -66,6 +66,7 @@ i915-y += dvo_ch7017.o \ dvo_ns2501.o \ dvo_sil164.o \ dvo_tfp410.o \ + intel_atomic.o \ intel_atomic_plane.o \ intel_crt.o \ intel_ddi.o \
drivers/gpu/drm/i915/intel_atomic.c new file +164 -0
164 lines not on this page · raw message
drivers/gpu/drm/i915/intel_display.c +2 -0
@@ -12752,6 +12752,8 @@ static inline void intel_fbdev_output_poll_changed(struct drm_device *dev)static const struct drm_mode_config_funcs intel_mode_funcs = { .fb_create = intel_user_framebuffer_create, .output_poll_changed = intel_fbdev_output_poll_changed, + .atomic_check = intel_atomic_check, + .atomic_commit = intel_atomic_commit, };/* Set up chip specific display functions */
drivers/gpu/drm/i915/intel_drv.h +7 -0
@@ -1244,6 +1244,13 @@ void intel_pre_disable_primary(struct drm_crtc *crtc);void intel_tv_init (struct drm_device *dev);/* intel_atomic.c */ +int intel_atomic_check (struct drm_device *dev, +struct drm_atomic_state *state); +int intel_atomic_commit (struct drm_device *dev, +struct drm_atomic_state *state, +bool async); + +/* intel_atomic_plane.c */ struct intel_plane_state *intel_create_plane_state (struct drm_plane *plane);struct drm_plane_state *intel_plane_duplicate_state (struct drm_plane *plane); void intel_plane_destroy_state(struct drm_plane *plane,
Signature · 6 lines
1.8.5.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 05/10] drm/i915: Add main atomic entrypoints (v2)
Quoted 187 lines · Matt Roper
Add the top-level atomic entrypoints for check/commit. These won't get called yet; we still need to either enable the atomic ioctl or switch to using the non-transitional atomic helpers for legacy operations.
v2:
- Useplane->piperather thanplane->possible_crtcswhile ensuring that only a single CRTC is in use. Either way will work fine since i915 drm_plane's are always tied to a single CRTC, butplane->pipeis slightly more intuitive. (Ander)
- Simplify crtc/connector checking logic. (Ander)Signed-off-by Matt Roper <[email protected]>--- drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/intel_atomic.c | 164 +++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_display.c | 2 + drivers/gpu/drm/i915/intel_drv.h | 7 ++ 4 files changed, 174 insertions(+)create mode 100644
drivers/gpu/drm/i915/intel_atomic.cdrivers/gpu/drm/i915/Makefile +1
-0@@ -66,6 +66,7 @@ i915-y += dvo_ch7017.o \ dvo_ns2501.o \ dvo_sil164.o \ dvo_tfp410.o \ + intel_atomic.o \ intel_atomic_plane.o \ intel_crt.o \ intel_ddi.o \drivers/gpu/drm/i915/intel_atomic.c new file +149
-0@@ -0,0 +1,164 @@ +/* +* Copyright © 2015 Intel Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice (including the next +* paragraph) shall be included in all copies or substantial portions of the +* Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +*/ + +/** +* DOC: atomic modeset support +* +* The functions here implement the state management and hardware programming +* dispatch required by the atomic modeset infrastructure. +* See intel_atomic_plane.c for the plane-specific atomic functionality. +*/ + +#include <drm/drmP.h> +#include <drm/drm_atomic.h> +#include <drm/drm_atomic_helper.h> +#include <drm/drm_plane_helper.h> +#include "intel_drv.h" + + +/** +* intel_atomic_check - validate state object +* @dev: drm device +* @state: state to validate +*/ +int intel_atomic_check (struct drm_device *dev, +struct drm_atomic_state *state) +{ +int nplanes = dev->mode_config.num_total_plane; +int ncrtcs = dev->mode_config.num_crtc; +int nconnectors = dev->mode_config.num_connector; +enum pipe nuclear_pipe =INVALID_PIPE ; +int ret; +int i; +bool not_nuclear = false; + +/* +* FIXME: At the moment, we only support "nuclear pageflip" on a +* single CRTC. Cross-crtc updates will be added later. +*/ +for (i =0 ; i < nplanes; i++) { +struct intel_plane *plane =to_intel_plane (state->planes[i]); +if (!plane) +continue ; + +if (nuclear_pipe ==INVALID_PIPE ) { + nuclear_pipe = plane->pipe; + }else if (nuclear_pipe != plane->pipe) { +DRM_DEBUG_KMS ("i915 only support atomic plane operations on a single CRTC at the moment\n" ); +return -EINVAL ; + } + } + +/* +* FIXME: We only handle planes for now; make sure there are no CRTC's +* or connectors involved. +*/ + state->allow_modeset = false; +for (i =0 ; i < ncrtcs; i++) { +struct intel_crtc *crtc =to_intel_crtc (state->crtcs[i]); +if (crtc && crtc->pipe != nuclear_pipe) + not_nuclear = true; + } +for (i =0 ; i < nconnectors; i++) +if (state->connectors[i] !=NULL ) + not_nuclear = true; + +if (not_nuclear) { +DRM_DEBUG_KMS ("i915 only supports atomic plane operations at the moment\n" ); +return -EINVAL ; + } + + ret =drm_atomic_helper_check_planes (dev, state); +if (ret) +return ret; + +return ret; +} + + +/** +* intel_atomic_commit - commit validated state object +* @dev: DRM device +* @state: the top-level driver state object +* @async: asynchronous commit +* +* This function commits a top-level state object that has been validated +* with drm_atomic_helper_check(). +* +* FIXME: Atomic modeset support for i915 is not yet complete. At the moment +* we can only handle plane-related operations and do not yet support +* asynchronous commit. +* +* RETURNS +* Zero for success or -errno. +*/ +int intel_atomic_commit (struct drm_device *dev, +struct drm_atomic_state *state, +bool async) +{ +int ret; +int i; + +if (async) { +DRM_DEBUG_KMS ("i915 does not yet support async commit\n" ); +return -EINVAL ; + } + + ret =drm_atomic_helper_prepare_planes (dev, state); +if (ret) +return ret; + +/* Point of no return */ + +/* +* FIXME: The proper sequence here will eventually be: +* +* drm_atomic_helper_swap_state(dev, state) +* drm_atomic_helper_commit_pre_planes(dev, state); +* drm_atomic_helper_commit_planes(dev, state); +* drm_atomic_helper_commit_post_planes(dev, state); +* drm_atomic_helper_wait_for_vblanks(dev, state); +* drm_atomic_helper_cleanup_planes(dev, state); +* drm_atomic_state_free(state); +* +* once we have full atomic modeset. For now, just manually update +* plane states to avoid clobbering good states with dummy states +* while nuclear pageflipping. +*/ +for (i =0 ; i < dev->mode_config.num_total_plane; i++) { +struct drm_plane *plane = state->planes[i];
drivers/gpu/drm/i915/intel_atomic.c line 159
Quoted 10 lines
drivers/gpu/drm/i915/intel_atomic.c new file +10
-0+ +if (!plane) +continue ; + + plane->state->state = state; +swap (state->plane_states[i], plane->state); + plane->state->state =NULL ; + } +drm_atomic_helper_commit_planes (dev, state); +drm_atomic_helper_wait_for_vblanks (dev, state);
Isn't it possible that we wait for two vblanks here? One in intel_finish_crtc_commit() and then again in drm_atomic_helper_wait_for_vblanks().
That would happen when disabling planes, or enabling the primary plane in BDW. The former will be solved by fixing the watermark code and, if I understand correctly, the wait in drm_atomic_helper_wait_for_vblanks() will always cover the BDW case. So I guess we can leave it this way for now, and fix this with a follow up patch once we're completely atomic.
Quoted 27 lines
drivers/gpu/drm/i915/intel_atomic.c new file +5
-0+drm_atomic_helper_cleanup_planes (dev, state); +drm_atomic_state_free (state); + +return 0 ; +}drivers/gpu/drm/i915/intel_display.c +2
-0@@ -12752,6 +12752,8 @@ static inline void intel_fbdev_output_poll_changed(struct drm_device *dev)static const struct drm_mode_config_funcs intel_mode_funcs = { .fb_create = intel_user_framebuffer_create, .output_poll_changed = intel_fbdev_output_poll_changed, + .atomic_check = intel_atomic_check, + .atomic_commit = intel_atomic_commit, };/* Set up chip specific display functions */ drivers/gpu/drm/i915/intel_drv.h +0
-0@@ -1244,6 +1244,13 @@ void intel_pre_disable_primary(struct drm_crtc *crtc);void intel_tv_init (struct drm_device *dev);/* intel_atomic.c */
drivers/gpu/drm/i915/intel_drv.h void intel_pre_disable_primary(struct drm_crtc *crtc); · line 1256
Quoted 10 lines
drivers/gpu/drm/i915/intel_drv.h +7
-0+int intel_atomic_check (struct drm_device *dev, +struct drm_atomic_state *state); +int intel_atomic_commit (struct drm_device *dev, +struct drm_atomic_state *state, +bool async); + +/* intel_atomic_plane.c */ struct intel_plane_state *intel_create_plane_state (struct drm_plane *plane);struct drm_plane_state *intel_plane_duplicate_state (struct drm_plane *plane); void intel_plane_destroy_state(struct drm_plane *plane,
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 6/10 drm/i915: Setup dummy atomic state for connectors (v2)
In reply to Matt RoperWe want to enable/test plane updates via the atomic interface, but as soon as we flip DRIVER_ATOMIC on, the DRM core will take some atomic codepaths to lookup properties during drmModeGetConnector() and some of those codepaths unconditionally dereference connector->state (specifically when looking up the CRTC ID property in drm_atomic_connector_get_property()). Create a dummy connector state for each connector at init time to ensure the DRM core doesn't try to dereference a NULL connector->state. The actual connector properties will never be updated or contain useful information, but since we're doing this specifically for testing/debug of the plane operations (and only when a specific kernel module option is given), that shouldn't really matter.
Once we start creating connector states, the DRM core will want to be able to clean them up for us. We also need to hook up the destruction entrypoint to the core's helper.
v2: Squash in the patch to set the state destruction hook (Ander & Bob)
--- drivers/gpu/drm/i915/intel_crt.c | 2 ++ drivers/gpu/drm/i915/intel_display.c | 28 ++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_dp.c | 2 ++ drivers/gpu/drm/i915/intel_dp_mst.c | 2 ++ drivers/gpu/drm/i915/intel_dsi.c | 2 ++ drivers/gpu/drm/i915/intel_dvo.c | 2 ++ drivers/gpu/drm/i915/intel_hdmi.c | 2 ++ drivers/gpu/drm/i915/intel_lvds.c | 2 ++ drivers/gpu/drm/i915/intel_sdvo.c | 2 ++ drivers/gpu/drm/i915/intel_tv.c | 2 ++ 10 files changed, 46 insertions(+)
drivers/gpu/drm/i915/intel_crt.c +2 -0
@@ -28,6 +28,7 @@#include <linux/i2c.h> #include <linux/slab.h> #include <drm/drmP.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_edid.h>
@@ -792,6 +793,7 @@ static const struct drm_connector_funcs intel_crt_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .destroy = intel_crt_destroy, .set_property = intel_crt_set_property, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };static const struct drm_connector_helper_funcs intel_crt_connector_helper_funcs = {
drivers/gpu/drm/i915/intel_display.c +28 -0
@@ -12439,6 +12439,7 @@ static void intel_setup_outputs(struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private;struct intel_encoder *encoder; +struct drm_connector *connector;bool dpd_is_edp = false;intel_lvds_init (dev);
@@ -12569,6 +12570,33 @@ static void intel_setup_outputs(struct drm_device *dev)if (SUPPORTS_TV (dev))intel_tv_init (dev); +/* +* FIXME: We don't have full atomic support yet, but we want to be +* able to enable/test plane updates via the atomic interface in the +* meantime. However as soon as we flip DRIVER_ATOMIC on, the DRM core +* will take some atomic codepaths to lookup properties during +* drmModeGetConnector() that unconditionally dereference +* connector->state. +* +* We create a dummy connector state here for each connector to ensure +* the DRM core doesn't try to dereference a NULL connector->state. +* The actual connector properties will never be updated or contain +* useful information, but since we're doing this specifically for +* testing/debug of the plane operations (and only when a specific +* kernel module option is given), that shouldn't really matter. +* +* Once atomic support for crtc's + connectors lands, this loop should +* be removed since we'll be setting up real connector state, which +* will contain Intel-specific properties. +*/ +list_for_each_entry (connector, + &dev->mode_config.connector_list, + head) { +if (!WARN_ON (connector->state)) + connector->state =kzalloc (sizeof (*connector->state), +GFP_KERNEL ); + } +intel_psr_init (dev);for_each_intel_encoder (dev, encoder) {
drivers/gpu/drm/i915/intel_dp.c +2 -0
@@ -31,6 +31,7 @@#include <linux/notifier.h> #include <linux/reboot.h> #include <drm/drmP.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_edid.h>
@@ -4402,6 +4403,7 @@ static const struct drm_connector_funcs intel_dp_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_dp_set_property, .destroy = intel_dp_connector_destroy, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };static const struct drm_connector_helper_funcs intel_dp_connector_helper_funcs = {
drivers/gpu/drm/i915/intel_dp_mst.c +2 -0
@@ -26,6 +26,7 @@#include <drm/drmP.h> #include "i915_drv.h" #include "intel_drv.h" +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_edid.h>
@@ -314,6 +315,7 @@ static const struct drm_connector_funcs intel_dp_mst_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_dp_mst_set_property, .destroy = intel_dp_mst_connector_destroy, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };static int intel_dp_mst_get_modes (struct drm_connector *connector)
drivers/gpu/drm/i915/intel_dsi.c +2 -0
@@ -24,6 +24,7 @@*/ #include <drm/drmP.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc.h> #include <drm/drm_edid.h> #include <drm/i915_drm.h>
@@ -791,6 +792,7 @@ static const struct drm_connector_funcs intel_dsi_connector_funcs = { .detect = intel_dsi_detect, .destroy = intel_dsi_destroy, .fill_modes = drm_helper_probe_single_connector_modes, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };void intel_dsi_init (struct drm_device *dev)
drivers/gpu/drm/i915/intel_dvo.c +2 -0
@@ -27,6 +27,7 @@#include <linux/i2c.h> #include <linux/slab.h> #include <drm/drmP.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc.h> #include "intel_drv.h" #include <drm/i915_drm.h>
@@ -390,6 +391,7 @@ static const struct drm_connector_funcs intel_dvo_connector_funcs = { .detect = intel_dvo_detect, .destroy = intel_dvo_destroy, .fill_modes = drm_helper_probe_single_connector_modes, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };static const struct drm_connector_helper_funcs intel_dvo_connector_helper_funcs = {
drivers/gpu/drm/i915/intel_hdmi.c +2 -0
@@ -31,6 +31,7 @@#include <linux/delay.h> #include <linux/hdmi.h> #include <drm/drmP.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc.h> #include <drm/drm_edid.h> #include "intel_drv.h"
@@ -1615,6 +1616,7 @@ static const struct drm_connector_funcs intel_hdmi_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_hdmi_set_property, .destroy = intel_hdmi_destroy, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };static const struct drm_connector_helper_funcs intel_hdmi_connector_helper_funcs = {
drivers/gpu/drm/i915/intel_lvds.c +2 -0
@@ -32,6 +32,7 @@#include <linux/i2c.h> #include <linux/slab.h> #include <drm/drmP.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc.h> #include <drm/drm_edid.h> #include "intel_drv.h"
@@ -532,6 +533,7 @@ static const struct drm_connector_funcs intel_lvds_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_lvds_set_property, .destroy = intel_lvds_destroy, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };static const struct drm_encoder_funcs intel_lvds_enc_funcs = {
drivers/gpu/drm/i915/intel_sdvo.c +2 -0
@@ -30,6 +30,7 @@#include <linux/delay.h> #include <linux/export.h> #include <drm/drmP.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc.h> #include <drm/drm_edid.h> #include "intel_drv.h"
@@ -2191,6 +2192,7 @@ static const struct drm_connector_funcs intel_sdvo_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_sdvo_set_property, .destroy = intel_sdvo_destroy, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };static const struct drm_connector_helper_funcs intel_sdvo_connector_helper_funcs = {
drivers/gpu/drm/i915/intel_tv.c +2 -0
@@ -31,6 +31,7 @@*/ #include <drm/drmP.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc.h> #include <drm/drm_edid.h> #include "intel_drv.h"
@@ -1513,6 +1514,7 @@ static const struct drm_connector_funcs intel_tv_connector_funcs = { .destroy = intel_tv_destroy, .set_property = intel_tv_set_property, .fill_modes = drm_helper_probe_single_connector_modes, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };static const struct drm_connector_helper_funcs intel_tv_connector_helper_funcs = {
Signature · 6 lines
1.8.5.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 06/10] drm/i915: Setup dummy atomic state for connectors (v2)
Quoted 86 lines · Matt Roper
We want to enable/test plane updates via the atomic interface, but as soon as we flip
DRIVER_ATOMICon, the DRM core will take some atomic codepaths to lookup properties duringdrmModeGetConnector()and some of those codepaths unconditionally dereferenceconnector->state(specifically when looking up the CRTC ID property indrm_atomic_connector_get_property()). Create a dummy connector state for each connector at init time to ensure the DRM core doesn't try to dereference a NULLconnector->state. The actual connector properties will never be updated or contain useful information, but since we're doing this specifically for testing/debug of the plane operations (and only when a specific kernel module option is given), that shouldn't really matter.Once we start creating connector states, the DRM core will want to be able to clean them up for us. We also need to hook up the destruction entrypoint to the core's helper.
v2: Squash in the patch to set the state destruction hook (Ander & Bob)
Signed-off-by Matt Roper <[email protected]>--- drivers/gpu/drm/i915/intel_crt.c | 2 ++ drivers/gpu/drm/i915/intel_display.c | 28 ++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_dp.c | 2 ++ drivers/gpu/drm/i915/intel_dp_mst.c | 2 ++ drivers/gpu/drm/i915/intel_dsi.c | 2 ++ drivers/gpu/drm/i915/intel_dvo.c | 2 ++ drivers/gpu/drm/i915/intel_hdmi.c | 2 ++ drivers/gpu/drm/i915/intel_lvds.c | 2 ++ drivers/gpu/drm/i915/intel_sdvo.c | 2 ++ drivers/gpu/drm/i915/intel_tv.c | 2 ++ 10 files changed, 46 insertions(+)drivers/gpu/drm/i915/intel_crt.c +2
-0@@ -28,6 +28,7 @@#include <linux/i2c.h> #include <linux/slab.h> #include <drm/drmP.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_edid.h> @@ -792,6 +793,7 @@ static const struct drm_connector_funcs intel_crt_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .destroy = intel_crt_destroy, .set_property = intel_crt_set_property, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };static const struct drm_connector_helper_funcs intel_crt_connector_helper_funcs = {drivers/gpu/drm/i915/intel_display.c +18
-0@@ -12439,6 +12439,7 @@ static void intel_setup_outputs(struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private;struct intel_encoder *encoder; +struct drm_connector *connector;bool dpd_is_edp = false;intel_lvds_init (dev);@@ -12569,6 +12570,33 @@ static void intel_setup_outputs(struct drm_device *dev)if (SUPPORTS_TV (dev))intel_tv_init (dev); +/* +* FIXME: We don't have full atomic support yet, but we want to be +* able to enable/test plane updates via the atomic interface in the +* meantime. However as soon as we flip DRIVER_ATOMIC on, the DRM core +* will take some atomic codepaths to lookup properties during +* drmModeGetConnector() that unconditionally dereference +* connector->state. +* +* We create a dummy connector state here for each connector to ensure +* the DRM core doesn't try to dereference a NULL connector->state. +* The actual connector properties will never be updated or contain +* useful information, but since we're doing this specifically for +* testing/debug of the plane operations (and only when a specific +* kernel module option is given), that shouldn't really matter. +* +* Once atomic support for crtc's + connectors lands, this loop should +* be removed since we'll be setting up real connector state, which
drivers/gpu/drm/i915/intel_display.c static void intel_setup_outputs(struct drm_device *dev) · line 12599
Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +10
-0+* will contain Intel-specific properties. +*/ +list_for_each_entry (connector, + &dev->mode_config.connector_list, + head) { +if (!WARN_ON (connector->state)) + connector->state =kzalloc (sizeof (*connector->state), +GFP_KERNEL ); + } +
We need to at least protect this with a check for DRIVER_ATOMIC, otherwise the encoder field of the get connector ioctl response will always be NULL, even if i915.nuclear_pageflip is not set.
Ander
Quoted 157 lines
drivers/gpu/drm/i915/intel_display.c +0
-0intel_psr_init (dev);for_each_intel_encoder (dev, encoder) {drivers/gpu/drm/i915/intel_dp.c +2
-0@@ -31,6 +31,7 @@#include <linux/notifier.h> #include <linux/reboot.h> #include <drm/drmP.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_edid.h> @@ -4402,6 +4403,7 @@ static const struct drm_connector_funcs intel_dp_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_dp_set_property, .destroy = intel_dp_connector_destroy, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };static const struct drm_connector_helper_funcs intel_dp_connector_helper_funcs = {drivers/gpu/drm/i915/intel_dp_mst.c +2
-0@@ -26,6 +26,7 @@#include <drm/drmP.h> #include "i915_drv.h" #include "intel_drv.h" +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_edid.h> @@ -314,6 +315,7 @@ static const struct drm_connector_funcs intel_dp_mst_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_dp_mst_set_property, .destroy = intel_dp_mst_connector_destroy, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };static int intel_dp_mst_get_modes (struct drm_connector *connector)drivers/gpu/drm/i915/intel_dsi.c +2
-0@@ -24,6 +24,7 @@*/ #include <drm/drmP.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc.h> #include <drm/drm_edid.h> #include <drm/i915_drm.h> @@ -791,6 +792,7 @@ static const struct drm_connector_funcs intel_dsi_connector_funcs = { .detect = intel_dsi_detect, .destroy = intel_dsi_destroy, .fill_modes = drm_helper_probe_single_connector_modes, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };void intel_dsi_init (struct drm_device *dev)drivers/gpu/drm/i915/intel_dvo.c +2
-0@@ -27,6 +27,7 @@#include <linux/i2c.h> #include <linux/slab.h> #include <drm/drmP.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc.h> #include "intel_drv.h" #include <drm/i915_drm.h> @@ -390,6 +391,7 @@ static const struct drm_connector_funcs intel_dvo_connector_funcs = { .detect = intel_dvo_detect, .destroy = intel_dvo_destroy, .fill_modes = drm_helper_probe_single_connector_modes, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };static const struct drm_connector_helper_funcs intel_dvo_connector_helper_funcs = {drivers/gpu/drm/i915/intel_hdmi.c +2
-0@@ -31,6 +31,7 @@#include <linux/delay.h> #include <linux/hdmi.h> #include <drm/drmP.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc.h> #include <drm/drm_edid.h> #include "intel_drv.h" @@ -1615,6 +1616,7 @@ static const struct drm_connector_funcs intel_hdmi_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_hdmi_set_property, .destroy = intel_hdmi_destroy, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };static const struct drm_connector_helper_funcs intel_hdmi_connector_helper_funcs = {drivers/gpu/drm/i915/intel_lvds.c +2
-0@@ -32,6 +32,7 @@#include <linux/i2c.h> #include <linux/slab.h> #include <drm/drmP.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc.h> #include <drm/drm_edid.h> #include "intel_drv.h" @@ -532,6 +533,7 @@ static const struct drm_connector_funcs intel_lvds_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_lvds_set_property, .destroy = intel_lvds_destroy, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };static const struct drm_encoder_funcs intel_lvds_enc_funcs = {drivers/gpu/drm/i915/intel_sdvo.c +2
-0@@ -30,6 +30,7 @@#include <linux/delay.h> #include <linux/export.h> #include <drm/drmP.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc.h> #include <drm/drm_edid.h> #include "intel_drv.h" @@ -2191,6 +2192,7 @@ static const struct drm_connector_funcs intel_sdvo_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_sdvo_set_property, .destroy = intel_sdvo_destroy, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };static const struct drm_connector_helper_funcs intel_sdvo_connector_helper_funcs = {drivers/gpu/drm/i915/intel_tv.c +1
-0@@ -31,6 +31,7 @@*/ #include <drm/drmP.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc.h> #include <drm/drm_edid.h> #include "intel_drv.h"
drivers/gpu/drm/i915/intel_tv.c static const struct drm_connector_funcs intel_tv_connector_funcs = { · line 1520
Quoted 7 lines
drivers/gpu/drm/i915/intel_tv.c +1
-0@@ -1513,6 +1514,7 @@ static const struct drm_connector_funcs intel_tv_connector_funcs = { .destroy = intel_tv_destroy, .set_property = intel_tv_set_property, .fill_modes = drm_helper_probe_single_connector_modes, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };static const struct drm_connector_helper_funcs intel_tv_connector_helper_funcs = {
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 6/10 drm/i915: Setup dummy atomic state for connectors (v3)
We want to enable/test plane updates via the atomic interface, but as soon as we flip DRIVER_ATOMIC on, the DRM core will take some atomic codepaths to lookup properties during drmModeGetConnector() and some of those codepaths unconditionally dereference connector->state (specifically when looking up the CRTC ID property in drm_atomic_connector_get_property()). Create a dummy connector state for each connector at init time to ensure the DRM core doesn't try to dereference a NULL connector->state. The actual connector properties will never be updated or contain useful information, but since we're doing this specifically for testing/debug of the plane operations (and only when a specific kernel module option is given), that shouldn't really matter.
Once we start creating connector states, the DRM core will want to be able to clean them up for us. We also need to hook up the destruction entrypoint to the core's helper.
v2: Squash in the patch to set the state destruction hook (Ander & Bob)
v3: Only create dummy connector states when we're actually faking
atomic support. (Ander)
--- drivers/gpu/drm/i915/intel_crt.c | 2 ++ drivers/gpu/drm/i915/intel_display.c | 32 ++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_dp.c | 2 ++ drivers/gpu/drm/i915/intel_dp_mst.c | 2 ++ drivers/gpu/drm/i915/intel_dsi.c | 2 ++ drivers/gpu/drm/i915/intel_dvo.c | 2 ++ drivers/gpu/drm/i915/intel_hdmi.c | 2 ++ drivers/gpu/drm/i915/intel_lvds.c | 2 ++ drivers/gpu/drm/i915/intel_sdvo.c | 2 ++ drivers/gpu/drm/i915/intel_tv.c | 2 ++ 10 files changed, 50 insertions(+)
drivers/gpu/drm/i915/intel_crt.c +2 -0
@@ -28,6 +28,7 @@#include <linux/i2c.h> #include <linux/slab.h> #include <drm/drmP.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_edid.h>
@@ -792,6 +793,7 @@ static const struct drm_connector_funcs intel_crt_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .destroy = intel_crt_destroy, .set_property = intel_crt_set_property, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };static const struct drm_connector_helper_funcs intel_crt_connector_helper_funcs = {
drivers/gpu/drm/i915/intel_display.c +32 -0
@@ -12439,6 +12439,7 @@ static void intel_setup_outputs(struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private;struct intel_encoder *encoder; +struct drm_connector *connector;bool dpd_is_edp = false;intel_lvds_init (dev);
@@ -12569,6 +12570,37 @@ static void intel_setup_outputs(struct drm_device *dev)if (SUPPORTS_TV (dev))intel_tv_init (dev); +/* +* FIXME: We don't have full atomic support yet, but we want to be +* able to enable/test plane updates via the atomic interface in the +* meantime. However as soon as we flip DRIVER_ATOMIC on, the DRM core +* will take some atomic codepaths to lookup properties during +* drmModeGetConnector() that unconditionally dereference +* connector->state. +* +* We create a dummy connector state here for each connector to ensure +* the DRM core doesn't try to dereference a NULL connector->state. +* The actual connector properties will never be updated or contain +* useful information, but since we're doing this specifically for +* testing/debug of the plane operations (and only when a specific +* kernel module option is given), that shouldn't really matter. +* +* Once atomic support for crtc's + connectors lands, this loop should +* be removed since we'll be setting up real connector state, which +* will contain Intel-specific properties. +*/ +if (drm_core_check_feature (dev,DRIVER_ATOMIC )) { +list_for_each_entry (connector, + &dev->mode_config.connector_list, + head) { +if (!WARN_ON (connector->state)) { + connector->state = +kzalloc (sizeof (*connector->state), +GFP_KERNEL ); + } + } + } +intel_psr_init (dev);for_each_intel_encoder (dev, encoder) {
drivers/gpu/drm/i915/intel_dp.c +2 -0
@@ -31,6 +31,7 @@#include <linux/notifier.h> #include <linux/reboot.h> #include <drm/drmP.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_edid.h>
@@ -4402,6 +4403,7 @@ static const struct drm_connector_funcs intel_dp_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_dp_set_property, .destroy = intel_dp_connector_destroy, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };static const struct drm_connector_helper_funcs intel_dp_connector_helper_funcs = {
drivers/gpu/drm/i915/intel_dp_mst.c +2 -0
@@ -26,6 +26,7 @@#include <drm/drmP.h> #include "i915_drv.h" #include "intel_drv.h" +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_edid.h>
@@ -314,6 +315,7 @@ static const struct drm_connector_funcs intel_dp_mst_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_dp_mst_set_property, .destroy = intel_dp_mst_connector_destroy, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };static int intel_dp_mst_get_modes (struct drm_connector *connector)
drivers/gpu/drm/i915/intel_dsi.c +2 -0
@@ -24,6 +24,7 @@*/ #include <drm/drmP.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc.h> #include <drm/drm_edid.h> #include <drm/i915_drm.h>
@@ -791,6 +792,7 @@ static const struct drm_connector_funcs intel_dsi_connector_funcs = { .detect = intel_dsi_detect, .destroy = intel_dsi_destroy, .fill_modes = drm_helper_probe_single_connector_modes, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };void intel_dsi_init (struct drm_device *dev)
drivers/gpu/drm/i915/intel_dvo.c +2 -0
@@ -27,6 +27,7 @@#include <linux/i2c.h> #include <linux/slab.h> #include <drm/drmP.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc.h> #include "intel_drv.h" #include <drm/i915_drm.h>
@@ -390,6 +391,7 @@ static const struct drm_connector_funcs intel_dvo_connector_funcs = { .detect = intel_dvo_detect, .destroy = intel_dvo_destroy, .fill_modes = drm_helper_probe_single_connector_modes, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };static const struct drm_connector_helper_funcs intel_dvo_connector_helper_funcs = {
drivers/gpu/drm/i915/intel_hdmi.c +2 -0
@@ -31,6 +31,7 @@#include <linux/delay.h> #include <linux/hdmi.h> #include <drm/drmP.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc.h> #include <drm/drm_edid.h> #include "intel_drv.h"
@@ -1615,6 +1616,7 @@ static const struct drm_connector_funcs intel_hdmi_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_hdmi_set_property, .destroy = intel_hdmi_destroy, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };static const struct drm_connector_helper_funcs intel_hdmi_connector_helper_funcs = {
drivers/gpu/drm/i915/intel_lvds.c +2 -0
@@ -32,6 +32,7 @@#include <linux/i2c.h> #include <linux/slab.h> #include <drm/drmP.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc.h> #include <drm/drm_edid.h> #include "intel_drv.h"
@@ -532,6 +533,7 @@ static const struct drm_connector_funcs intel_lvds_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_lvds_set_property, .destroy = intel_lvds_destroy, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };static const struct drm_encoder_funcs intel_lvds_enc_funcs = {
drivers/gpu/drm/i915/intel_sdvo.c +2 -0
@@ -30,6 +30,7 @@#include <linux/delay.h> #include <linux/export.h> #include <drm/drmP.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc.h> #include <drm/drm_edid.h> #include "intel_drv.h"
@@ -2191,6 +2192,7 @@ static const struct drm_connector_funcs intel_sdvo_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_sdvo_set_property, .destroy = intel_sdvo_destroy, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };static const struct drm_connector_helper_funcs intel_sdvo_connector_helper_funcs = {
drivers/gpu/drm/i915/intel_tv.c +2 -0
@@ -31,6 +31,7 @@*/ #include <drm/drmP.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc.h> #include <drm/drm_edid.h> #include "intel_drv.h"
@@ -1513,6 +1514,7 @@ static const struct drm_connector_funcs intel_tv_connector_funcs = { .destroy = intel_tv_destroy, .set_property = intel_tv_set_property, .fill_modes = drm_helper_probe_single_connector_modes, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };static const struct drm_connector_helper_funcs intel_tv_connector_helper_funcs = {
Signature · 6 lines
1.8.5.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 06/10] drm/i915: Setup dummy atomic state for connectors (v3)
Quoted 260 lines · Matt Roper
We want to enable/test plane updates via the atomic interface, but as soon as we flip
DRIVER_ATOMICon, the DRM core will take some atomic codepaths to lookup properties duringdrmModeGetConnector()and some of those codepaths unconditionally dereferenceconnector->state(specifically when looking up the CRTC ID property indrm_atomic_connector_get_property()). Create a dummy connector state for each connector at init time to ensure the DRM core doesn't try to dereference a NULLconnector->state. The actual connector properties will never be updated or contain useful information, but since we're doing this specifically for testing/debug of the plane operations (and only when a specific kernel module option is given), that shouldn't really matter.Once we start creating connector states, the DRM core will want to be able to clean them up for us. We also need to hook up the destruction entrypoint to the core's helper.
v2: Squash in the patch to set the state destruction hook (Ander & Bob)
v3: Only create dummy connector states when we're actually faking
atomic support. (Ander)Signed-off-by Matt Roper <[email protected]>--- drivers/gpu/drm/i915/intel_crt.c | 2 ++ drivers/gpu/drm/i915/intel_display.c | 32 ++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_dp.c | 2 ++ drivers/gpu/drm/i915/intel_dp_mst.c | 2 ++ drivers/gpu/drm/i915/intel_dsi.c | 2 ++ drivers/gpu/drm/i915/intel_dvo.c | 2 ++ drivers/gpu/drm/i915/intel_hdmi.c | 2 ++ drivers/gpu/drm/i915/intel_lvds.c | 2 ++ drivers/gpu/drm/i915/intel_sdvo.c | 2 ++ drivers/gpu/drm/i915/intel_tv.c | 2 ++ 10 files changed, 50 insertions(+)drivers/gpu/drm/i915/intel_crt.c +2
-0@@ -28,6 +28,7 @@#include <linux/i2c.h> #include <linux/slab.h> #include <drm/drmP.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_edid.h> @@ -792,6 +793,7 @@ static const struct drm_connector_funcs intel_crt_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .destroy = intel_crt_destroy, .set_property = intel_crt_set_property, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };static const struct drm_connector_helper_funcs intel_crt_connector_helper_funcs = {drivers/gpu/drm/i915/intel_display.c +32
-0@@ -12439,6 +12439,7 @@ static void intel_setup_outputs(struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private;struct intel_encoder *encoder; +struct drm_connector *connector;bool dpd_is_edp = false;intel_lvds_init (dev);@@ -12569,6 +12570,37 @@ static void intel_setup_outputs(struct drm_device *dev)if (SUPPORTS_TV (dev))intel_tv_init (dev); +/* +* FIXME: We don't have full atomic support yet, but we want to be +* able to enable/test plane updates via the atomic interface in the +* meantime. However as soon as we flip DRIVER_ATOMIC on, the DRM core +* will take some atomic codepaths to lookup properties during +* drmModeGetConnector() that unconditionally dereference +* connector->state. +* +* We create a dummy connector state here for each connector to ensure +* the DRM core doesn't try to dereference a NULL connector->state. +* The actual connector properties will never be updated or contain +* useful information, but since we're doing this specifically for +* testing/debug of the plane operations (and only when a specific +* kernel module option is given), that shouldn't really matter. +* +* Once atomic support for crtc's + connectors lands, this loop should +* be removed since we'll be setting up real connector state, which +* will contain Intel-specific properties. +*/ +if (drm_core_check_feature (dev,DRIVER_ATOMIC )) { +list_for_each_entry (connector, + &dev->mode_config.connector_list, + head) { +if (!WARN_ON (connector->state)) { + connector->state = +kzalloc (sizeof (*connector->state), +GFP_KERNEL ); + } + } + } +intel_psr_init (dev);for_each_intel_encoder (dev, encoder) {drivers/gpu/drm/i915/intel_dp.c +2
-0@@ -31,6 +31,7 @@#include <linux/notifier.h> #include <linux/reboot.h> #include <drm/drmP.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_edid.h> @@ -4402,6 +4403,7 @@ static const struct drm_connector_funcs intel_dp_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_dp_set_property, .destroy = intel_dp_connector_destroy, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };static const struct drm_connector_helper_funcs intel_dp_connector_helper_funcs = {drivers/gpu/drm/i915/intel_dp_mst.c +2
-0@@ -26,6 +26,7 @@#include <drm/drmP.h> #include "i915_drv.h" #include "intel_drv.h" +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_edid.h> @@ -314,6 +315,7 @@ static const struct drm_connector_funcs intel_dp_mst_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_dp_mst_set_property, .destroy = intel_dp_mst_connector_destroy, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };static int intel_dp_mst_get_modes (struct drm_connector *connector)drivers/gpu/drm/i915/intel_dsi.c +2
-0@@ -24,6 +24,7 @@*/ #include <drm/drmP.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc.h> #include <drm/drm_edid.h> #include <drm/i915_drm.h> @@ -791,6 +792,7 @@ static const struct drm_connector_funcs intel_dsi_connector_funcs = { .detect = intel_dsi_detect, .destroy = intel_dsi_destroy, .fill_modes = drm_helper_probe_single_connector_modes, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };void intel_dsi_init (struct drm_device *dev)drivers/gpu/drm/i915/intel_dvo.c +2
-0@@ -27,6 +27,7 @@#include <linux/i2c.h> #include <linux/slab.h> #include <drm/drmP.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc.h> #include "intel_drv.h" #include <drm/i915_drm.h> @@ -390,6 +391,7 @@ static const struct drm_connector_funcs intel_dvo_connector_funcs = { .detect = intel_dvo_detect, .destroy = intel_dvo_destroy, .fill_modes = drm_helper_probe_single_connector_modes, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };static const struct drm_connector_helper_funcs intel_dvo_connector_helper_funcs = {drivers/gpu/drm/i915/intel_hdmi.c +2
-0@@ -31,6 +31,7 @@#include <linux/delay.h> #include <linux/hdmi.h> #include <drm/drmP.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc.h> #include <drm/drm_edid.h> #include "intel_drv.h" @@ -1615,6 +1616,7 @@ static const struct drm_connector_funcs intel_hdmi_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_hdmi_set_property, .destroy = intel_hdmi_destroy, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };static const struct drm_connector_helper_funcs intel_hdmi_connector_helper_funcs = {drivers/gpu/drm/i915/intel_lvds.c +2
-0@@ -32,6 +32,7 @@#include <linux/i2c.h> #include <linux/slab.h> #include <drm/drmP.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc.h> #include <drm/drm_edid.h> #include "intel_drv.h" @@ -532,6 +533,7 @@ static const struct drm_connector_funcs intel_lvds_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_lvds_set_property, .destroy = intel_lvds_destroy, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };static const struct drm_encoder_funcs intel_lvds_enc_funcs = {drivers/gpu/drm/i915/intel_sdvo.c +2
-0@@ -30,6 +30,7 @@#include <linux/delay.h> #include <linux/export.h> #include <drm/drmP.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc.h> #include <drm/drm_edid.h> #include "intel_drv.h" @@ -2191,6 +2192,7 @@ static const struct drm_connector_funcs intel_sdvo_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_sdvo_set_property, .destroy = intel_sdvo_destroy, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };static const struct drm_connector_helper_funcs intel_sdvo_connector_helper_funcs = {drivers/gpu/drm/i915/intel_tv.c +1
-0@@ -31,6 +31,7 @@*/ #include <drm/drmP.h> +#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc.h> #include <drm/drm_edid.h> #include "intel_drv.h"
drivers/gpu/drm/i915/intel_tv.c static const struct drm_connector_funcs intel_tv_connector_funcs = { · line 1520
Quoted 7 lines
drivers/gpu/drm/i915/intel_tv.c +1
-0@@ -1513,6 +1514,7 @@ static const struct drm_connector_funcs intel_tv_connector_funcs = { .destroy = intel_tv_destroy, .set_property = intel_tv_set_property, .fill_modes = drm_helper_probe_single_connector_modes, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };static const struct drm_connector_helper_funcs intel_tv_connector_helper_funcs = {
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 7/10 drm/i915: Add atomic_get_property entrypoint for connectors
In reply to Matt RoperEven though we only support atomic plane updates at the moment, we still need to add an .atomic_get_property() entrypoint for connectors before we allow the driver to flip on the DRIVER_ATOMIC bit. As soon as that bit gets set, the DRM core will start adding atomic connector properties (in addition to the plane properties we care about at the moment), so we need to be able to handle the new way the DRM core will interact with us.
For simplicity, we just lookup driver-specific connector properties in the usual shadow array maintained by the core. Once we get real atomic modeset support for crtc's and planes, this code should be re-written to pull the data out of crtc/connector state structures.
--- drivers/gpu/drm/i915/intel_atomic.c | 38 +++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_crt.c | 1 + drivers/gpu/drm/i915/intel_dp.c | 1 + drivers/gpu/drm/i915/intel_dp_mst.c | 1 + drivers/gpu/drm/i915/intel_drv.h | 4 ++++ drivers/gpu/drm/i915/intel_hdmi.c | 1 + drivers/gpu/drm/i915/intel_lvds.c | 1 + drivers/gpu/drm/i915/intel_sdvo.c | 1 + drivers/gpu/drm/i915/intel_tv.c | 1 + 9 files changed, 49 insertions(+)
drivers/gpu/drm/i915/intel_atomic.c +38 -0
@@ -162,3 +162,41 @@ int intel_atomic_commit(struct drm_device *dev,return 0 ; } + +/** +* intel_connector_atomic_get_property - fetch connector property value +* @connector: connector to fetch property for +* @state: state containing the property value +* @property: property to look up +* @val: pointer to write property value into +* +* The DRM core does not store shadow copies of properties for +* atomic-capable drivers. This entrypoint is used to fetch +* the current value of a driver-specific connector property. +*/ +int +intel_connector_atomic_get_property (struct drm_connector *connector, +const struct drm_connector_state *state, +struct drm_property *property, +uint64_t *val) +{ +int i; + +/* +* TODO: We only have atomic modeset for planes at the moment, so the +* crtc/connector code isn't quite ready yet. Until it's ready, +* continue to look up all property values in the DRM's shadow copy +* in obj->properties->values[]. +* +* When the crtc/connector state work matures, this function should +* be updated to read the values out of the state structure instead. +*/ +for (i =0 ; i < connector->base.properties->count; i++) { +if (connector->base.properties->properties[i] == property) { + *val = connector->base.properties->values[i]; +return 0 ; + } + } + +return -EINVAL ; +}
drivers/gpu/drm/i915/intel_crt.c +1 -0
@@ -794,6 +794,7 @@ static const struct drm_connector_funcs intel_crt_connector_funcs = { .destroy = intel_crt_destroy, .set_property = intel_crt_set_property, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, + .atomic_get_property = intel_connector_atomic_get_property, };static const struct drm_connector_helper_funcs intel_crt_connector_helper_funcs = {
drivers/gpu/drm/i915/intel_dp.c +1 -0
@@ -4402,6 +4402,7 @@ static const struct drm_connector_funcs intel_dp_connector_funcs = { .force = intel_dp_force, .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_dp_set_property, + .atomic_get_property = intel_connector_atomic_get_property, .destroy = intel_dp_connector_destroy, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };
drivers/gpu/drm/i915/intel_dp_mst.c +1 -0
@@ -314,6 +314,7 @@ static const struct drm_connector_funcs intel_dp_mst_connector_funcs = { .detect = intel_dp_mst_detect, .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_dp_mst_set_property, + .atomic_get_property = intel_connector_atomic_get_property, .destroy = intel_dp_mst_connector_destroy, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };
drivers/gpu/drm/i915/intel_drv.h +4 -0
@@ -1249,6 +1249,10 @@ int intel_atomic_check(struct drm_device *dev,int intel_atomic_commit (struct drm_device *dev,struct drm_atomic_state *state,bool async); +int intel_connector_atomic_get_property (struct drm_connector *connector, +const struct drm_connector_state *state, +struct drm_property *property, +uint64_t *val);/* intel_atomic_plane.c */ struct intel_plane_state *intel_create_plane_state (struct drm_plane *plane);
drivers/gpu/drm/i915/intel_hdmi.c +1 -0
@@ -1615,6 +1615,7 @@ static const struct drm_connector_funcs intel_hdmi_connector_funcs = { .force = intel_hdmi_force, .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_hdmi_set_property, + .atomic_get_property = intel_connector_atomic_get_property, .destroy = intel_hdmi_destroy, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };
drivers/gpu/drm/i915/intel_lvds.c +1 -0
@@ -532,6 +532,7 @@ static const struct drm_connector_funcs intel_lvds_connector_funcs = { .detect = intel_lvds_detect, .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_lvds_set_property, + .atomic_get_property = intel_connector_atomic_get_property, .destroy = intel_lvds_destroy, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };
drivers/gpu/drm/i915/intel_sdvo.c +1 -0
@@ -2191,6 +2191,7 @@ static const struct drm_connector_funcs intel_sdvo_connector_funcs = { .detect = intel_sdvo_detect, .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_sdvo_set_property, + .atomic_get_property = intel_connector_atomic_get_property, .destroy = intel_sdvo_destroy, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };
drivers/gpu/drm/i915/intel_tv.c +1 -0
@@ -1513,6 +1513,7 @@ static const struct drm_connector_funcs intel_tv_connector_funcs = { .detect = intel_tv_detect, .destroy = intel_tv_destroy, .set_property = intel_tv_set_property, + .atomic_get_property = intel_connector_atomic_get_property, .fill_modes = drm_helper_probe_single_connector_modes, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };
Signature · 6 lines
1.8.5.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 07/10] drm/i915: Add atomic_get_property entrypoint for connectors
Quoted 165 lines · Matt Roper
Even though we only support atomic plane updates at the moment, we still need to add an .atomic_get_property() entrypoint for connectors before we allow the driver to flip on the
DRIVER_ATOMICbit. As soon as that bit gets set, the DRM core will start adding atomic connector properties (in addition to the plane properties we care about at the moment), so we need to be able to handle the new way the DRM core will interact with us.For simplicity, we just lookup driver-specific connector properties in the usual shadow array maintained by the core. Once we get real atomic modeset support for crtc's and planes, this code should be re-written to pull the data out of crtc/connector state structures.
Signed-off-by Matt Roper <[email protected]>--- drivers/gpu/drm/i915/intel_atomic.c | 38 +++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_crt.c | 1 + drivers/gpu/drm/i915/intel_dp.c | 1 + drivers/gpu/drm/i915/intel_dp_mst.c | 1 + drivers/gpu/drm/i915/intel_drv.h | 4 ++++ drivers/gpu/drm/i915/intel_hdmi.c | 1 + drivers/gpu/drm/i915/intel_lvds.c | 1 + drivers/gpu/drm/i915/intel_sdvo.c | 1 + drivers/gpu/drm/i915/intel_tv.c | 1 + 9 files changed, 49 insertions(+)drivers/gpu/drm/i915/intel_atomic.c +38
-0@@ -162,3 +162,41 @@ int intel_atomic_commit(struct drm_device *dev,return 0 ; } + +/** +* intel_connector_atomic_get_property - fetch connector property value +* @connector: connector to fetch property for +* @state: state containing the property value +* @property: property to look up +* @val: pointer to write property value into +* +* The DRM core does not store shadow copies of properties for +* atomic-capable drivers. This entrypoint is used to fetch +* the current value of a driver-specific connector property. +*/ +int +intel_connector_atomic_get_property (struct drm_connector *connector, +const struct drm_connector_state *state, +struct drm_property *property, +uint64_t *val) +{ +int i; + +/* +* TODO: We only have atomic modeset for planes at the moment, so the +* crtc/connector code isn't quite ready yet. Until it's ready, +* continue to look up all property values in the DRM's shadow copy +* in obj->properties->values[]. +* +* When the crtc/connector state work matures, this function should +* be updated to read the values out of the state structure instead. +*/ +for (i =0 ; i < connector->base.properties->count; i++) { +if (connector->base.properties->properties[i] == property) { + *val = connector->base.properties->values[i]; +return 0 ; + } + } + +return -EINVAL ; +}drivers/gpu/drm/i915/intel_crt.c +1
-0@@ -794,6 +794,7 @@ static const struct drm_connector_funcs intel_crt_connector_funcs = { .destroy = intel_crt_destroy, .set_property = intel_crt_set_property, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, + .atomic_get_property = intel_connector_atomic_get_property, };static const struct drm_connector_helper_funcs intel_crt_connector_helper_funcs = {drivers/gpu/drm/i915/intel_dp.c +1
-0@@ -4402,6 +4402,7 @@ static const struct drm_connector_funcs intel_dp_connector_funcs = { .force = intel_dp_force, .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_dp_set_property, + .atomic_get_property = intel_connector_atomic_get_property, .destroy = intel_dp_connector_destroy, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };drivers/gpu/drm/i915/intel_dp_mst.c +1
-0@@ -314,6 +314,7 @@ static const struct drm_connector_funcs intel_dp_mst_connector_funcs = { .detect = intel_dp_mst_detect, .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_dp_mst_set_property, + .atomic_get_property = intel_connector_atomic_get_property, .destroy = intel_dp_mst_connector_destroy, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };drivers/gpu/drm/i915/intel_drv.h +4
-0@@ -1249,6 +1249,10 @@ int intel_atomic_check(struct drm_device *dev,int intel_atomic_commit (struct drm_device *dev,struct drm_atomic_state *state,bool async); +int intel_connector_atomic_get_property (struct drm_connector *connector, +const struct drm_connector_state *state, +struct drm_property *property, +uint64_t *val);/* intel_atomic_plane.c */ struct intel_plane_state *intel_create_plane_state (struct drm_plane *plane);drivers/gpu/drm/i915/intel_hdmi.c +1
-0@@ -1615,6 +1615,7 @@ static const struct drm_connector_funcs intel_hdmi_connector_funcs = { .force = intel_hdmi_force, .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_hdmi_set_property, + .atomic_get_property = intel_connector_atomic_get_property, .destroy = intel_hdmi_destroy, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };drivers/gpu/drm/i915/intel_lvds.c +1
-0@@ -532,6 +532,7 @@ static const struct drm_connector_funcs intel_lvds_connector_funcs = { .detect = intel_lvds_detect, .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_lvds_set_property, + .atomic_get_property = intel_connector_atomic_get_property, .destroy = intel_lvds_destroy, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };drivers/gpu/drm/i915/intel_sdvo.c +1
-0@@ -2191,6 +2191,7 @@ static const struct drm_connector_funcs intel_sdvo_connector_funcs = { .detect = intel_sdvo_detect, .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_sdvo_set_property, + .atomic_get_property = intel_connector_atomic_get_property, .destroy = intel_sdvo_destroy, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };drivers/gpu/drm/i915/intel_tv.c +0
-0
drivers/gpu/drm/i915/intel_tv.c static const struct drm_connector_funcs intel_tv_connector_funcs = { · line 1519
Quoted 7 lines
drivers/gpu/drm/i915/intel_tv.c +1
-0@@ -1513,6 +1513,7 @@ static const struct drm_connector_funcs intel_tv_connector_funcs = { .detect = intel_tv_detect, .destroy = intel_tv_destroy, .set_property = intel_tv_set_property, + .atomic_get_property = intel_connector_atomic_get_property, .fill_modes = drm_helper_probe_single_connector_modes, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };
Don't we need the same change in intel_dvo.c and intel_dsi.c?
Ander
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 7/10 drm/i915: Add atomic_get_property entrypoint for connectors (v2)
Even though we only support atomic plane updates at the moment, we still need to add an .atomic_get_property() entrypoint for connectors before we allow the driver to flip on the DRIVER_ATOMIC bit. As soon as that bit gets set, the DRM core will start adding atomic connector properties (in addition to the plane properties we care about at the moment), so we need to be able to handle the new way the DRM core will interact with us.
For simplicity, we just lookup driver-specific connector properties in the usual shadow array maintained by the core. Once we get real atomic modeset support for crtc's and planes, this code should be re-written to pull the data out of crtc/connector state structures.
v2: Fix intel_dvo and intel_dsi that I missed on the first pass (Ander)
--- drivers/gpu/drm/i915/intel_atomic.c | 38 +++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_crt.c | 1 + drivers/gpu/drm/i915/intel_dp.c | 1 + drivers/gpu/drm/i915/intel_dp_mst.c | 1 + drivers/gpu/drm/i915/intel_drv.h | 4 ++++ drivers/gpu/drm/i915/intel_dsi.c | 1 + drivers/gpu/drm/i915/intel_dvo.c | 1 + drivers/gpu/drm/i915/intel_hdmi.c | 1 + drivers/gpu/drm/i915/intel_lvds.c | 1 + drivers/gpu/drm/i915/intel_sdvo.c | 1 + drivers/gpu/drm/i915/intel_tv.c | 1 + 11 files changed, 51 insertions(+)
drivers/gpu/drm/i915/intel_atomic.c +38 -0
@@ -162,3 +162,41 @@ int intel_atomic_commit(struct drm_device *dev,return 0 ; } + +/** +* intel_connector_atomic_get_property - fetch connector property value +* @connector: connector to fetch property for +* @state: state containing the property value +* @property: property to look up +* @val: pointer to write property value into +* +* The DRM core does not store shadow copies of properties for +* atomic-capable drivers. This entrypoint is used to fetch +* the current value of a driver-specific connector property. +*/ +int +intel_connector_atomic_get_property (struct drm_connector *connector, +const struct drm_connector_state *state, +struct drm_property *property, +uint64_t *val) +{ +int i; + +/* +* TODO: We only have atomic modeset for planes at the moment, so the +* crtc/connector code isn't quite ready yet. Until it's ready, +* continue to look up all property values in the DRM's shadow copy +* in obj->properties->values[]. +* +* When the crtc/connector state work matures, this function should +* be updated to read the values out of the state structure instead. +*/ +for (i =0 ; i < connector->base.properties->count; i++) { +if (connector->base.properties->properties[i] == property) { + *val = connector->base.properties->values[i]; +return 0 ; + } + } + +return -EINVAL ; +}
drivers/gpu/drm/i915/intel_crt.c +1 -0
@@ -794,6 +794,7 @@ static const struct drm_connector_funcs intel_crt_connector_funcs = { .destroy = intel_crt_destroy, .set_property = intel_crt_set_property, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, + .atomic_get_property = intel_connector_atomic_get_property, };static const struct drm_connector_helper_funcs intel_crt_connector_helper_funcs = {
drivers/gpu/drm/i915/intel_dp.c +1 -0
@@ -4402,6 +4402,7 @@ static const struct drm_connector_funcs intel_dp_connector_funcs = { .force = intel_dp_force, .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_dp_set_property, + .atomic_get_property = intel_connector_atomic_get_property, .destroy = intel_dp_connector_destroy, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };
drivers/gpu/drm/i915/intel_dp_mst.c +1 -0
@@ -314,6 +314,7 @@ static const struct drm_connector_funcs intel_dp_mst_connector_funcs = { .detect = intel_dp_mst_detect, .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_dp_mst_set_property, + .atomic_get_property = intel_connector_atomic_get_property, .destroy = intel_dp_mst_connector_destroy, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };
drivers/gpu/drm/i915/intel_drv.h +4 -0
@@ -1249,6 +1249,10 @@ int intel_atomic_check(struct drm_device *dev,int intel_atomic_commit (struct drm_device *dev,struct drm_atomic_state *state,bool async); +int intel_connector_atomic_get_property (struct drm_connector *connector, +const struct drm_connector_state *state, +struct drm_property *property, +uint64_t *val);/* intel_atomic_plane.c */ struct intel_plane_state *intel_create_plane_state (struct drm_plane *plane);
drivers/gpu/drm/i915/intel_dsi.c +1 -0
@@ -792,6 +792,7 @@ static const struct drm_connector_funcs intel_dsi_connector_funcs = { .detect = intel_dsi_detect, .destroy = intel_dsi_destroy, .fill_modes = drm_helper_probe_single_connector_modes, + .atomic_get_property = intel_connector_atomic_get_property, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };
drivers/gpu/drm/i915/intel_dvo.c +1 -0
@@ -391,6 +391,7 @@ static const struct drm_connector_funcs intel_dvo_connector_funcs = { .detect = intel_dvo_detect, .destroy = intel_dvo_destroy, .fill_modes = drm_helper_probe_single_connector_modes, + .atomic_get_property = intel_connector_atomic_get_property, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };
drivers/gpu/drm/i915/intel_hdmi.c +1 -0
@@ -1615,6 +1615,7 @@ static const struct drm_connector_funcs intel_hdmi_connector_funcs = { .force = intel_hdmi_force, .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_hdmi_set_property, + .atomic_get_property = intel_connector_atomic_get_property, .destroy = intel_hdmi_destroy, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };
drivers/gpu/drm/i915/intel_lvds.c +1 -0
@@ -532,6 +532,7 @@ static const struct drm_connector_funcs intel_lvds_connector_funcs = { .detect = intel_lvds_detect, .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_lvds_set_property, + .atomic_get_property = intel_connector_atomic_get_property, .destroy = intel_lvds_destroy, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };
drivers/gpu/drm/i915/intel_sdvo.c +1 -0
@@ -2191,6 +2191,7 @@ static const struct drm_connector_funcs intel_sdvo_connector_funcs = { .detect = intel_sdvo_detect, .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_sdvo_set_property, + .atomic_get_property = intel_connector_atomic_get_property, .destroy = intel_sdvo_destroy, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };
drivers/gpu/drm/i915/intel_tv.c +1 -0
@@ -1513,6 +1513,7 @@ static const struct drm_connector_funcs intel_tv_connector_funcs = { .detect = intel_tv_detect, .destroy = intel_tv_destroy, .set_property = intel_tv_set_property, + .atomic_get_property = intel_connector_atomic_get_property, .fill_modes = drm_helper_probe_single_connector_modes, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };
Signature · 6 lines
1.8.5.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 07/10] drm/i915: Add atomic_get_property entrypoint for connectors (v2)
Quoted 193 lines · Matt Roper
Even though we only support atomic plane updates at the moment, we still need to add an .atomic_get_property() entrypoint for connectors before we allow the driver to flip on the
DRIVER_ATOMICbit. As soon as that bit gets set, the DRM core will start adding atomic connector properties (in addition to the plane properties we care about at the moment), so we need to be able to handle the new way the DRM core will interact with us.For simplicity, we just lookup driver-specific connector properties in the usual shadow array maintained by the core. Once we get real atomic modeset support for crtc's and planes, this code should be re-written to pull the data out of crtc/connector state structures.
v2: Fix
intel_dvoandintel_dsithat I missed on the first pass (Ander)Signed-off-by Matt Roper <[email protected]>--- drivers/gpu/drm/i915/intel_atomic.c | 38 +++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_crt.c | 1 + drivers/gpu/drm/i915/intel_dp.c | 1 + drivers/gpu/drm/i915/intel_dp_mst.c | 1 + drivers/gpu/drm/i915/intel_drv.h | 4 ++++ drivers/gpu/drm/i915/intel_dsi.c | 1 + drivers/gpu/drm/i915/intel_dvo.c | 1 + drivers/gpu/drm/i915/intel_hdmi.c | 1 + drivers/gpu/drm/i915/intel_lvds.c | 1 + drivers/gpu/drm/i915/intel_sdvo.c | 1 + drivers/gpu/drm/i915/intel_tv.c | 1 + 11 files changed, 51 insertions(+)drivers/gpu/drm/i915/intel_atomic.c +38
-0@@ -162,3 +162,41 @@ int intel_atomic_commit(struct drm_device *dev,return 0 ; } + +/** +* intel_connector_atomic_get_property - fetch connector property value +* @connector: connector to fetch property for +* @state: state containing the property value +* @property: property to look up +* @val: pointer to write property value into +* +* The DRM core does not store shadow copies of properties for +* atomic-capable drivers. This entrypoint is used to fetch +* the current value of a driver-specific connector property. +*/ +int +intel_connector_atomic_get_property (struct drm_connector *connector, +const struct drm_connector_state *state, +struct drm_property *property, +uint64_t *val) +{ +int i; + +/* +* TODO: We only have atomic modeset for planes at the moment, so the +* crtc/connector code isn't quite ready yet. Until it's ready, +* continue to look up all property values in the DRM's shadow copy +* in obj->properties->values[]. +* +* When the crtc/connector state work matures, this function should +* be updated to read the values out of the state structure instead. +*/ +for (i =0 ; i < connector->base.properties->count; i++) { +if (connector->base.properties->properties[i] == property) { + *val = connector->base.properties->values[i]; +return 0 ; + } + } + +return -EINVAL ; +}drivers/gpu/drm/i915/intel_crt.c +1
-0@@ -794,6 +794,7 @@ static const struct drm_connector_funcs intel_crt_connector_funcs = { .destroy = intel_crt_destroy, .set_property = intel_crt_set_property, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, + .atomic_get_property = intel_connector_atomic_get_property, };static const struct drm_connector_helper_funcs intel_crt_connector_helper_funcs = {drivers/gpu/drm/i915/intel_dp.c +1
-0@@ -4402,6 +4402,7 @@ static const struct drm_connector_funcs intel_dp_connector_funcs = { .force = intel_dp_force, .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_dp_set_property, + .atomic_get_property = intel_connector_atomic_get_property, .destroy = intel_dp_connector_destroy, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };drivers/gpu/drm/i915/intel_dp_mst.c +1
-0@@ -314,6 +314,7 @@ static const struct drm_connector_funcs intel_dp_mst_connector_funcs = { .detect = intel_dp_mst_detect, .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_dp_mst_set_property, + .atomic_get_property = intel_connector_atomic_get_property, .destroy = intel_dp_mst_connector_destroy, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };drivers/gpu/drm/i915/intel_drv.h +4
-0@@ -1249,6 +1249,10 @@ int intel_atomic_check(struct drm_device *dev,int intel_atomic_commit (struct drm_device *dev,struct drm_atomic_state *state,bool async); +int intel_connector_atomic_get_property (struct drm_connector *connector, +const struct drm_connector_state *state, +struct drm_property *property, +uint64_t *val);/* intel_atomic_plane.c */ struct intel_plane_state *intel_create_plane_state (struct drm_plane *plane);drivers/gpu/drm/i915/intel_dsi.c +1
-0@@ -792,6 +792,7 @@ static const struct drm_connector_funcs intel_dsi_connector_funcs = { .detect = intel_dsi_detect, .destroy = intel_dsi_destroy, .fill_modes = drm_helper_probe_single_connector_modes, + .atomic_get_property = intel_connector_atomic_get_property, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };drivers/gpu/drm/i915/intel_dvo.c +1
-0@@ -391,6 +391,7 @@ static const struct drm_connector_funcs intel_dvo_connector_funcs = { .detect = intel_dvo_detect, .destroy = intel_dvo_destroy, .fill_modes = drm_helper_probe_single_connector_modes, + .atomic_get_property = intel_connector_atomic_get_property, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };drivers/gpu/drm/i915/intel_hdmi.c +1
-0@@ -1615,6 +1615,7 @@ static const struct drm_connector_funcs intel_hdmi_connector_funcs = { .force = intel_hdmi_force, .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_hdmi_set_property, + .atomic_get_property = intel_connector_atomic_get_property, .destroy = intel_hdmi_destroy, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };drivers/gpu/drm/i915/intel_lvds.c +1
-0@@ -532,6 +532,7 @@ static const struct drm_connector_funcs intel_lvds_connector_funcs = { .detect = intel_lvds_detect, .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_lvds_set_property, + .atomic_get_property = intel_connector_atomic_get_property, .destroy = intel_lvds_destroy, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };drivers/gpu/drm/i915/intel_sdvo.c +1
-0@@ -2191,6 +2191,7 @@ static const struct drm_connector_funcs intel_sdvo_connector_funcs = { .detect = intel_sdvo_detect, .fill_modes = drm_helper_probe_single_connector_modes, .set_property = intel_sdvo_set_property, + .atomic_get_property = intel_connector_atomic_get_property, .destroy = intel_sdvo_destroy, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };drivers/gpu/drm/i915/intel_tv.c +0
-0
drivers/gpu/drm/i915/intel_tv.c static const struct drm_connector_funcs intel_tv_connector_funcs = { · line 1519
Quoted 7 lines
drivers/gpu/drm/i915/intel_tv.c +1
-0@@ -1513,6 +1513,7 @@ static const struct drm_connector_funcs intel_tv_connector_funcs = { .detect = intel_tv_detect, .destroy = intel_tv_destroy, .set_property = intel_tv_set_property, + .atomic_get_property = intel_connector_atomic_get_property, .fill_modes = drm_helper_probe_single_connector_modes, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, };
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 8/10 drm/i915: Add crtc state duplication/destruction functions
In reply to Matt RoperThe atomic helpers need these to prepare a new state object when starting a new atomic operation.
--- drivers/gpu/drm/i915/intel_atomic.c | 35 +++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_display.c | 2 ++ drivers/gpu/drm/i915/intel_drv.h | 3 +++ 3 files changed, 40 insertions(+)
drivers/gpu/drm/i915/intel_atomic.c +35 -0
@@ -200,3 +200,38 @@ intel_connector_atomic_get_property(struct drm_connector *connector,return -EINVAL ; } + +/* +* intel_crtc_duplicate_state - duplicate crtc state +* @crtc: drm crtc +* +* Allocates and returns a copy of the crtc state (both common and +* Intel-specific) for the specified crtc. +* +* Returns: The newly allocated crtc state, or NULL on failure. +*/ +struct drm_crtc_state * +intel_crtc_duplicate_state (struct drm_crtc *crtc) +{ +struct intel_crtc *intel_crtc =to_intel_crtc (crtc); + +if (WARN_ON (!intel_crtc->config)) +return kzalloc (sizeof (*intel_crtc->config),GFP_KERNEL ); + +return kmemdup (intel_crtc->config,sizeof (*intel_crtc->config), +GFP_KERNEL ); +} + +/** +* intel_crtc_destroy_state - destroy crtc state +* @crtc: drm crtc +* +* Destroys the crtc state (both common and Intel-specific) for the +* specified crtc. +*/ +void +intel_crtc_destroy_state (struct drm_crtc *crtc, +struct drm_crtc_state *state) +{ +drm_atomic_helper_crtc_destroy_state (crtc, state); +}
drivers/gpu/drm/i915/intel_display.c +2 -0
@@ -11652,6 +11652,8 @@ static const struct drm_crtc_funcs intel_crtc_funcs = { .set_config = intel_crtc_set_config, .destroy = intel_crtc_destroy, .page_flip = intel_crtc_page_flip, + .atomic_duplicate_state = intel_crtc_duplicate_state, + .atomic_destroy_state = intel_crtc_destroy_state, }; static bool ibx_pch_dpll_get_hw_state(struct drm_i915_private *dev_priv,
drivers/gpu/drm/i915/intel_drv.h +3 -0
@@ -1253,6 +1253,9 @@ int intel_connector_atomic_get_property(struct drm_connector *connector,const struct drm_connector_state *state, struct drm_property *property, uint64_t *val); +struct drm_crtc_state *intel_crtc_duplicate_state (struct drm_crtc *crtc); +void intel_crtc_destroy_state (struct drm_crtc *crtc, +struct drm_crtc_state *state);/* intel_atomic_plane.c */ struct intel_plane_state *intel_create_plane_state (struct drm_plane *plane);
Signature · 6 lines
1.8.5.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 08/10] drm/i915: Add crtc state duplication/destruction functions
Quoted 72 lines · Matt Roper
The atomic helpers need these to prepare a new state object when starting a new atomic operation.
Signed-off-by Matt Roper <[email protected]>--- drivers/gpu/drm/i915/intel_atomic.c | 35 +++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_display.c | 2 ++ drivers/gpu/drm/i915/intel_drv.h | 3 +++ 3 files changed, 40 insertions(+)drivers/gpu/drm/i915/intel_atomic.c +35
-0@@ -200,3 +200,38 @@ intel_connector_atomic_get_property(struct drm_connector *connector,return -EINVAL ; } + +/* +* intel_crtc_duplicate_state - duplicate crtc state +* @crtc: drm crtc +* +* Allocates and returns a copy of the crtc state (both common and +* Intel-specific) for the specified crtc. +* +* Returns: The newly allocated crtc state, or NULL on failure. +*/ +struct drm_crtc_state * +intel_crtc_duplicate_state (struct drm_crtc *crtc) +{ +struct intel_crtc *intel_crtc =to_intel_crtc (crtc); + +if (WARN_ON (!intel_crtc->config)) +return kzalloc (sizeof (*intel_crtc->config),GFP_KERNEL ); + +return kmemdup (intel_crtc->config,sizeof (*intel_crtc->config), +GFP_KERNEL ); +} + +/** +* intel_crtc_destroy_state - destroy crtc state +* @crtc: drm crtc +* +* Destroys the crtc state (both common and Intel-specific) for the +* specified crtc. +*/ +void +intel_crtc_destroy_state (struct drm_crtc *crtc, +struct drm_crtc_state *state) +{ +drm_atomic_helper_crtc_destroy_state (crtc, state); +}drivers/gpu/drm/i915/intel_display.c +2
-0@@ -11652,6 +11652,8 @@ static const struct drm_crtc_funcs intel_crtc_funcs = { .set_config = intel_crtc_set_config, .destroy = intel_crtc_destroy, .page_flip = intel_crtc_page_flip, + .atomic_duplicate_state = intel_crtc_duplicate_state, + .atomic_destroy_state = intel_crtc_destroy_state, }; static bool ibx_pch_dpll_get_hw_state(struct drm_i915_private *dev_priv,drivers/gpu/drm/i915/intel_drv.h +0
-0
drivers/gpu/drm/i915/intel_drv.h int intel_connector_atomic_get_property(struct drm_connector *connector, · line 1261
Quoted 9 lines
drivers/gpu/drm/i915/intel_drv.h +3
-0@@ -1253,6 +1253,9 @@ int intel_connector_atomic_get_property(struct drm_connector *connector,const struct drm_connector_state *state, struct drm_property *property, uint64_t *val); +struct drm_crtc_state *intel_crtc_duplicate_state (struct drm_crtc *crtc); +void intel_crtc_destroy_state (struct drm_crtc *crtc, +struct drm_crtc_state *state);/* intel_atomic_plane.c */ struct intel_plane_state *intel_create_plane_state (struct drm_plane *plane);
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 9/10 drm/i915: Switch plane properties to full atomic helper.
In reply to Matt RoperThis will exercise our atomic pipeline for legacy property updates.
--- drivers/gpu/drm/i915/intel_atomic_plane.c | 9 +++++++++ drivers/gpu/drm/i915/intel_display.c | 3 ++- drivers/gpu/drm/i915/intel_sprite.c | 26 -------------------------- 3 files changed, 11 insertions(+), 27 deletions(-)
drivers/gpu/drm/i915/intel_atomic_plane.c +9 -0
@@ -118,6 +118,15 @@ static int intel_plane_atomic_check(struct drm_plane *plane, intel_crtc =to_intel_crtc (crtc);/* +* Both crtc and plane->crtc could be NULL if we're updating a +* property while the plane is disabled. We don't actually have +* anything driver-specific we need to test in that case, so +* just return success. +*/ +if (!crtc) +return 0 ; + +/* * The original src/dest coordinates are stored in state->base, but * we want to keep another copy internal to our driver that we can * clip/modify ourselves.
drivers/gpu/drm/i915/intel_display.c +2 -1
@@ -37,6 +37,7 @@#include <drm/i915_drm.h> #include "i915_drv.h" #include "i915_trace.h" +#include <drm/drm_atomic_helper.h> #include <drm/drm_dp_helper.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_plane_helper.h>
@@ -12055,7 +12056,7 @@ const struct drm_plane_funcs intel_plane_funcs = { .update_plane = drm_plane_helper_update, .disable_plane = drm_plane_helper_disable, .destroy = intel_plane_destroy, - .set_property = intel_plane_set_property, + .set_property = drm_atomic_helper_plane_set_property, .atomic_get_property = intel_plane_atomic_get_property, .atomic_set_property = intel_plane_atomic_set_property, .atomic_duplicate_state = intel_plane_duplicate_state,
drivers/gpu/drm/i915/intel_sprite.c +0 -26
@@ -1362,32 +1362,6 @@ out_unlock:return ret; } -int intel_plane_set_property (struct drm_plane *plane, -struct drm_property *prop, -uint64_t val) -{ -struct drm_device *dev = plane->dev; -uint64_t old_val; -int ret = -ENOENT ; - -if (prop == dev->mode_config.rotation_property) { -/* exactly one rotation angle please */ -if (hweight32 (val &0xf ) !=1 ) -return -EINVAL ; - -if (plane->state->rotation == val) -return 0 ; - - old_val = plane->state->rotation; - plane->state->rotation = val; - ret =intel_plane_restore (plane); -if (ret) - plane->state->rotation = old_val; - } - -return ret; -} -int intel_plane_restore (struct drm_plane *plane) {if (!plane->crtc || !plane->fb)
Signature · 6 lines
1.8.5.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 09/10] drm/i915: Switch plane properties to full atomic helper.
Quoted 78 lines · Matt Roper
This will exercise our atomic pipeline for legacy property updates.
Signed-off-by Matt Roper <[email protected]>--- drivers/gpu/drm/i915/intel_atomic_plane.c | 9 +++++++++ drivers/gpu/drm/i915/intel_display.c | 3 ++- drivers/gpu/drm/i915/intel_sprite.c | 26 -------------------------- 3 files changed, 11 insertions(+), 27 deletions(-)drivers/gpu/drm/i915/intel_atomic_plane.c +9
-0@@ -118,6 +118,15 @@ static int intel_plane_atomic_check(struct drm_plane *plane, intel_crtc =to_intel_crtc (crtc);/* +* Both crtc and plane->crtc could be NULL if we're updating a +* property while the plane is disabled. We don't actually have +* anything driver-specific we need to test in that case, so +* just return success. +*/ +if (!crtc) +return 0 ; + +/* * The original src/dest coordinates are stored in state->base, but * we want to keep another copy internal to our driver that we can * clip/modify ourselves. drivers/gpu/drm/i915/intel_display.c +2
-1@@ -37,6 +37,7 @@#include <drm/i915_drm.h> #include "i915_drv.h" #include "i915_trace.h" +#include <drm/drm_atomic_helper.h> #include <drm/drm_dp_helper.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_plane_helper.h> @@ -12055,7 +12056,7 @@ const struct drm_plane_funcs intel_plane_funcs = { .update_plane = drm_plane_helper_update, .disable_plane = drm_plane_helper_disable, .destroy = intel_plane_destroy, - .set_property = intel_plane_set_property, + .set_property = drm_atomic_helper_plane_set_property, .atomic_get_property = intel_plane_atomic_get_property, .atomic_set_property = intel_plane_atomic_set_property, .atomic_duplicate_state = intel_plane_duplicate_state,drivers/gpu/drm/i915/intel_sprite.c +0
-19@@ -1362,32 +1362,6 @@ out_unlock:return ret; } -int intel_plane_set_property (struct drm_plane *plane, -struct drm_property *prop, -uint64_t val) -{ -struct drm_device *dev = plane->dev; -uint64_t old_val; -int ret = -ENOENT ; - -if (prop == dev->mode_config.rotation_property) { -/* exactly one rotation angle please */ -if (hweight32 (val &0xf ) !=1 ) -return -EINVAL ; - -if (plane->state->rotation == val) -return 0 ; - - old_val = plane->state->rotation; - plane->state->rotation = val; - ret =intel_plane_restore (plane);
drivers/gpu/drm/i915/intel_sprite.c out_unlock: · line 1367
Quoted 10 lines
drivers/gpu/drm/i915/intel_sprite.c +0
-7-if (ret) - plane->state->rotation = old_val; - } - -return ret; -} -int intel_plane_restore (struct drm_plane *plane) {if (!plane->crtc || !plane->fb)
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 10/10 drm/i915: Add i915.nuclear_pageflip command line param to force atomic (v3)
In reply to Matt RoperWe don't have full atomic modeset support yet, but the "nuclear pageflip" subset of functionality (i.e., plane operations only) should be ready. Allow the user to force atomic on for debug purposes, or for fixed-purpose embedded devices that will only use atomic for plane updates.
The term 'nuclear' is used here instead of 'atomic' to make it clear that this doesn't allow full atomic modeset support, just a (very useful) subset of the atomic functionality.
We'll drop the kernel parameter and unconditionally enable atomic in a future patch once all of the necessary pieces are in.
v2:
- Use module_param_named_unsafe() (Daniel)
- Simplify comment on DRIVER_ATOMIC guard (Daniel)
v3:
- Make the parameter "nuclear_pageflip" rather than just "nuclear" for clarity. (Ander)
--- drivers/gpu/drm/i915/i915_drv.c | 8 ++++++++ drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_params.c | 5 +++++ 3 files changed, 14 insertions(+)
drivers/gpu/drm/i915/i915_drv.c +8 -0
@@ -1637,6 +1637,14 @@ static int __init i915_init(void)#endif } +/* +* FIXME: Note that we're lying to the DRM core here so that we can get access +* to the atomic ioctl and the atomic properties. Only plane operations on +* a single CRTC will actually work. +*/ +if (i915.nuclear) + driver.driver_features |=DRIVER_ATOMIC ; +return drm_pci_init (&driver, &i915_pci_driver); }
drivers/gpu/drm/i915/i915_drv.h +1 -0
@@ -2526,6 +2526,7 @@ struct i915_params {int use_mmio_flip;bool mmio_debug;bool verbose_state_checks; +bool nuclear; };extern struct i915_params i915__read_mostly ;
drivers/gpu/drm/i915/i915_params.c +5 -0
@@ -52,6 +52,7 @@ struct i915_params i915 __read_mostly = { .use_mmio_flip = 0, .mmio_debug = 0, .verbose_state_checks = 1, + .nuclear = 0, };module_param_named (modeset, i915.modeset, int,0400 );
@@ -178,3 +179,7 @@ MODULE_PARM_DESC(mmio_debug,module_param_named (verbose_state_checks, i915.verbose_state_checks, bool,0600 );MODULE_PARM_DESC (verbose_state_checks,"Enable verbose logs (ie. WARN_ON()) in case of unexpected hw state conditions." ); + +module_param_named_unsafe (nuclear_pageflip, i915.nuclear, bool,0600 ); +MODULE_PARM_DESC (nuclear_pageflip, +"Force atomic modeset functionality; only planes work for now (default: false)." );
Signature · 6 lines
1.8.5.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 10/10] drm/i915: Add i915.nuclear_pageflip command line param to force atomic (v3)
Quoted 73 lines · Matt Roper
We don't have full atomic modeset support yet, but the "nuclear pageflip" subset of functionality (i.e., plane operations only) should be ready. Allow the user to force atomic on for debug purposes, or for fixed-purpose embedded devices that will only use atomic for plane updates.
The term 'nuclear' is used here instead of 'atomic' to make it clear that this doesn't allow full atomic modeset support, just a (very useful) subset of the atomic functionality.
We'll drop the kernel parameter and unconditionally enable atomic in a future patch once all of the necessary pieces are in.
v2:
- Usemodule_param_named_unsafe()(Daniel)
- Simplify comment onDRIVER_ATOMICguard (Daniel)v3:
- Make the parameter "nuclear_pageflip" rather than just "nuclear" for clarity. (Ander)Signed-off-by Matt Roper <[email protected]>--- drivers/gpu/drm/i915/i915_drv.c | 8 ++++++++ drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_params.c | 5 +++++ 3 files changed, 14 insertions(+)drivers/gpu/drm/i915/i915_drv.c +8
-0@@ -1637,6 +1637,14 @@ static int __init i915_init(void)#endif } +/* +* FIXME: Note that we're lying to the DRM core here so that we can get access +* to the atomic ioctl and the atomic properties. Only plane operations on +* a single CRTC will actually work. +*/ +if (i915.nuclear) + driver.driver_features |=DRIVER_ATOMIC ; +return drm_pci_init (&driver, &i915_pci_driver); }drivers/gpu/drm/i915/i915_drv.h +1
-0@@ -2526,6 +2526,7 @@ struct i915_params {int use_mmio_flip;bool mmio_debug;bool verbose_state_checks; +bool nuclear; };extern struct i915_params i915__read_mostly ;drivers/gpu/drm/i915/i915_params.c +1
-0@@ -52,6 +52,7 @@ struct i915_params i915 __read_mostly = { .use_mmio_flip = 0, .mmio_debug = 0, .verbose_state_checks = 1, + .nuclear = 0, };module_param_named (modeset, i915.modeset, int,0400 );
drivers/gpu/drm/i915/i915_params.c MODULE_PARM_DESC(mmio_debug, · line 185
Quoted 7 lines
drivers/gpu/drm/i915/i915_params.c +4
-0@@ -178,3 +179,7 @@ MODULE_PARM_DESC(mmio_debug,module_param_named (verbose_state_checks, i915.verbose_state_checks, bool,0600 );MODULE_PARM_DESC (verbose_state_checks,"Enable verbose logs (ie. WARN_ON()) in case of unexpected hw state conditions." ); + +module_param_named_unsafe (nuclear_pageflip, i915.nuclear, bool,0600 ); +MODULE_PARM_DESC (nuclear_pageflip, +"Force atomic modeset functionality; only planes work for now (default: false)." );
I'd prefer if the field in i915_params was renamed too (so it matches with the cmd line param name), but anyway
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 10/10 drm/i915: Add i915.nuclear_pageflip command line param to force atomic (v4)
We don't have full atomic modeset support yet, but the "nuclear pageflip" subset of functionality (i.e., plane operations only) should be ready. Allow the user to force atomic on for debug purposes, or for fixed-purpose embedded devices that will only use atomic for plane updates.
The term 'nuclear' is used here instead of 'atomic' to make it clear that this doesn't allow full atomic modeset support, just a (very useful) subset of the atomic functionality.
We'll drop the kernel parameter and unconditionally enable atomic in a future patch once all of the necessary pieces are in.
v2:
- Use module_param_named_unsafe() (Daniel)
- Simplify comment on DRIVER_ATOMIC guard (Daniel)
v3:
- Make the parameter "nuclear_pageflip" rather than just "nuclear" for clarity. (Ander)
v4:
- Make the internal variable "nuclear_pageflip" as well as the command-line option. (Ander)
--- drivers/gpu/drm/i915/i915_drv.c | 8 ++++++++ drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_params.c | 5 +++++ 3 files changed, 14 insertions(+)
drivers/gpu/drm/i915/i915_drv.c +8 -0
@@ -1637,6 +1637,14 @@ static int __init i915_init(void)#endif } +/* +* FIXME: Note that we're lying to the DRM core here so that we can get access +* to the atomic ioctl and the atomic properties. Only plane operations on +* a single CRTC will actually work. +*/ +if (i915.nuclear_pageflip) + driver.driver_features |=DRIVER_ATOMIC ; +return drm_pci_init (&driver, &i915_pci_driver); }
drivers/gpu/drm/i915/i915_drv.h +1 -0
@@ -2526,6 +2526,7 @@ struct i915_params {int use_mmio_flip;bool mmio_debug;bool verbose_state_checks; +bool nuclear_pageflip; };extern struct i915_params i915__read_mostly ;
drivers/gpu/drm/i915/i915_params.c +5 -0
@@ -52,6 +52,7 @@ struct i915_params i915 __read_mostly = { .use_mmio_flip = 0, .mmio_debug = 0, .verbose_state_checks = 1, + .nuclear_pageflip = 0, };module_param_named (modeset, i915.modeset, int,0400 );
@@ -178,3 +179,7 @@ MODULE_PARM_DESC(mmio_debug,module_param_named (verbose_state_checks, i915.verbose_state_checks, bool,0600 );MODULE_PARM_DESC (verbose_state_checks,"Enable verbose logs (ie. WARN_ON()) in case of unexpected hw state conditions." ); + +module_param_named_unsafe (nuclear_pageflip, i915.nuclear_pageflip, bool,0600 ); +MODULE_PARM_DESC (nuclear_pageflip, +"Force atomic modeset functionality; only planes work for now (default: false)." );
Signature · 6 lines
1.8.5.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 10/10] drm/i915: Add i915.nuclear_pageflip command line param to force atomic (v4)
Quoted 21 lines · Matt Roper
We don't have full atomic modeset support yet, but the "nuclear pageflip" subset of functionality (i.e., plane operations only) should be ready. Allow the user to force atomic on for debug purposes, or for fixed-purpose embedded devices that will only use atomic for plane updates.
The term 'nuclear' is used here instead of 'atomic' to make it clear that this doesn't allow full atomic modeset support, just a (very useful) subset of the atomic functionality.
We'll drop the kernel parameter and unconditionally enable atomic in a future patch once all of the necessary pieces are in.
v2:
- Usemodule_param_named_unsafe()(Daniel)
- Simplify comment onDRIVER_ATOMICguard (Daniel)v3:
- Make the parameter "nuclear_pageflip" rather than just "nuclear" for clarity. (Ander)
Quoted 6 lines
v4:
- Make the internal variable "nuclear_pageflip" as well as the command-line option. (Ander)Signed-off-by Matt Roper <[email protected]>Reviewed-by Ander Conselvan de Oliveira <[email protected]>
Pulled in the entire series, thanks for patches&review. -Daniel
Quoted 64 lines
--- drivers/gpu/drm/i915/i915_drv.c | 8 ++++++++ drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_params.c | 5 +++++ 3 files changed, 14 insertions(+)drivers/gpu/drm/i915/i915_drv.c +8
-0@@ -1637,6 +1637,14 @@ static int __init i915_init(void)#endif } +/* +* FIXME: Note that we're lying to the DRM core here so that we can get access +* to the atomic ioctl and the atomic properties. Only plane operations on +* a single CRTC will actually work. +*/ +if (i915.nuclear_pageflip) + driver.driver_features |=DRIVER_ATOMIC ; +return drm_pci_init (&driver, &i915_pci_driver); }drivers/gpu/drm/i915/i915_drv.h +1
-0@@ -2526,6 +2526,7 @@ struct i915_params {int use_mmio_flip;bool mmio_debug;bool verbose_state_checks; +bool nuclear_pageflip; };extern struct i915_params i915__read_mostly ;drivers/gpu/drm/i915/i915_params.c +5
-0@@ -52,6 +52,7 @@ struct i915_params i915 __read_mostly = { .use_mmio_flip = 0, .mmio_debug = 0, .verbose_state_checks = 1, + .nuclear_pageflip = 0, };module_param_named (modeset, i915.modeset, int,0400 );@@ -178,3 +179,7 @@ MODULE_PARM_DESC(mmio_debug,module_param_named (verbose_state_checks, i915.verbose_state_checks, bool,0600 );MODULE_PARM_DESC (verbose_state_checks,"Enable verbose logs (ie. WARN_ON()) in case of unexpected hw state conditions." ); + +module_param_named_unsafe (nuclear_pageflip, i915.nuclear_pageflip, bool,0600 ); +MODULE_PARM_DESC (nuclear_pageflip, +"Force atomic modeset functionality; only planes work for now (default: false)." );Signature · 6 lines
1.8.5.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx