drm plane fixes and additional checks

2011-11-11 Thread ville . syrjala
This set has a bunch of fixes and additional checks on top of Jesse's drm plane series. Jesse, feel free to squash some or all of these with your patches. ___ dri-devel mailing list dri-devel@lists.freedesktop.org

[PATCH 1/7] drm: Zero initialize drm_mode_fb_cmd2 in legacy addfb ioctl handler

2011-11-11 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Avoids having junk in offsets[] and pitches[] arrays. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc.c

[PATCH 2/7] drm: plane: Fix size of formats memcpy()

2011-11-11 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 7058ed3..d3b884e

[PATCH 3/7] drm: plane: Clear plane.crtc and plane.fb after disable_plane()

2011-11-11 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com These are the only indication to user space that the plane was disabled. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git

[PATCH 4/7] drm: plane: Check source coordinates

2011-11-11 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Make sure the source coordinates stay within the buffer. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc.c | 23 +++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git

[PATCH 6/7] drm: plane: Make 'formats' parameter to drm_plane_init() const

2011-11-11 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc.c |2 +- include/drm/drm_crtc.h |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc.c

[PATCH 7/7] drm: plane: Check that the fb pixel format is supported by the plane

2011-11-11 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc.c | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index

[PATCH 5/7] drm: plane: Check crtc coodrinates against integer overflows in setplane ioctl

2011-11-11 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Help drivers a little by guaranteeing that crtc_x+crtc_w and crtc_y+crtc_h don't overflow. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc.c | 12 1 files changed, 12 insertions(+), 0

[RFC][PATCH 1/7] drm: Add drm_format_num_planes() utility function

2011-11-11 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com This function returns the number of planes used by a specific pixel format. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc_helper.c | 33 + include/drm/drm_crtc.h

drm plane helper functions

2011-11-11 Thread ville . syrjala
This set intoduces a bunch of helper functions for help drm plane driver writers deal with scaling and other details. Still work in progress, escpecially the last patch. Some open questions: - In which file should this kind of stuff be placed? - How should the functions be named? - Should the

[RFC][PATCH 2/7] drm: Add drm_format_plane_cpp() utility function

2011-11-11 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com This function returns the bytes per pixel value based on the pixel format and plane index. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc_helper.c | 43 +

[RFC][PATCH 5/7] drm: Add struct drm_region and assorted utility functions

2011-11-11 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com struct drm_region represents a two dimensional region. The utility functions are there to help driver writers. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc_helper.c | 156

[RFC][PATCH 6/7] drm: Add drm_calc_{hscale, vscale}() utility functions

2011-11-11 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc_helper.c | 102 + include/drm/drm_crtc_helper.h |4 ++ 2 files changed, 106 insertions(+), 0 deletions(-) diff

[RFC][PATCH 7/7] drm: Add CSC helper stuff

2011-11-11 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc_helper.c | 48 include/drm/drm_crtc.h| 55 +

[RFC][PATCH 3/7] drm: Add drm_format_{horz, vert}_chroma_subsampling() utility functions

2011-11-11 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com These functions return the chroma subsampling factors for the specified pixel format. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc_helper.c | 67 +

[RFC][PATCH 4/7] drm: Add drm_framebuffer_check() utility function

2011-11-11 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com This function performs a battery of sanity checks on the requested framebuffer layout. Drivers can call it from their fb_create hook. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc_helper.c | 70

drm pixel formats update

2011-11-16 Thread ville . syrjala
I decided to go all out with the pixel format definitions. Added pretty much all of the possible RGB/BGR variations. Just left out ones with 16bit components and floats. Also added a whole bunch of YUV formats, and 8 bit pseudocolor for good measure. I'm sure some of the fourccs now clash with

[PATCH 1/2] drm: Add a missing ')'

2011-11-16 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com The code happened to compile because the flag wasn't actually used yet. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- include/drm/drm_mode.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git

[PATCH 2/2] drm: Redefine pixel formats

2011-11-16 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Name the formats as DRM_FORMAT_X instead of DRM_FOURCC_X. Use consistent names, especially for the RGB formats. Component order and byte order are now strictly specified for each format. The RGB format naming follows a convention where the

[PATCH v2 1/2] drm: Redefine pixel formats

