On Tue, May 5, 2026 at 5:27 PM Zack Rusin <[email protected]> wrote:
>
> +
> +               if (new_state->crtc_w > cursor_max_dim ||
> +                   new_state->crtc_h > cursor_max_dim) {
> +                       drm_warn(&vmw->drm,
> +                                "Cursor dimensions (%d, %d) exceed device 
> max %u\n",
> +                                new_state->crtc_w, new_state->crtc_h,
> +                                cursor_max_dim);
> +                       return -EINVAL;
> +               }

we should probably just check against dev->mode_config.cursor_width as
this is the maximum width userspace should be setting.

> +               if (update_type == VMW_CURSOR_UPDATE_MOB) {
> +                       u32 mob_max_size =
> +                               vmw_read(vmw, SVGA_REG_MOB_MAX_SIZE);
> +                       u64 mob_size = (u64)new_state->crtc_w *
> +                                      new_state->crtc_h * sizeof(u32) +
> +                                      sizeof(SVGAGBCursorHeader);
> +
> +                       if (mob_size > mob_max_size) {
> +                               drm_warn(&vmw->drm,
> +                                        "Cursor MOB size %llu exceeds device 
> max %u\n",
> +                                        mob_size, mob_max_size);
> +                               return -EINVAL;
> +                       }
> +               }
>         }
>
>         return 0;
> --
> 2.51.0
>

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to