Skip to content

Commit dde1de0

Browse files
en4bzzackr
authored andcommitted
drm/vmwgfx: Remove STDU logic from generic mode_valid function
STDU has its own mode_valid function now so this logic can be removed from the generic version. Fixes: 935f795 ("drm/vmwgfx: Refactor drm connector probing for display modes") Signed-off-by: Ian Forbes <[email protected]> Signed-off-by: Zack Rusin <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent fb5e19d commit dde1de0

File tree

2 files changed

+9
-20
lines changed

2 files changed

+9
-20
lines changed

drivers/gpu/drm/vmwgfx/vmwgfx_drv.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,9 +1043,6 @@ void vmw_kms_cursor_snoop(struct vmw_surface *srf,
10431043
int vmw_kms_write_svga(struct vmw_private *vmw_priv,
10441044
unsigned width, unsigned height, unsigned pitch,
10451045
unsigned bpp, unsigned depth);
1046-
bool vmw_kms_validate_mode_vram(struct vmw_private *dev_priv,
1047-
uint32_t pitch,
1048-
uint32_t height);
10491046
int vmw_kms_present(struct vmw_private *dev_priv,
10501047
struct drm_file *file_priv,
10511048
struct vmw_framebuffer *vfb,

drivers/gpu/drm/vmwgfx/vmwgfx_kms.c

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2171,13 +2171,12 @@ int vmw_kms_write_svga(struct vmw_private *vmw_priv,
21712171
return 0;
21722172
}
21732173

2174+
static
21742175
bool vmw_kms_validate_mode_vram(struct vmw_private *dev_priv,
2175-
uint32_t pitch,
2176-
uint32_t height)
2176+
u64 pitch,
2177+
u64 height)
21772178
{
2178-
return ((u64) pitch * (u64) height) < (u64)
2179-
((dev_priv->active_display_unit == vmw_du_screen_target) ?
2180-
dev_priv->max_primary_mem : dev_priv->vram_size);
2179+
return (pitch * height) < (u64)dev_priv->vram_size;
21812180
}
21822181

21832182
/**
@@ -2873,25 +2872,18 @@ int vmw_du_helper_plane_update(struct vmw_du_update_plane *update)
28732872
enum drm_mode_status vmw_connector_mode_valid(struct drm_connector *connector,
28742873
struct drm_display_mode *mode)
28752874
{
2875+
enum drm_mode_status ret;
28762876
struct drm_device *dev = connector->dev;
28772877
struct vmw_private *dev_priv = vmw_priv(dev);
2878-
u32 max_width = dev_priv->texture_max_width;
2879-
u32 max_height = dev_priv->texture_max_height;
28802878
u32 assumed_cpp = 4;
28812879

28822880
if (dev_priv->assume_16bpp)
28832881
assumed_cpp = 2;
28842882

2885-
if (dev_priv->active_display_unit == vmw_du_screen_target) {
2886-
max_width = min(dev_priv->stdu_max_width, max_width);
2887-
max_height = min(dev_priv->stdu_max_height, max_height);
2888-
}
2889-
2890-
if (max_width < mode->hdisplay)
2891-
return MODE_BAD_HVALUE;
2892-
2893-
if (max_height < mode->vdisplay)
2894-
return MODE_BAD_VVALUE;
2883+
ret = drm_mode_validate_size(mode, dev_priv->texture_max_width,
2884+
dev_priv->texture_max_height);
2885+
if (ret != MODE_OK)
2886+
return ret;
28952887

28962888
if (!vmw_kms_validate_mode_vram(dev_priv,
28972889
mode->hdisplay * assumed_cpp,

0 commit comments

Comments
 (0)