2011-11-17 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Name the formats as DRM_FORMAT_X instead of DRM_FOURCC_X. Use consistent names, especially for the RGB formats. Component order and byte order are now strictly specified for each format. The RGB format naming follows a convention where the

[PATCH 01/12] drm: Add a missing ')'

2011-12-19 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com The code happened to compile because the flag wasn't actually used yet. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- include/drm/drm_mode.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git

[PATCH 04/12] drm: plane: mutex_unlock() was missing

2011-12-19 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Unlock the mode_config mutex if drm_plane_init() fails. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc.c

[PATCH 05/12] drm: Fix __user sparse warnings

2011-12-19 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Several pointers and casts were missing __user annotations. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc.c | 30 +++--- 1 files changed, 15 insertions(+), 15 deletions(-) diff

[PATCH 06/12] drm: plane: Clear plane.crtc and plane.fb after disable_plane()

2011-12-19 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com These are the only indication to user space that the plane was disabled. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com Acked-by: Jesse Barnes jbar...@virtuousgeek.org --- drivers/gpu/drm/drm_crtc.c |2 ++ 1 files changed, 2

[PATCH 07/12] drm: plane: Check source coordinates

2011-12-19 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Make sure the source coordinates stay within the buffer. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc.c | 23 +++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git

Rebased drm_plane patches

2011-12-19 Thread ville . syrjala
I rebased this set on top of drm-next. I updated some of the error values based on what Jesse suggested. I also added a few patches to fix various issues that came up since I last posted the patches. Since the patch to drop the planar formats with YVU plane order wasn't applied to drm-next, I

[PATCH 02/12] drm: Install drm_fourcc.h

2011-12-19 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Userspace needs this header. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- include/drm/Kbuild |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/include/drm/Kbuild b/include/drm/Kbuild index

[PATCH 03/12] drm: fourcc: Use __u32 instead of u32

2011-12-19 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com drm_fourcc.h can be included from user space so use the appropriate types. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- include/drm/drm_fourcc.h |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH 08/12] drm: plane: Check crtc coordinates against integer overflows in setplane ioctl

2011-12-19 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Help drivers a little by guaranteeing that crtc_x+crtc_w and crtc_y+crtc_h don't overflow. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc.c | 12 1 files changed, 12 insertions(+), 0

[PATCH 09/12] drm: plane: Make 'formats' parameter to drm_plane_init() const

2011-12-19 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc.c |2 +- include/drm/drm_crtc.h |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc.c

[PATCH 10/12] drm: plane: Check that the fb pixel format is supported by the plane

2011-12-19 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc.c | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index

[PATCH 11/12] drm: Check that the requested pixel format is valid

2011-12-19 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc.c | 75 1 files changed, 75 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc.c

[PATCH 12/12] drm: Replace pitch with pitches[] in drm_framebuffer

2011-12-19 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Otherwise each driver would need to keep the information inside their own framebuffer object structure. Also add offsets[]. BOs on the other hand are driver specific, so those can be kept in driver specific structures. Signed-off-by: Ville

Plane helpers and a new plane options ioctl

2011-12-19 Thread ville . syrjala
Here are the utility functions again. Rebased and updated slightly. I adapted drm_framebuffer_check() to handle multiple handles, and I changed some of the error values it returns. The plane options ioctl is a bit of an open question. I started by adding separate ioctls for some subsets of the

[RFC PATCH 1/8] drm: Add drm_format_num_planes() utility function

2011-12-19 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com This function returns the number of planes used by a specific pixel format. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc_helper.c | 33 + include/drm/drm_crtc_helper.h

[RFC PATCH 2/8] drm: Add drm_format_plane_cpp() utility function

2011-12-19 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com This function returns the bytes per pixel value based on the pixel format and plane index. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc_helper.c | 45 +

[RFC PATCH 3/8] drm: Add drm_format_{horz, vert}_chroma_subsampling() utility functions

2011-12-19 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com These functions return the chroma subsampling factors for the specified pixel format. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc_helper.c | 60 +

[RFC PATCH 4/8] drm: Add drm_framebuffer_check() utility function

2011-12-19 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com This function performs a battery of sanity checks on the requested framebuffer layout. Drivers can call it from their fb_create hook. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc_helper.c | 85

