diff options
author | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2011-06-06 05:27:34 +0400 |
---|---|---|
committer | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2011-07-17 04:11:15 +0400 |
commit | 936a3f770b8de7042d793272f008ef1bb08522e9 (patch) | |
tree | 3863e60ae9cf13e48ecf2bcb131c92bc9c2b848b /drivers/video/via/via_modesetting.h | |
parent | d933990c57b498c092ceef591c7c5d69dbfe9f30 (diff) | |
download | linux-936a3f770b8de7042d793272f008ef1bb08522e9.tar.xz |
viafb: improve pitch handling
This patch adds checks for minimum and maximum pitch size to prevent
invalid settings which could otherwise crash the machine. Also the
alignment is done in a slightly more readable way.
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: stable@kernel.org
Diffstat (limited to 'drivers/video/via/via_modesetting.h')
-rw-r--r-- | drivers/video/via/via_modesetting.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/video/via/via_modesetting.h b/drivers/video/via/via_modesetting.h index ae35cfdeb37c..013884543e91 100644 --- a/drivers/video/via/via_modesetting.h +++ b/drivers/video/via/via_modesetting.h @@ -28,6 +28,11 @@ #include <linux/types.h> + +#define VIA_PITCH_SIZE (1<<3) +#define VIA_PITCH_MAX 0x3FF8 + + void via_set_primary_address(u32 addr); void via_set_secondary_address(u32 addr); void via_set_primary_pitch(u32 pitch); |