mirror of
https://github.com/torvalds/linux
synced 2024-10-15 07:47:34 +00:00
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: 935f795045
("drm/vmwgfx: Refactor drm connector probing for display modes")
Signed-off-by: Ian Forbes <ian.forbes@broadcom.com>
Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240521184720.767-4-ian.forbes@broadcom.com
This commit is contained in:
parent
fb5e19d2dd
commit
dde1de06bd
|
@ -1043,9 +1043,6 @@ void vmw_kms_cursor_snoop(struct vmw_surface *srf,
|
||||||
int vmw_kms_write_svga(struct vmw_private *vmw_priv,
|
int vmw_kms_write_svga(struct vmw_private *vmw_priv,
|
||||||
unsigned width, unsigned height, unsigned pitch,
|
unsigned width, unsigned height, unsigned pitch,
|
||||||
unsigned bpp, unsigned depth);
|
unsigned bpp, unsigned depth);
|
||||||
bool vmw_kms_validate_mode_vram(struct vmw_private *dev_priv,
|
|
||||||
uint32_t pitch,
|
|
||||||
uint32_t height);
|
|
||||||
int vmw_kms_present(struct vmw_private *dev_priv,
|
int vmw_kms_present(struct vmw_private *dev_priv,
|
||||||
struct drm_file *file_priv,
|
struct drm_file *file_priv,
|
||||||
struct vmw_framebuffer *vfb,
|
struct vmw_framebuffer *vfb,
|
||||||
|
|
|
@ -2171,13 +2171,12 @@ int vmw_kms_write_svga(struct vmw_private *vmw_priv,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static
|
||||||
bool vmw_kms_validate_mode_vram(struct vmw_private *dev_priv,
|
bool vmw_kms_validate_mode_vram(struct vmw_private *dev_priv,
|
||||||
uint32_t pitch,
|
u64 pitch,
|
||||||
uint32_t height)
|
u64 height)
|
||||||
{
|
{
|
||||||
return ((u64) pitch * (u64) height) < (u64)
|
return (pitch * height) < (u64)dev_priv->vram_size;
|
||||||
((dev_priv->active_display_unit == vmw_du_screen_target) ?
|
|
||||||
dev_priv->max_primary_mem : dev_priv->vram_size);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2873,25 +2872,18 @@ int vmw_du_helper_plane_update(struct vmw_du_update_plane *update)
|
||||||
enum drm_mode_status vmw_connector_mode_valid(struct drm_connector *connector,
|
enum drm_mode_status vmw_connector_mode_valid(struct drm_connector *connector,
|
||||||
struct drm_display_mode *mode)
|
struct drm_display_mode *mode)
|
||||||
{
|
{
|
||||||
|
enum drm_mode_status ret;
|
||||||
struct drm_device *dev = connector->dev;
|
struct drm_device *dev = connector->dev;
|
||||||
struct vmw_private *dev_priv = vmw_priv(dev);
|
struct vmw_private *dev_priv = vmw_priv(dev);
|
||||||
u32 max_width = dev_priv->texture_max_width;
|
|
||||||
u32 max_height = dev_priv->texture_max_height;
|
|
||||||
u32 assumed_cpp = 4;
|
u32 assumed_cpp = 4;
|
||||||
|
|
||||||
if (dev_priv->assume_16bpp)
|
if (dev_priv->assume_16bpp)
|
||||||
assumed_cpp = 2;
|
assumed_cpp = 2;
|
||||||
|
|
||||||
if (dev_priv->active_display_unit == vmw_du_screen_target) {
|
ret = drm_mode_validate_size(mode, dev_priv->texture_max_width,
|
||||||
max_width = min(dev_priv->stdu_max_width, max_width);
|
dev_priv->texture_max_height);
|
||||||
max_height = min(dev_priv->stdu_max_height, max_height);
|
if (ret != MODE_OK)
|
||||||
}
|
return ret;
|
||||||
|
|
||||||
if (max_width < mode->hdisplay)
|
|
||||||
return MODE_BAD_HVALUE;
|
|
||||||
|
|
||||||
if (max_height < mode->vdisplay)
|
|
||||||
return MODE_BAD_VVALUE;
|
|
||||||
|
|
||||||
if (!vmw_kms_validate_mode_vram(dev_priv,
|
if (!vmw_kms_validate_mode_vram(dev_priv,
|
||||||
mode->hdisplay * assumed_cpp,
|
mode->hdisplay * assumed_cpp,
|
||||||
|
|
Loading…
Reference in a new issue