mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 11:33:36 -04:00
drm: Introduce plane and CRTC scaling filter properties
Introduce per-plane and per-CRTC scaling filter properties to allow userspace to select the driver's default scaling filter or Nearest-neighbor(NN) filter for upscaling operations on CRTC and plane. Drivers can set up this property for a plane by calling drm_plane_create_scaling_filter() and for a CRTC by calling drm_crtc_create_scaling_filter(). NN filter works by filling in the missing color values in the upscaled image with that of the coordinate-mapped nearest source pixel value. NN filter for integer multiple scaling can be particularly useful for for pixel art games that rely on sharp, blocky images to deliver their distinctive look. changes since: v6: * Move property doc to existing "Standard CRTC Properties" and "Plane Composition Properties" doc comments (Simon) changes since v3: * Refactor code, add new function for common code (Ville) changes since v2: * Create per-plane and per-CRTC scaling filter property (Ville) changes since v1: * None changes since RFC: * Add separate properties for plane and CRTC (Ville) Link: https://github.com/xbmc/xbmc/pull/18194 Link: https://github.com/xbmc/xbmc/pull/18567 Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Uma Shankar <uma.shankar@intel.com> Acked-by: Simon Ser <contact@emersion.fr> Acked-by: Daniel Vetter <daniel@ffwll.ch> Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20201020161427.6941-2-pankaj.laxminarayan.bharadiya@intel.com
This commit is contained in:
committed by
Jani Nikula
parent
e7fc3f902d
commit
5c759eda9b
@@ -469,6 +469,8 @@ static int drm_atomic_crtc_set_property(struct drm_crtc *crtc,
|
||||
return -EFAULT;
|
||||
|
||||
set_out_fence_for_crtc(state->state, crtc, fence_ptr);
|
||||
} else if (property == crtc->scaling_filter_property) {
|
||||
state->scaling_filter = val;
|
||||
} else if (crtc->funcs->atomic_set_property) {
|
||||
return crtc->funcs->atomic_set_property(crtc, state, property, val);
|
||||
} else {
|
||||
@@ -503,6 +505,8 @@ drm_atomic_crtc_get_property(struct drm_crtc *crtc,
|
||||
*val = (state->gamma_lut) ? state->gamma_lut->base.id : 0;
|
||||
else if (property == config->prop_out_fence_ptr)
|
||||
*val = 0;
|
||||
else if (property == crtc->scaling_filter_property)
|
||||
*val = state->scaling_filter;
|
||||
else if (crtc->funcs->atomic_get_property)
|
||||
return crtc->funcs->atomic_get_property(crtc, state, property, val);
|
||||
else
|
||||
@@ -585,6 +589,8 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane,
|
||||
sizeof(struct drm_rect),
|
||||
&replaced);
|
||||
return ret;
|
||||
} else if (property == plane->scaling_filter_property) {
|
||||
state->scaling_filter = val;
|
||||
} else if (plane->funcs->atomic_set_property) {
|
||||
return plane->funcs->atomic_set_property(plane, state,
|
||||
property, val);
|
||||
@@ -643,6 +649,8 @@ drm_atomic_plane_get_property(struct drm_plane *plane,
|
||||
} else if (property == config->prop_fb_damage_clips) {
|
||||
*val = (state->fb_damage_clips) ?
|
||||
state->fb_damage_clips->base.id : 0;
|
||||
} else if (property == plane->scaling_filter_property) {
|
||||
*val = state->scaling_filter;
|
||||
} else if (plane->funcs->atomic_get_property) {
|
||||
return plane->funcs->atomic_get_property(plane, state, property, val);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user