[RFC PATCH 6/8] drm: Add drm_calc_{hscale, vscale}() utility functions

2011-12-19 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc_helper.c | 102 + include/drm/drm_crtc_helper.h |4 ++ 2 files changed, 106 insertions(+), 0 deletions(-) diff

[RFC PATCH 7/8] drm: plane: Add plane options ioctl

2011-12-19 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Add a new ioctl DRM_IOCTL_MODE_PLANE_OPTS which is used to configure various settings for the plane. I left out gamma correction thinking that it could be added using a separate ioctl, since there's already a gamma ioctl for CRTCs.

[RFC PATCH 5/8] drm: Add struct drm_region and assorted utility functions

2011-12-19 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com struct drm_region represents a two dimensional region. The utility functions are there to help driver writers. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc_helper.c | 156

[RFC PATCH 8/8] drm: Add drm_chroma_phase_offsets() utility function

2011-12-19 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com This function is is there to help driver writers. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc_helper.c | 47 + include/drm/drm_crtc_helper.h |3 ++ 2 files

[PATCH libdrm 1/3] libdrm: Plug memory leaks

2011-12-20 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com drmModeFreeResources() always leaked some memory. drmModeGetPlaneResources() and drmModeGetPlane() leaked in one error path. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- xf86drmMode.c |6 ++ 1 files changed, 6

[PATCH libdrm 2/3] libdrm: Add drmModeFreePlaneResources()

2011-12-20 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com This function was missing. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- xf86drmMode.c |9 + xf86drmMode.h |1 + 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/xf86drmMode.c b/xf86drmMode.c index

[PATCH libdrm 3/3] libdrm: Fix AddFB2 memcpy() size

2011-12-20 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Using sizeof() on a function parameter with an array type does not work. sizeof() treats such parameters as pointers. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- xf86drmMode.c |6 +++--- 1 files changed, 3 insertions(+), 3

[PATCH] drm: edid: Add bounds checking to CEA 18 byte descriptor parsing

2012-03-01 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Make sure we don't access beyond the extension block when parsing CEA detailed timing descriptors. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_edid.c |3 +++ 1 files changed, 3 insertions(+), 0

[PATCH 01/15] drm: Reject mode set with current fb if no current fb is bound

2012-03-13 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com When doing a mode set with the special fb id -1, reject the mode set if no fb is currently bound to the crtc. Also remove the pointless list traversal to find the current crtc based on the current crtc :) Signed-off-by: Ville Syrjälä

[PATCH 03/15] drm: Warn if mode to umode conversion overflows the destination types

2012-03-13 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com When converting from a drm_display_mode to drm_mode_modeinfo, print a warning if the the timings values don't fit into the __u16 datatype. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc.c |7 +++

[PATCH 04/15] drm: Check crtc x and y coordinates

2012-03-13 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com The crtc x/y panning coordinates are stored as signed integers internally. The user provides them as unsigned, so we should check that the user provided values actually fit in the internal datatypes. Signed-off-by: Ville Syrjälä

[PATCH 05/15] drm: Make drm_mode_attachmode() void

2012-03-13 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com drm_mode_attachmode() always returns 0. Change the return type to void. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc.c | 16 +--- 1 files changed, 5 insertions(+), 11 deletions(-) diff

[PATCH 06/15] drm: Fix memory leak in drm_mode_setcrtc()

2012-03-13 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com The mode passed to the .set_config() hook was never freed. The drivers will make a copy of the mode, so simply free it when done. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc.c |9 + 1 files

[PATCH 07/15] drm: Check user mode against overflows

2012-03-13 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com The internal mode representation drm_display_mode uses signed data types. When converting the user mode to internal representation, check that the unsigned values don't overflow the signed datatypes. Signed-off-by: Ville Syrjälä

[PATCH 09/15] drm: Fix drm_mode_attachmode_crtc()

2012-03-13 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Change drm_mode_attachmode_crtc() to take an all or nothing approach. If an error is returned, there are no side effects visible. Also change the function to always duplicate the mode passed in. Also change the function to not give up when it

[PATCH 10/15] drm: Make drm_crtc_convert_{umode, to_umode} static and constify their params

