Commit 6156a456 authored by Chandra Konduru's avatar Chandra Konduru Committed by Daniel Vetter

drm/i915: skylake primary plane scaling using shared scalers

This patch enables skylake primary plane scaling using shared
scalers atomic desgin.

v2:
-use single copy of scaler limits (Matt)

v3:
-move detach_scalers to crtc commit path (Matt)
-use values in plane_state->src as regular integers (me)

v4:
-changes to align with updated scaler structures (Matt, me)
-keep plane src rect in 16.16 format (Matt, Daniel)

v5:
-Rebased on top of 90/270 rotation changes (me)
-Fixed an issue introduced by 90/270 changes where plane programming
 is using drm_plane->state rect instead of intel_plane->state rect.
 This change also required for scaling to work properly. (me)
-With 90/270, updated limits to cover both portrait and landscape usages (me)
-Refactored skylake_update_primary_plane to reduce its size (Daniel)
 Added helper functions for refactoring are comprehended enough to be
 used for skylake_update_plane (for sprite) too. One stop towards
 having single function for all planes.

v6:
-Added fixme note when checking plane_state->src width in update_plane (Daniel)
-Release lock when failing to colorkey request with active scaler (Daniel)
Signed-off-by: default avatarChandra Konduru <chandra.konduru@intel.com>
Reviewed-by: matthew.d.roper@intel.com
Reviewed-by: sonika.jindal@intel.com (v5)
Testcase: igt/kms_plane_scaling
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent e1dee197
...@@ -169,7 +169,7 @@ int intel_atomic_commit(struct drm_device *dev, ...@@ -169,7 +169,7 @@ int intel_atomic_commit(struct drm_device *dev,
plane->state->state = NULL; plane->state->state = NULL;
} }
/* swap crtc_state */ /* swap crtc_scaler_state */
for (i = 0; i < dev->mode_config.num_crtc; i++) { for (i = 0; i < dev->mode_config.num_crtc; i++) {
struct drm_crtc *crtc = state->crtcs[i]; struct drm_crtc *crtc = state->crtcs[i];
if (!crtc) { if (!crtc) {
...@@ -178,6 +178,9 @@ int intel_atomic_commit(struct drm_device *dev, ...@@ -178,6 +178,9 @@ int intel_atomic_commit(struct drm_device *dev,
to_intel_crtc(crtc)->config->scaler_state = to_intel_crtc(crtc)->config->scaler_state =
to_intel_crtc_state(state->crtc_states[i])->scaler_state; to_intel_crtc_state(state->crtc_states[i])->scaler_state;
if (INTEL_INFO(dev)->gen >= 9)
skl_detach_scalers(to_intel_crtc(crtc));
} }
drm_atomic_helper_commit_planes(dev, state); drm_atomic_helper_commit_planes(dev, state);
......
This diff is collapsed.
...@@ -285,11 +285,11 @@ struct intel_initial_plane_config { ...@@ -285,11 +285,11 @@ struct intel_initial_plane_config {
#define SKL_MIN_SRC_W 8 #define SKL_MIN_SRC_W 8
#define SKL_MAX_SRC_W 4096 #define SKL_MAX_SRC_W 4096
#define SKL_MIN_SRC_H 8 #define SKL_MIN_SRC_H 8
#define SKL_MAX_SRC_H 2304 #define SKL_MAX_SRC_H 4096
#define SKL_MIN_DST_W 8 #define SKL_MIN_DST_W 8
#define SKL_MAX_DST_W 4096 #define SKL_MAX_DST_W 4096
#define SKL_MIN_DST_H 8 #define SKL_MIN_DST_H 8
#define SKL_MAX_DST_H 2304 #define SKL_MAX_DST_H 4096
struct intel_scaler { struct intel_scaler {
int id; int id;
...@@ -1145,9 +1145,13 @@ void skl_detach_scalers(struct intel_crtc *intel_crtc); ...@@ -1145,9 +1145,13 @@ void skl_detach_scalers(struct intel_crtc *intel_crtc);
int skl_update_scaler_users(struct intel_crtc *intel_crtc, int skl_update_scaler_users(struct intel_crtc *intel_crtc,
struct intel_crtc_state *crtc_state, struct intel_plane *intel_plane, struct intel_crtc_state *crtc_state, struct intel_plane *intel_plane,
struct intel_plane_state *plane_state, int force_detach); struct intel_plane_state *plane_state, int force_detach);
int skl_max_scale(struct intel_crtc *crtc, struct intel_crtc_state *crtc_state);
unsigned long intel_plane_obj_offset(struct intel_plane *intel_plane, unsigned long intel_plane_obj_offset(struct intel_plane *intel_plane,
struct drm_i915_gem_object *obj); struct drm_i915_gem_object *obj);
u32 skl_plane_ctl_format(uint32_t pixel_format);
u32 skl_plane_ctl_tiling(uint64_t fb_modifier);
u32 skl_plane_ctl_rotation(unsigned int rotation);
/* intel_dp.c */ /* intel_dp.c */
void intel_dp_init(struct drm_device *dev, int output_reg, enum port port); void intel_dp_init(struct drm_device *dev, int output_reg, enum port port);
......
...@@ -1150,6 +1150,16 @@ int intel_sprite_set_colorkey(struct drm_device *dev, void *data, ...@@ -1150,6 +1150,16 @@ int intel_sprite_set_colorkey(struct drm_device *dev, void *data,
} }
intel_plane = to_intel_plane(plane); intel_plane = to_intel_plane(plane);
if (INTEL_INFO(dev)->gen >= 9) {
/* plane scaling and colorkey are mutually exclusive */
if (to_intel_plane_state(plane->state)->scaler_id >= 0) {
DRM_ERROR("colorkey not allowed with scaler\n");
ret = -EINVAL;
goto out_unlock;
}
}
intel_plane->ckey = *set; intel_plane->ckey = *set;
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment