---
name: "drm_rect_calc_hscale_relaxed"
section: "9"
platform: "linux"
package: "linux-manual-3.16"
version: "3.16.56-1+deb8u1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/drm_rect_calc_hscale_relaxed"
---

# drm\_rect\_calc\_hscale\_relaxed(9)

calculate the horizontal scaling factor

## NAME

drm\_rect\_calc\_hscale\_relaxed - calculate the horizontal scaling factor

## SYNOPSIS

**int drm\_rect\_calc\_hscale\_relaxed(struct drm\_rect \*** *src***, struct drm\_rect \*** *dst***, int** *min\_hscale***, int** *max\_hscale***);**

## ARGUMENTS

*src*

source window rectangle

*dst*

destination window rectangle

*min\_hscale*

minimum allowed horizontal scaling factor

*max\_hscale*

maximum allowed horizontal scaling factor

## DESCRIPTION

Calculate the horizontal scaling factor as (*src* width) / (*dst* width).

If the calculated scaling factor is below *min\_vscale*, decrease the height of rectangle *dst* to compensate.

If the calculated scaling factor is above *max\_vscale*, decrease the height of rectangle *src* to compensate.

## RETURNS

The horizontal scaling factor.

## AUTHORS

**Jesse Barnes** \<jesse.barnes@intel.com\>\
 Intel Corporation,

Initial version

**Laurent Pinchart** \<laurent.pinchart@ideasonboard.com\>\
 Ideas on board SPRL,

Driver internals

**Daniel Vetter** \<daniel.vetter@ffwll.ch\>\
 Intel Corporation,

Contributions all over the place

## COPYRIGHT