2012-03-13 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com drm_crtc_convert_umode() and drm_crtc_convert_to_umode() are never used outside drm_crtc.c, so make them static. Also make the input mode structure const for both functions. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com ---

[PATCH 12/15] drm: Use a flexible array member for blob property data

2012-03-13 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com The blob property data is always allocated immediately after the object header. No need for the extra indirection when accessing it, just use a flexible array member. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com ---

[PATCH 13/15] drm: Eliminate pointless goto

2012-03-13 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Use a do {} while() loop instead of a goto in drm_mode_object_get(). Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc.c | 20 ++-- 1 files changed, 10 insertions(+), 10 deletions(-) diff

[PATCH 15/15] drm: Fix drm_mode_objecte_get() return values

2012-03-13 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Change drm_mode_object_get() to return -ENOMEM if idr_pre_get() fails, and also handle -ENOSPC from idr_get_new_above(). Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc.c |5 - 1 files changed, 4

[PATCH 00/15] drm: Bounds checking, error handling, etc.

2012-03-13 Thread ville . syrjala
Mostly fixes for various bits and pieces that caught my eye while reading the mode setting code. ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH 08/15] drm: Check CRTC viewport against framebuffer size

2012-03-13 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Make sure the requested CRTC viewport fits inside the framebuffer. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc.c | 24 1 files changed, 24 insertions(+), 0 deletions(-) diff

[PATCH 02/15] drm: Change drm_display_mode::type to unsigned

2012-03-13 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com The drm_display_mode type is a bitmask so it should be unsigned. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- include/drm/drm_crtc.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git

[PATCH 14/15] drm: Add drm_mode_copy()

2012-03-13 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Add a helper function to copy a display mode. Use it in drm_mode_duplicate() and nouveau mode_fixup hooks. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_modes.c| 28 +++-

[PATCH 11/15] drm: Handle drm_object_get() failures

2012-03-13 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Check drm_mode_object_get() return value everywhere. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc.c| 95 - drivers/gpu/drm/drm_crtc_helper.c |2 +

[PATCH] drm: Unify and fix idr error handling

2012-03-15 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com The error handling code w.r.t. idr usage looks inconsistent. In the case of drm_mode_object_get() and drm_ctxbitmap_next() the error handling is also incomplete. Unify the code to follow the same pattern always. Signed-off-by: Ville Syrjälä

[PATCH 1/4] drm: Move drm_format_num_planes() to drm_crtc.c

2012-04-05 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com There will be a need for this function in drm_crtc.c later. This avoids making drm_crtc.c depend on drm_crtc_helper.c. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc.c| 32

[PATCH 2/4] drm: Add drm_format_plane_cpp() utility function

2012-04-05 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com This function returns the bytes per pixel value based on the pixel format and plane index. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc.c | 45

[PATCH 3/4] drm: Add drm_format_{horz, vert}_chroma_subsampling() utility functions

2012-04-05 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com These functions return the chroma subsampling factors for the specified pixel format. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc.c | 60

[PATCH 4/4] drm: Add sanity checks to framebuffer creation

2012-04-05 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Perform some basic sanity check on some of the parameters in drm_mode_fb_cmd2. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc.c | 47 --- 1 files changed, 43

[PATCH 1/2] drm: exynos: Use DRM_FORMAT_{NV12, YUV420} instead of DRM_FORMAT_{NV12M, YUV420M}

2012-04-20 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com The NV12M/YUV420M formats are identical to the already existing standard NV12/YUV420 formats. The M variants will be removed, so convert the driver to use the standard names. Cc: Inki Dae inki@samsung.com Cc: Joonyoung Shim

[PATCH 2/2] drm: Drop the NV12M and YUV420M formats

2012-04-20 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com The NV12M/YUV420M formats are identical to the NV12/YUV420 formats. So just remove these duplicated format names. This might look like breaking the ABI, but the code has never actually accepted these formats, so nothing can be using them.

[PATCH 0/3] drm: A few misc patches

2012-05-24 Thread ville . syrjala
Just a few small items caught in my net while trawling the code. ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH 1/3] drm: Use stdint types for consistency

2012-05-24 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com The rest of the code uses stdint types, so use them in drm_property_change_is_valid() as well. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc.c |4 ++-- 1 files changed, 2 insertions(+), 2

