Lines Matching +full:pre +full:- +full:scaler
53 return pipe * DISPLAY_RUNTIME_INFO(display)->num_sprites[pipe] + sprite + 'A';
70 struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
71 const struct drm_framebuffer *fb = plane_state->hw.fb;
72 enum plane_id plane_id = plane->id;
84 /* BT.601 full range YCbCr -> full range RGB */
87 -2925, 4096, -1410,
90 /* BT.709 full range YCbCr -> full range RGB */
93 -1917, 4096, -767,
97 const s16 *csc = csc_matrix[plane_state->hw.color_encoding];
100 if (!fb->format->is_yuv)
123 SPCSC_IMAX(512) | SPCSC_IMIN(-512));
125 SPCSC_IMAX(512) | SPCSC_IMIN(-512));
142 struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
143 const struct drm_framebuffer *fb = plane_state->hw.fb;
144 enum pipe pipe = plane->pipe;
145 enum plane_id plane_id = plane->id;
148 if (fb->format->is_yuv &&
149 plane_state->hw.color_range == DRM_COLOR_YCBCR_LIMITED_RANGE) {
156 contrast = DIV_ROUND_CLOSEST(255 << 6, 235 - 16);
157 brightness = -DIV_ROUND_CLOSEST(16 * 255, 235 - 16);
158 sh_scale = DIV_ROUND_CLOSEST(128 << 7, 240 - 128);
162 /* Pass-through everything. */
182 u8 active_planes = crtc_state->active_planes & ~BIT(PLANE_CURSOR);
183 const struct drm_framebuffer *fb = plane_state->hw.fb;
184 unsigned int cpp = fb->format->cpp[0];
243 * Note that crtc_state->pixel_rate accounts for both
245 * Pre-HSW bspec tells us to only consider the horizontal
249 pixel_rate = crtc_state->pixel_rate;
260 if (crtc_state->gamma_enable)
269 const struct drm_framebuffer *fb = plane_state->hw.fb;
270 unsigned int rotation = plane_state->hw.rotation;
271 const struct drm_intel_sprite_colorkey *key = &plane_state->ckey;
276 switch (fb->format->format) {
320 MISSING_CASE(fb->format->format);
324 if (plane_state->hw.color_encoding == DRM_COLOR_YCBCR_BT709)
327 if (fb->modifier == I915_FORMAT_MOD_X_TILED)
336 if (key->flags & I915_SET_COLORKEY_SOURCE)
345 struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
346 const struct drm_framebuffer *fb = plane_state->hw.fb;
347 enum pipe pipe = plane->pipe;
348 enum plane_id plane_id = plane->id;
353 if (!fb->format->is_yuv)
360 for (i = 1; i < 8 - 1; i++)
361 intel_de_write_fw(display, SPGAMC(pipe, plane_id, i - 1),
372 enum pipe pipe = plane->pipe;
373 enum plane_id plane_id = plane->id;
374 int crtc_x = plane_state->uapi.dst.x1;
375 int crtc_y = plane_state->uapi.dst.y1;
376 u32 crtc_w = drm_rect_width(&plane_state->uapi.dst);
377 u32 crtc_h = drm_rect_height(&plane_state->uapi.dst);
380 plane_state->view.color_plane[0].mapping_stride);
384 SP_HEIGHT(crtc_h - 1) | SP_WIDTH(crtc_w - 1));
394 enum pipe pipe = plane->pipe;
395 enum plane_id plane_id = plane->id;
396 const struct drm_intel_sprite_colorkey *key = &plane_state->ckey;
397 u32 sprsurf_offset = plane_state->view.color_plane[0].offset;
398 u32 x = plane_state->view.color_plane[0].x;
399 u32 y = plane_state->view.color_plane[0].y;
402 sprctl = plane_state->ctl | vlv_sprite_ctl_crtc(crtc_state);
406 if (display->platform.cherryview && pipe == PIPE_B)
409 if (key->flags) {
411 key->min_value);
413 key->channel_mask);
415 key->max_value);
425 * The control register self-arms if the plane was previously
443 enum pipe pipe = plane->pipe;
444 enum plane_id plane_id = plane->id;
456 error->ctl = intel_de_read(display, SPCNTR(crtc->pipe, plane->id));
457 error->surf = intel_de_read(display, SPSURF(crtc->pipe, plane->id));
458 error->surflive = intel_de_read(display, SPSURFLIVE(crtc->pipe, plane->id));
467 enum plane_id plane_id = plane->id;
471 power_domain = POWER_DOMAIN_PIPE(plane->pipe);
476 ret = intel_de_read(display, SPCNTR(plane->pipe, plane_id)) & SP_ENABLE;
478 *pipe = plane->pipe;
489 u8 active_planes = crtc_state->active_planes & ~BIT(PLANE_CURSOR);
490 const struct drm_framebuffer *fb = plane_state->hw.fb;
491 unsigned int cpp = fb->format->cpp[0];
526 const struct drm_framebuffer *fb = plane_state->hw.fb;
527 unsigned int cpp = fb->format->cpp[0];
556 * Note that crtc_state->pixel_rate accounts for both
558 * Pre-HSW bspec tells us to only consider the horizontal
562 pixel_rate = crtc_state->pixel_rate;
576 * Note that crtc_state->pixel_rate accounts for both
578 * Pre-HSW bspec tells us to only consider the horizontal
582 pixel_rate = crtc_state->pixel_rate;
584 src_w = drm_rect_width(&plane_state->uapi.src) >> 16;
585 dst_w = drm_rect_width(&plane_state->uapi.dst);
603 u8 active_planes = crtc_state->active_planes & ~BIT(PLANE_CURSOR);
604 const struct drm_framebuffer *fb = plane_state->hw.fb;
605 unsigned int cpp = fb->format->cpp[0];
635 unsigned int pixel_rate = crtc_state->pixel_rate;
647 if (crtc_state->gamma_enable)
650 if (crtc_state->csc_enable)
659 const struct drm_framebuffer *fb = plane_state->hw.fb;
661 return fb->format->cpp[0] == 8 &&
662 (display->platform.ivybridge || display->platform.haswell);
669 const struct drm_framebuffer *fb = plane_state->hw.fb;
670 unsigned int rotation = plane_state->hw.rotation;
671 const struct drm_intel_sprite_colorkey *key = &plane_state->ckey;
676 if (display->platform.ivybridge)
679 switch (fb->format->format) {
711 MISSING_CASE(fb->format->format);
718 if (plane_state->hw.color_encoding == DRM_COLOR_YCBCR_BT709)
721 if (plane_state->hw.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
724 if (fb->modifier == I915_FORMAT_MOD_X_TILED)
730 if (key->flags & I915_SET_COLORKEY_DESTINATION)
732 else if (key->flags & I915_SET_COLORKEY_SOURCE)
745 * "Workaround : When using the 64-bit format, the sprite output
754 gamma[i] = min((scale * i << 10) / 16, (1 << 10) - 1);
766 struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
767 enum pipe pipe = plane->pipe;
799 enum pipe pipe = plane->pipe;
800 int crtc_x = plane_state->uapi.dst.x1;
801 int crtc_y = plane_state->uapi.dst.y1;
802 u32 crtc_w = drm_rect_width(&plane_state->uapi.dst);
803 u32 crtc_h = drm_rect_height(&plane_state->uapi.dst);
804 u32 src_w = drm_rect_width(&plane_state->uapi.src) >> 16;
805 u32 src_h = drm_rect_height(&plane_state->uapi.src) >> 16;
810 SPRITE_SRC_WIDTH(src_w - 1) |
811 SPRITE_SRC_HEIGHT(src_h - 1);
814 plane_state->view.color_plane[0].mapping_stride);
818 SPRITE_HEIGHT(crtc_h - 1) | SPRITE_WIDTH(crtc_w - 1));
819 if (display->platform.ivybridge)
830 enum pipe pipe = plane->pipe;
831 const struct drm_intel_sprite_colorkey *key = &plane_state->ckey;
832 u32 sprsurf_offset = plane_state->view.color_plane[0].offset;
833 u32 x = plane_state->view.color_plane[0].x;
834 u32 y = plane_state->view.color_plane[0].y;
837 sprctl = plane_state->ctl | ivb_sprite_ctl_crtc(crtc_state);
841 if (key->flags) {
842 intel_de_write_fw(display, SPRKEYVAL(pipe), key->min_value);
844 key->channel_mask);
845 intel_de_write_fw(display, SPRKEYMAX(pipe), key->max_value);
850 if (display->platform.haswell || display->platform.broadwell) {
860 * The control register self-arms if the plane was previously
877 enum pipe pipe = plane->pipe;
880 /* Disable the scaler */
881 if (display->platform.ivybridge)
892 error->ctl = intel_de_read(display, SPRCTL(crtc->pipe));
893 error->surf = intel_de_read(display, SPRSURF(crtc->pipe));
894 error->surflive = intel_de_read(display, SPRSURFLIVE(crtc->pipe));
906 power_domain = POWER_DOMAIN_PIPE(plane->pipe);
911 ret = intel_de_read(display, SPRCTL(plane->pipe)) & SPRITE_ENABLE;
913 *pipe = plane->pipe;
923 const struct drm_framebuffer *fb = plane_state->hw.fb;
928 * Note that crtc_state->pixel_rate accounts for both
930 * Pre-HSW bspec tells us to only consider the horizontal
934 pixel_rate = crtc_state->pixel_rate;
937 hscale = drm_rect_calc_hscale(&plane_state->uapi.src,
938 &plane_state->uapi.dst,
949 /* -10% per decimation step */
950 limit -= decimate;
952 /* -10% for RGB */
953 if (!fb->format->is_yuv)
954 limit--;
957 * We should also do -10% if sprite scaling is enabled
972 int cpp = info->cpp[0];
987 int cpp = info->cpp[0];
1009 if (crtc_state->gamma_enable)
1012 if (crtc_state->csc_enable)
1022 const struct drm_framebuffer *fb = plane_state->hw.fb;
1023 unsigned int rotation = plane_state->hw.rotation;
1024 const struct drm_intel_sprite_colorkey *key = &plane_state->ckey;
1029 if (display->platform.sandybridge)
1032 switch (fb->format->format) {
1064 MISSING_CASE(fb->format->format);
1068 if (plane_state->hw.color_encoding == DRM_COLOR_YCBCR_BT709)
1071 if (plane_state->hw.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
1074 if (fb->modifier == I915_FORMAT_MOD_X_TILED)
1080 if (key->flags & I915_SET_COLORKEY_DESTINATION)
1082 else if (key->flags & I915_SET_COLORKEY_SOURCE)
1091 struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
1092 const struct drm_framebuffer *fb = plane_state->hw.fb;
1093 enum pipe pipe = plane->pipe;
1098 if (!fb->format->is_yuv)
1105 for (i = 1; i < 8 - 1; i++)
1106 intel_de_write_fw(display, DVSGAMC_G4X(pipe, i - 1),
1121 struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
1122 const struct drm_framebuffer *fb = plane_state->hw.fb;
1123 enum pipe pipe = plane->pipe;
1128 if (!fb->format->is_yuv)
1151 enum pipe pipe = plane->pipe;
1152 int crtc_x = plane_state->uapi.dst.x1;
1153 int crtc_y = plane_state->uapi.dst.y1;
1154 u32 crtc_w = drm_rect_width(&plane_state->uapi.dst);
1155 u32 crtc_h = drm_rect_height(&plane_state->uapi.dst);
1156 u32 src_w = drm_rect_width(&plane_state->uapi.src) >> 16;
1157 u32 src_h = drm_rect_height(&plane_state->uapi.src) >> 16;
1162 DVS_SRC_WIDTH(src_w - 1) |
1163 DVS_SRC_HEIGHT(src_h - 1);
1166 plane_state->view.color_plane[0].mapping_stride);
1170 DVS_HEIGHT(crtc_h - 1) | DVS_WIDTH(crtc_w - 1));
1181 enum pipe pipe = plane->pipe;
1182 const struct drm_intel_sprite_colorkey *key = &plane_state->ckey;
1183 u32 dvssurf_offset = plane_state->view.color_plane[0].offset;
1184 u32 x = plane_state->view.color_plane[0].x;
1185 u32 y = plane_state->view.color_plane[0].y;
1188 dvscntr = plane_state->ctl | g4x_sprite_ctl_crtc(crtc_state);
1192 if (key->flags) {
1193 intel_de_write_fw(display, DVSKEYVAL(pipe), key->min_value);
1195 key->channel_mask);
1196 intel_de_write_fw(display, DVSKEYMAX(pipe), key->max_value);
1204 * The control register self-arms if the plane was previously
1212 if (display->platform.g4x)
1224 enum pipe pipe = plane->pipe;
1227 /* Disable the scaler */
1238 error->ctl = intel_de_read(display, DVSCNTR(crtc->pipe));
1239 error->surf = intel_de_read(display, DVSSURF(crtc->pipe));
1240 error->surflive = intel_de_read(display, DVSSURFLIVE(crtc->pipe));
1252 power_domain = POWER_DOMAIN_PIPE(plane->pipe);
1257 ret = intel_de_read(display, DVSCNTR(plane->pipe)) & DVS_ENABLE;
1259 *pipe = plane->pipe;
1271 switch (fb->format->format) {
1288 const struct drm_framebuffer *fb = plane_state->hw.fb;
1289 const struct drm_rect *src = &plane_state->uapi.src;
1290 const struct drm_rect *dst = &plane_state->uapi.dst;
1293 &crtc_state->hw.adjusted_mode;
1294 unsigned int stride = plane_state->view.color_plane[0].mapping_stride;
1295 unsigned int cpp = fb->format->cpp[0];
1302 src_x = src->x1 >> 16;
1311 if (adjusted_mode->flags & DRM_MODE_FLAG_INTERLACE) {
1313 drm_dbg_kms(display->drm,
1315 return -EINVAL;
1326 drm_dbg_kms(display->drm,
1327 "Source dimensions (%dx%d) exceed hardware limits (%dx%d - %dx%d)\n",
1329 return -EINVAL;
1333 drm_dbg_kms(display->drm,
1336 return -EINVAL;
1340 drm_dbg_kms(display->drm,
1343 return -EINVAL;
1358 if (g4x_fb_scalable(plane_state->hw.fb)) {
1362 } else if (display->platform.ivybridge) {
1377 if (!plane_state->uapi.visible)
1389 plane_state->ctl = ivb_sprite_ctl(crtc_state, plane_state);
1391 plane_state->ctl = g4x_sprite_ctl(crtc_state, plane_state);
1399 unsigned int rotation = plane_state->hw.rotation;
1402 if (display->platform.cherryview &&
1405 drm_dbg_kms(display->drm,
1407 return -EINVAL;
1434 if (!plane_state->uapi.visible)
1441 plane_state->ctl = vlv_sprite_ctl(crtc_state, plane_state);
1619 if (display->platform.valleyview || display->platform.cherryview) {
1620 plane->update_noarm = vlv_sprite_update_noarm;
1621 plane->update_arm = vlv_sprite_update_arm;
1622 plane->disable_arm = vlv_sprite_disable_arm;
1623 plane->capture_error = vlv_sprite_capture_error;
1624 plane->get_hw_state = vlv_sprite_get_hw_state;
1625 plane->check_plane = vlv_sprite_check;
1626 plane->max_stride = i965_plane_max_stride;
1627 plane->min_alignment = vlv_plane_min_alignment;
1628 plane->min_cdclk = vlv_plane_min_cdclk;
1632 plane->vtd_guard = 128;
1634 if (display->platform.cherryview && pipe == PIPE_B) {
1644 plane->update_noarm = ivb_sprite_update_noarm;
1645 plane->update_arm = ivb_sprite_update_arm;
1646 plane->disable_arm = ivb_sprite_disable_arm;
1647 plane->capture_error = ivb_sprite_capture_error;
1648 plane->get_hw_state = ivb_sprite_get_hw_state;
1649 plane->check_plane = g4x_sprite_check;
1651 if (display->platform.broadwell || display->platform.haswell) {
1652 plane->max_stride = hsw_sprite_max_stride;
1653 plane->min_cdclk = hsw_plane_min_cdclk;
1655 plane->max_stride = g4x_sprite_max_stride;
1656 plane->min_cdclk = ivb_sprite_min_cdclk;
1659 plane->min_alignment = g4x_sprite_min_alignment;
1662 plane->vtd_guard = 64;
1669 plane->update_noarm = g4x_sprite_update_noarm;
1670 plane->update_arm = g4x_sprite_update_arm;
1671 plane->disable_arm = g4x_sprite_disable_arm;
1672 plane->capture_error = g4x_sprite_capture_error;
1673 plane->get_hw_state = g4x_sprite_get_hw_state;
1674 plane->check_plane = g4x_sprite_check;
1675 plane->max_stride = g4x_sprite_max_stride;
1676 plane->min_alignment = g4x_sprite_min_alignment;
1677 plane->min_cdclk = g4x_sprite_min_cdclk;
1680 plane->vtd_guard = 64;
1682 if (display->platform.sandybridge) {
1695 if (display->platform.cherryview && pipe == PIPE_B) {
1704 plane->pipe = pipe;
1705 plane->id = PLANE_SPRITE0 + sprite;
1706 plane->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, plane->id);
1710 ret = drm_universal_plane_init(display->drm, &plane->base,
1720 drm_plane_create_rotation_property(&plane->base,
1724 drm_plane_create_color_properties(&plane->base,
1733 drm_plane_create_zpos_immutable_property(&plane->base, zpos);