[PATCH 2/3] drm: Be more paranoid with integer overflows

2012-05-24 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Make sure 'width * cpp' and 'height * pitch + offset' don't exceed UINT_MAX. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc.c | 10 +- 1 files changed, 9 insertions(+), 1 deletions(-) diff

[PATCH 3/3] drm: Constify params to format_check() and framebuffer_checks()

2012-05-24 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index e1b53fb..5fc198d

[PATCH 1/6] drm/i915: Fix display pixel format handling

2012-05-24 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Fix support for all RGB/BGR pixel formats (except the 16:16:16:16 float format). Fix intel_init_framebuffer() to match hardware and driver limitations: * RGB332 is not supported at all * CI8 is supported * XRGB1555 co. are supported on Gen3 and

[PATCH 4/6] drm/i915: Check the framebuffer offset

2012-05-24 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com The framebuffer offset must be aligned to (macro)pixel size. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/i915/intel_display.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git

[PATCH 5/6] drm/i915: Handle framebuffer offsets[]

2012-05-24 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Take fb-offset[0] into account when calculating the linear and tile x/y offsets. For non-tiled surfaces fb-offset[0] is simply added to the linear byte offset. For tiled surfaces treat fb-offsets[0] as a byte offset into the linearized view of

[PATCH 6/6] drm/i915: Reject page flips with changed format/offset/pitch

2012-05-24 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com MI display flips can't handle some changes in the framebuffer format or layout. Return an error in such cases. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/i915/intel_display.c | 13 + 1 files

[PATCH 2/6] drm/i915: Check framebuffer stride more thoroughly

2012-05-24 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Make sure the the framebuffer stride is smaller than the maximum accepted by any plane. Also when using a tiled memory make sure the object stride matches the framebuffer stride. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com ---

[PATCH 0/6] drm/i915: Framebuffer layout fixes and sanity checks

2012-05-24 Thread ville . syrjala
Add all kinds of framebuffer layout sanity checks to the code. Also the framebuffer offset wasn't properly handled, and code dealing with the primary plane pixel format was quite broken. ___ dri-devel mailing list dri-devel@lists.freedesktop.org

[PATCH 3/6] drm/i915: Zero initialize mode_cmd

2012-05-24 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Zero initialize the mode_cmd structure when creating the kernel framebuffer. Avoids having uninitialized data in offsets[0] for instance. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/i915/intel_fb.c |2 +- 1

[PATCH 0/5] drm/i915: Clip video sprites properly

2012-05-24 Thread ville . syrjala
First add a bit of helper functions to aid in the clipping duties (those patches were already posted a long time ago) and then utilize them to properly clip the video sprites to the pipe dimensions. I also threw in a few small cleanup patches dealing with the sprite code.

[PATCH 3/5] drm/i915: Implement proper clipping for video sprites

2012-05-24 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Properly clip the source when the destination gets clipped by the pipe dimensions. Sadly the video sprite hardware is rather limited so it can't do proper sub-pixel postitioning. Resort to a best effort approach, where the source coordinates are

[PATCH 4/5] drm/i915: pixel_size == cpp

2012-05-24 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Use drm_format_plane_cpp() to get 'pixel_size' in the sprite code. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/i915/intel_sprite.c | 19 +++ 1 files changed, 3 insertions(+), 16 deletions(-)

[PATCH 5/5] drm/i915: Bad pixel formats can't reach the sprite code

2012-05-24 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com The framebuffer pixel format is already checked by the common code. So there's no way an invalid format could reach the driver. So instead of falling back to a default format, call BUG(). Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com

[PATCH 1/5] drm: Add struct drm_region and assorted utility functions

2012-05-24 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com struct drm_region represents a two dimensional region. The utility functions are there to help driver writers. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc.c | 155

[PATCH 2/5] drm: Add drm_calc_{hscale, vscale}() utility functions

2012-05-24 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc.c | 102 include/drm/drm_crtc.h |4 ++ 2 files changed, 106 insertions(+), 0 deletions(-) diff --git

[PATCH 0/4] drm/i915: Make video sprites survive a modeset

2012-05-24 Thread ville . syrjala
Currently the video sprites appear to get disabled on modeset more by accient than by design. With the current API that behaviour makes very little sense to me. You first enable some plane, and then it can get disabled due to some unrelated operation. So these patches change the behaviour so

[PATCH 1/4] drm: Keep a copy of last plane coordinates

2012-05-24 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com If the update_plane() operation succeeds, make a copy of the requested src and crtc coordinates, so that the the plane may be reclipped if the display mode changed later. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com ---

[PATCH 2/4] drm: Add restore_fbdev_mode() hook to drm_fb_helper

2012-05-24 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Add an optional driver specific restore_fbdev_mode() hook to drm_fb_helper. If the driver doesn't provide the hook, drm_fb_helper_restore_fbdev_mode() is called directly as before. In this hook the driver can disable additional planes, cursors

[PATCH 3/4] drm/i915: Disable/enable planes around mode set

2012-05-24 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com When setting a display mode, disable all planes on the CRTC beforehand, and re-enable them after the new mode has been set. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/i915/intel_display.c | 48

[PATCH 4/4] drm/i915: Implement restore_fbdev_mode hook

2012-05-24 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Convert intel_fb_restore_mode to be useable as the drm_fb_helper.restore_fbdev_mode hook. This will cause all planes to be disabled when swithing back to fbcon. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com ---

[RFC][PATCH 0/6] WIP: drm: Atomic mode setting idea

2012-05-24 Thread ville . syrjala
This is some very early demo code for the atomic modesetting feature. According to my current plan there would be just one ioctl. You simply feed it an arbitrary list of object properties and the implementation will decice how it can apply those (for example, whether it can complete the operation

[RFC][PATCH 1/6] drm: Export drm_property_create_blob() and drm_property_destroy_blob()

2012-05-24 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc.c |8 +--- include/drm/drm_crtc.h |4 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc.c

[RFC][PATCH 2/6] drm: Allow signed values for range properties

2012-05-24 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Treat a range property as signed when the unsigned minimum value is larger than the unsigned maximum value. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc.c | 17 ++--- 1 files changed, 14

[RFC][PATCH 4/6] drm: Refactor object property check code

2012-05-24 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Refactor the code to check whether an object has a specific property to a new function. Signed-off-by: Ville Syrjälä ville.syrj...@linux.intel.com --- drivers/gpu/drm/drm_crtc.c | 20 ++-- 1 files changed, 14 insertions(+), 6

[RFC][PATCH 3/6] drm: Allow drm_mode_object_find() to look up an object of any type

2012-05-24 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com To avoid having to pass object types from userspace for atomic mode setting ioctl, allow drm_mode_object_find() to look up an object of any type. This will only work as long as the all object types share the ID space. Signed-off-by: Ville Syrjälä

[RFC][PATCH 5/6] WIP: drm: Atomic modeset ioctl

2012-05-24 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com First draft. The ioctl simply takes a list of object IDs and property IDs and their values. For setting values to blob properties, the property value indicates the length of the data, and the actual data is passed via another blob pointer.

[RFC][PATCH 6/6] WIP drm/i915: Atomic modeset test implementation

2012-05-24 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com Just a quick prototype to test the atomic modeset API. Implemented via already existing non-atomic mechanisms internally. --- drivers/gpu/drm/i915/Makefile|1 + drivers/gpu/drm/i915/intel_atomic.c | 788

[RFC][PATCH 1/2] libkms: YUYV support

2012-05-25 Thread ville . syrjala
From: Ville Syrjälä ville.syrj...@linux.intel.com --- libkms/intel.c |6 +- libkms/libkms.h |2 ++ 2 files changed, 7 insertions(+), 1 deletions(-) diff --git a/libkms/intel.c b/libkms/intel.c index 8b8249b..8aeb6ae 100644 --- a/libkms/intel.c +++ b/libkms/intel.c @@ -52,7 +52,7 @@

[RFC][PATCH 0/10] Atomic modesetting v2

2012-06-27 Thread ville . syrjala
Second version of the atomic mode setting work. Still very much work in progress. I decided that I can't afford to fight the drm_crtc_helper architecture due to the sheer amount of driver code depending on it. So I changed the code to do things in way that more closely matches drm_crtc_helper.

  1   2   3   4   5   6   7   8   9   >