[PATCH v2 9/9] drm/i915: Add render decompression support

2017-01-05 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä SKL+ display engine can scan out certain kinds of compressed surfaces produced by the render engine. This involved telling the display engine the location of the color control surfae (CCS) which describes which parts of the main surface are compressed and which are not. The

[PATCH 9/9] drm/i915: Add render decompression support

2017-01-04 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä SKL+ display engine can scan out certain kinds of compressed surfaces produced by the render engine. This involved telling the display engine the location of the color control surfae (CCS) which describes which parts of the main surface are compressed and which are not. The

[PATCH 8/9] drm/i915: Implement .get_format_info() hook for CCS

2017-01-04 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä SKL+ display engine can scan out certain kinds of compressed surfaces produced by the render engine. This involved telling the display engine the location of the color control surfae (CCS) which describes which parts of the main surface are compressed and which are not. The

[PATCH 7/9] drm/i915: Use DRM_DEBUG_KMS() for framebuffer failure debug messages

2017-01-04 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä DRM_UT_CORE generates way too much noise usually, so having the framebuffer init failures use DRM_UT_CORE is a pain when trying to find out the reason why you failed in creating a framebuffer. Let's use DRM_UT_KMS for these debug messages instead. Signed-off-by: Ville SyrjÃ

[PATCH 6/9] drm/i915: Pass the correct plane index to _intel_compute_tile_offset()

2017-01-04 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä intel_fill_fb_info() should pass the correct plane index to _intel_compute_tile_offset() once we start to care about the AUX surface. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 5/9] drm/i915: Fix Yf tile width

2017-01-04 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Based on empirical evidence the display engine (at least) always treats Yf tiles as 128Bx32. Currently we're assuming the tile dimensions change based on the pixel format. Let's adjust our code to match the hardware. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915

[PATCH 4/9] drm/i915: Avoid div-by-zero when computing aux_stride w/o an aux plane

2017-01-04 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä To make life easier let's allow skl_plane_stride() to be called for the AUX surface even when there is no AUX surface. Avoids special cases in the callers. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_display.c | 7 ++- 1 file changed, 6 insertions(+)

[PATCH 3/9] drm/i915: Move nv12 chroma plane handling into intel_surf_alignment()

2017-01-04 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Let's try to keep the alignment requirements in one place, and so towards that end let's move the AUX_DIST alignment handling into intel_surf_alignment() alongside the main surface alignment stuff. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_display.c |

[PATCH 2/9] drm/i915: Plumb drm_framebuffer into more places

2017-01-04 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Now that framebuffers can be used even before calling drm_framebuffer_init() we can start to plumb them into more places, instead of passing individual pieces for fb metadata. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_display.c | 127 +++---

[PATCH 1/9] drm: Add mode_config .get_format_info() hook

2017-01-04 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Allow drivers to return a custom drm_format_info structure for special fb layouts. We'll use this for the compression control surface in i915. v2: Fix drm_get_format_info() kernel doc (Laurent) Don't pass 'dev' to the new hook (Laurent) Cc: Laurent Pinchart Cc: Ben Wi

[PATCH 0/9] drm/i915: SKL+ render decompression support

2017-01-04 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä This series enables the SKL+ display engine render decompression support. Some bits and pieces of the i915 code are based on work from various people, but I just put my name on it since it would be hard to figure out which parts came from where. Entire series available here

[PATCH] drm: Fix kernel docs for drm_helper_mode_fill_fb_struct()

2016-12-15 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä drm_modeset_helper.c:74: warning: No description found for parameter 'dev' Cc: Laurent Pinchart Cc: Alex Deucher Fixes: a3f913ca9892 ("drm: Pass 'dev' to drm_helper_mode_fill_fb_struct()") Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_modeset_helper.c | 1 + 1

[PATCH] drm/cma: Fix compile fail due to fomat->format typo

2016-12-15 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Apparently my arm .config had reverted to CMA=n at some point, so I failed to notice that I typoed the code. Fix it up so that the cma helper will compile again. Reported-by: kbuild test robot Cc: Laurent Pinchart Fixes: ca984a998ad3 ("drm/fb_cma_helper: Replace drm_forma

[PATCH v3 33/37] drm: Nuke fb->pixel_format

2016-12-14 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Replace uses of fb->pixel_format with fb->format->format. Less duplicated information is a good thing. Note that coccinelle failed to eliminate the "/* fourcc format */" comment from drm_framebuffer.h, so I had to do that part manually. @@ struct drm_framebuffer *FB; expre

[PATCH v3 32/37] drm: Nuke fb->bits_per_pixel

2016-12-14 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Replace uses of fb->bits_per_pixel with fb->format->cpp[0]*8. Less duplicated information is a good thing. Note that I didn't put parens around the cpp*8 in the below cocci script, on account of not wanting spurious parens all over the place. Instead I did the unsafe way, a

[PATCH v2 31/37] drm: Nuke fb->depth

2016-12-14 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Replace uses of fb->depth with fb->format->depth. Less duplicate information is a good thing. @@ struct drm_framebuffer *fb; expression E; @@ drm_helper_mode_fill_fb_struct(...) { ... - fb->depth = E; ... } @@ struct nouveau_framebuffer *fb; @@ - fb

[PATCH v2 25/37] drm: Replace drm_format_plane_cpp() with fb->format->cpp[]

2016-12-14 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Replace drm_format_plane_cpp(fb->pixel_format) with just fb->format->cpp[]. Avoids the expensive format info lookup. @@ struct drm_framebuffer *a; struct drm_framebuffer b; expression E; @@ ( - drm_format_plane_cpp(a->pixel_format, E) + a->format->cpp[E] | - drm_format_plan

[PATCH v2 23/37] drm: Replace drm_format_num_planes() with fb->format->num_planes

2016-12-14 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Replace drm_format_num_planes(fb->pixel_format) with just fb->format->num_planes. Avoids the expensive format info lookup. @@ struct drm_framebuffer *a; struct drm_framebuffer b; @@ ( - drm_format_num_planes(a->pixel_format) + a->format->num_planes | - drm_format_num_planes

[PATCH v2 13/37] drm: Pass 'dev' to drm_helper_mode_fill_fb_struct()

2016-12-14 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Pass the drm_device to drm_helper_mode_fill_fb_struct() so that we can populate fb->dev early. Will make it easier to use the fb before we register it. @@ identifier fb, mode_cmd; @@ void drm_helper_mode_fill_fb_struct( +struct drm_devic

[PATCH] drm/atomic: Constify drm_atomic_crtc_needs_modeset()

2016-11-24 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä drm_atomic_crtc_needs_modeset() doesn't change the passed in crtc state, so pass it as const. Signed-off-by: Ville Syrjälä --- include/drm/drm_atomic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.

[PATCH v2 12/37] drm/vmwgfx: Populate fb->dev before drm_framebuffer_init()

2016-11-22 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä drm_framebuffer_init() will start to check that fb->dev is already populated, so let's do that manually since vmwgfx isn't using drm_helper_mode_fill_fb_struct(). v2: s/to/do/ (Sinclair) Cc: linux-graphics-maintainer at vmware.com Cc: Sinclair Yeh Cc: Thomas Hellstrom Si

[PATCH v2 36/37] drm: Add mode_config .get_format_info() hook

2016-11-22 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Allow drivers to return a custom drm_format_info structure for special fb layouts. We'll use this for the compression control surface in i915. v2: Fix drm_get_format_info() kernel doc (Laurent) Don't pass 'dev' to the new hook (Laurent) Cc: Laurent Pinchart Cc: Ben Wi

[PATCH 37/37] drm/i915: Implement .get_format_info() hook for CCS

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä By providing our own format information for the CCS formats, we should be able to make framebuffer_check() do the right thing for the CCS surface as well. Note that we'll return the same format info for both Y and Yf tiled format as that's what happens with the non-CCS Y vs

[PATCH 36/37] drm: Add mode_config .get_format_info() hook

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Allow drivers to return a custom drm_format_info structure for special fb layouts. We'll use this for the compression control surface in i915. Cc: Ben Widawsky Cc: intel-gfx at lists.freedesktop.org Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_fb_cma_helper.c

[PATCH 35/37] drm: Eliminate the useless "non-RGB fb" debug message

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä No point in spamming the log whenever a non-RGB fb is being constructed. And since there's nothing to do anymore that fb->bits_per_pixel and fb->depth are gone, we can just kill off this entire piece of code. Cc: Laurent Pinchart Suggested-by: Laurent Pinchart Signed-off-

[PATCH 34/37] drm: Replace 'format->format' comparisons to just 'format' comparisons

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Rather than compare the format u32s of two format infos, we can direclty compare the format info pointers themselves. Noramlly all the ->format pointers all point to somwehere in the big array, so this is a valid way to test for equality. Also drivers may want to point ->fo

[PATCH v2 33/37] drm: Nuke fb->pixel_format

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Replace uses of fb->pixel_format with fb->format->format. Less duplicated information is a good thing. Note that coccinelle failed to eliminate the "/* fourcc format */" comment from drm_framebuffer.h, so I had to do that part manually. @@ struct drm_framebuffer *fb; expre

[PATCH v2 32/37] drm: Nuke fb->bits_per_pixel

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Replace uses of fb->bits_per_pixel with fb->format->cpp[0]*8. Less duplicated information is a good thing. Note that I didn't put parens around the cpp*8 in the below cocci script, on account of not wanting spurious parens all over the place. Instead I did the unsafe way, a

[PATCH 31/37] drm: Nuke fb->depth

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Replace uses of fb->depth with fb->format->depth. Less duplicate information is a good thing. @@ struct drm_framebuffer *fb; expression E1, E2; @@ drm_helper_mode_fill_fb_struct(...) { ... - fb->depth = E1; ... } @@ struct vmw_framebuffer_surface *v

[PATCH 30/37] drm/i915: Use drm_framebuffer_plane_{width, height}() where possible

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Replace drm_format_plane_{width,height}() usage with drm_framebuffer_plane_{width,height}() to avoid the lookup of the format info. Cc: intel-gfx at lists.freedesktop.org Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_display.c | 5 ++--- 1 file changed, 2

[PATCH 29/37] drm: Add drm_framebuffer_plane_{width,height}()

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Add variants of drm_format_plane_{width,height}() that take an entire fb object instead of just the format. These should be more efficent as they can just look up the format info from the fb->format pointer rather than having to look it up (using a linear search based on the

[PATCH 28/37] drm/i915: Store a pointer to the pixel format info for fbc

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Rather than store the pixel format and look up the format info as needed, let's just store a pointer to the format info directly and speed up our lookups. Cc: Paulo Zanoni Cc: intel-gfx at lists.freedesktop.org Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/i91

[PATCH 27/37] drm/nouveau: Use fb->format rather than drm_format_info()

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Let's use the pointer to the format information cached under drm_framebuffer rather than look it up manually. Cc: Ben Skeggs Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/nouveau/nv50_display.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff

[PATCH 26/37] drm/fb_cma_helper: Replace drm_format_info() with fb->format

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Get the format information via the neat fb->format pointer rather than doing a linear search over all the format info structures. Signed-off-by: Ville Syrjälä Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/drm_fb_cma_helper.c | 5 + 1 file changed, 1 insertion(+

[PATCH 25/37] drm: Replace drm_format_plane_cpp() with fb->format->cpp[]

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Replace drm_format_plane_cpp(fb->pixel_format) with just fb->format->cpp[]. Avoids the expensive format info lookup. @@ struct drm_framebuffer *a; struct drm_framebuffer b; expression E; @@ ( - drm_format_plane_cpp(a->pixel_format, E) + a->format->cpp[E] | - drm_format_plan

[PATCH 24/37] drm/i915: Eliminate the ugly 'fb?:' constructs from the ilk/skl wm code

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Don't access plane_state->fb until we know the plane to be visible. It it's visible, it will have an fb, and thus we don't have to consider the NULL fb case. Makes the code look nicer. Cc: intel-gfx at lists.freedesktop.org Signed-off-by: Ville Syrjälä --- drivers/gpu/d

[PATCH 23/37] drm: Replace drm_format_num_planes() with fb->format->num_planes

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Replace drm_format_num_planes(fb->pixel_format) with just fb->format->num_planes. Avoids the expensive format info lookup. @@ struct drm_framebuffer *a; struct drm_framebuffer b; @@ ( - drm_format_num_planes(a->pixel_format) + a->format->num_planes | - drm_format_num_planes

[PATCH 22/37] drm: Reject fbs w/o format info in drm_framebuffer_init()

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Any framebuffer that doesn't have proper format information when drm_framebuffer_init() is called is a bug. Let's warn and return an error to avoid oopsing the kernel later due to dereferencing the NULL fb->format pointer. Cc: Laurent Pinchart Suggested-by: Laurent Pinchar

[PATCH 21/37] drm/i915: Populate fb->format early for inherited fbs

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Make sure the framebuffer format info is available as early as possible for fbs we inherit from the BIOS. This will allow us to use the fb as if it was fully formed before we register it. Cc: intel-gfx at lists.freedesktop.org Signed-off-by: Ville Syrjälä --- drivers/gp

[PATCH 20/37] drm/vmwgfx: Populate fb->format correctly

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Populate the fb->format to point at the correct format information structure. Cc: linux-graphics-maintainer at vmware.com Cc: Sinclair Yeh Cc: Thomas Hellstrom Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 2 ++ 1 file changed, 2 insertions(+)

[PATCH v2 19/37] drm: Store a pointer to drm_format_info under drm_framebuffer

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä To avoid having to look up the format information struct every time, let's just store a pointer to it under drm_framebuffer. v2: Don't populate the fb->format pointer in drm_framebuffer_init(). instead we'll treat a NULL format as an error later Cc: Laurent Pinchart S

[PATCH v2 18/37] drm: Populate fb->dev from drm_helper_mode_fill_fb_struct()

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Populating fb->dev before drm_framebuffer_init() allows us to use fb->dev already while validating the framebuffer. Let's have drm_helper_mode_fill_fb_struct() do that for us. Also make drm_framebuffer_init() warn us if a different device pointer is passed to it than was pa

[PATCH 17/37] drm/i915: Set fb->dev early on for inherited fbs

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä We want the fbs inherited from the BIOS to be more or less fully working prior to actually registering them. This will allow us to just pass the fb to various helper function instead of having to pass all the different parameters separately. Cc: intel-gfx at lists.freedeskt

[PATCH 16/37] drm/virtio: Call drm_helper_mode_fill_fb_struct() before drm_framebuffer_init()

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä We want framebuffers to be mostly useable already before drm_framebuffer_init() get called, and so we will start demanding that all the interesting format/size/etc. information be filled in before drm_framebuffer_init(). drm_helper_mode_fill_fb_struct() will do that for us,

[PATCH 15/37] drm/qxl: Call drm_helper_mode_fill_fb_struct() before drm_framebuffer_init()

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä We want framebuffers to be mostly useable already before drm_framebuffer_init() is called, and so we will start demanding that all the interesting format/size/etc. information be filled in before drm_framebuffer_init(). drm_helper_mode_fill_fb_struct() will do that for us, s

[PATCH 14/37] drm/vmwgfx: Populate fb->pixel_format

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Stuff something semi-reasonable into fb->pixel_format. I had to guess as to which formats we should pick. Did I guess correctly? We can't quite use drm_mode_legacy_fb_format() due to the ARGB1555 vs. XRGB155 mess. However use of 'A' formats should imply per-pixel alpha blen

[PATCH 13/37] drm: Pass 'dev' to drm_helper_mode_fill_fb_struct()

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Pass the drm_device to drm_helper_mode_fill_fb_struct() so that we can populate fb->dev early. Will make it easier to use the fb before we register it. @@ identifier fb, mode_cmd; @@ void drm_helper_mode_fill_fb_struct( +struct drm_devic

[PATCH 12/37] drm/vmwgfx: Populate fb->dev before drm_framebuffer_init()

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä drm_framebuffer_init() will start to check that fb->dev is already populated, so let's to that manually since vmwgfx isn't using drm_helper_mode_fill_fb_struct(). Cc: linux-graphics-maintainer at vmware.com Cc: Sinclair Yeh Cc: Thomas Hellstrom Signed-off-by: Ville Syrjä

[PATCH 11/37] drm/nouveau: Add local 'fb' variables

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Add a local 'fb' variable to a few places to get rid of the 'crtc->primary->fb' stuff. Looks neater and helps me with my poor coccinelle skills later. Cc: Ben Skeggs Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/nouveau/dispnv04/crtc.c | 5 +++-- drivers/gpu/drm/nou

[PATCH 10/37] drm/nouveau: Fix crtc->primary->fb vs. drm_fb fail

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä So it looks like the code is trying to pick between the passed in fb and crtc->primary->fb based on that funky 'bool atomic'. But later it will mix uses of both drm_fb (which was picked by the aforementioned logic) and crtc->primary->fb. So looks like a bug to me. Let's make

[PATCH 09/37] drm/arm: Add local 'fb' variables

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Add a local 'fb' variable to a few places to get rid of the 'crtc->primary->fb' stuff. Looks neater and helps me with my ppor coccinelle skills later. In some places the local variable was already there, just not used consistently. Cc: Liviu Dudau Cc: Brian Starkey Cc: M

[PATCH 08/37] drm/arcpgu: Add local 'fb' variables

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Add a local 'fb' variable to a few places to get rid of the 'crtc->primary->fb' stuff. Looks neater and helps me with my ppor coccinelle skills later. Cc: Alexey Brodkin Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/arc/arcpgu_crtc.c | 3 ++- 1 file changed, 2 inser

[PATCH 07/37] drm/cirrus: Add some local 'fb' variables

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Add a local 'fb' variable to a few places to get rid of the 'crtc->primary->fb' stuff. Looks neater and helps me with my poor coccinelle skills later. Cc: Dave Airlie Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/cirrus/cirrus_mode.c | 9 + 1 file changed, 5

[PATCH 06/37] drm/gma500: Add some local 'fb' variables

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Add a local 'fb' variable to a few places to get rid of the 'crtc->primary->fb' stuff. Looks neater and helps me with my poor coccinelle skills later. Cc: Patrik Jakobsson Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/gma500/gma_display.c | 13 +++--

[PATCH 05/37] drm/ast: Add local 'fb' variables

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Add a local 'fb' variable to a few places to get rid of the 'crtc->primary->fb' stuff. Looks neater and helps me with my poor coccinelle skills later. Cc: Dave Airlie Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/ast/ast_mode.c | 15 ++- 1 file changed,

[PATCH 04/37] drm/mgag200: Add local 'fb' variable

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Add a local 'fb' variable to a few places to get rid of the 'crtc->primary->fb' stuff. Looks neater and helps me with my poor coccinelle skills later. Cc: Dave Airlie Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/mgag200/mgag200_mode.c | 17 + 1 file

[PATCH 03/37] drm/radeon: Use DIV_ROUND_UP()

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Use DIV_ROUND_UP() instead of hand rolling it. Just a drive-by change. Cc: Alex Deucher Cc: "Christian König" Signed-off-by: Ville Syrjälä Reviewed-by: Alex Deucher --- drivers/gpu/drm/radeon/radeon_legacy_crtc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletio

[PATCH 02/37] drm/radeon: Add local 'fb' variables

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Add a local 'fb' variable to a few places to get rid of the 'crtc->primary->fb' stuff. Looks neater and helps me with my poor coccinelle skills later. Cc: Alex Deucher Cc: "Christian König" Signed-off-by: Ville Syrjälä Reviewed-by: Alex Deucher --- drivers/gpu/drm/r

[PATCH 01/37] drm/i915: Add local 'fb' variables

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Add a local 'fb' variable to a few places to get rid of the 'crtc->primary->fb' stuff. Looks neater and helps me with my poor coccinelle skills later. While at it switch over to using the pixel format rather than depth+bpp. Cc: intel-gfx at lists.freedesktop.org Signed-off

[PATCH v2 00/37] drm: Deduplicate fb format information (v2)

2016-11-18 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Second installment of my effort to remove the duplicated depth/bpp/pixel_format from drm_framebuffer and just use struct drm_format_info instead. I tried to address all of the review feedback, and collect up all the r-bs I already got. Thanks for the review, guys. Changes

[PATCH v2 31/32] drm: Nuke fb->bits_per_pixel

2016-11-17 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Replace uses of fb->bits_per_pixel with fb->format->cpp[0]*8. Less duplicated information is a good thing. Note that I didn't put parens around the cpp*8 in the below cocci script, on account of not wanting spurious parens all over the place. Instead I did the unsafe way, a

[PATCH 32/32] drm: Nuke fb->pixel_format

2016-11-17 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Replace uses of fb->bits_per_pixel with fb->format->format. Less duplicated information is a good thing. Note that coccinelle failed to eliminate the "/* fourcc format */" comment from drm_framebuffer.h, so I had to do that part manually. @@ struct drm_framebuffer *fb; exp

[PATCH 31/32] drm: Nuke fb->bits_per_pixel

2016-11-17 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Replace uses of fb->bits_per_pixel with fb->format->cpp[0]*8. Less duplicated information is a good thing. Note that I didn't put parens around the cpp*8 in the below cocci script, on account of not wanting spurious parens all over the place. Instead I did the unsafe way, a

[PATCH 30/32] drm: Nuke fb->depth

2016-11-17 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Replace uses of fb->depth with fb->format->depth. Less duplicate information is a good thing. @@ struct drm_framebuffer *fb; expression E1, E2; @@ drm_helper_mode_fill_fb_struct(...) { ... - fb->depth = E1; ... } @@ struct vmw_framebuffer_surface *v

[PATCH 29/32] drm/i915: Use drm_framebuffer_plane_{width, height}() where possible

2016-11-17 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Replace drm_format_plane_{width,height}() usage with drm_framebuffer_plane_{width,height}() to avoid the lookup of the format info. Cc: intel-gfx at lists.freedesktop.org Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_display.c | 5 ++--- 1 file changed, 2

[PATCH 28/32] drm: Add drm_framebuffer_plane_{width,height}()

2016-11-17 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Add variants of drm_format_plane_{width,height}() that take an entire fb object instead of just the format. These should be more efficent as they can just look up the format info from the fb->format pointer rather than having to look it up (using a linear search based on the

[PATCH 27/32] drm/i915: Replace drm_format_num_planes() with fb->format->num_planes

2016-11-17 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä No need to look up the format info to get the number of planes, just use fb->format->num_planes directly. Cc: intel-gfx at lists.freedesktop.org Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH 26/32] drm/i915: Replace drm_format_plane_cpp() with fb->format->cpp[]

2016-11-17 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Avoid the fb format information lookups when we already have the fb->format pointer at hand. @@ struct drm_framebuffer *fb; expression E; @@ - drm_format_plane_cpp(fb->pixel_format, E) + fb->format->cpp[E] @@ struct drm_framebuffer fb; expression E; @@ - drm_format_plane_c

[PATCH 25/32] drm/i915: Store a pointer to the pixel format info for fbc

2016-11-17 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Rather than store the pixel format and look up the format info as needed, let's just store a pointer to the format info directly and speed up our lookups. Cc: Paulo Zanoni Cc: intel-gfx at lists.freedesktop.org Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/i91

[PATCH 24/32] drm/nouveau: Use fb->format rather than drm_format_info()

2016-11-17 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Let's use the pointer to the format information cached under drm_framebuffer rather than look it up manually. Cc: Ben Skeggs Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/nouveau/nv50_display.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff

[PATCH 23/32] drm/fb_cma_helper: Replace drm_format_info() with fb->format

2016-11-17 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Get the format information via the neat fb->format pointer rather than doing a linear search over all the format info structures. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_fb_cma_helper.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a

[PATCH 22/32] drm/atomic: Replace drm_format_num_planes() with fb->format->num_planes

2016-11-17 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Avoid the format info lookup and just use the pointer stored under drm_framebuffer. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_atomic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomi

[PATCH 21/32] drm/i915: Populate fb->format early for inherited fbs

2016-11-17 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä MAke sure the framebuffer format info is available as early as possible for fbs we inherit from the BIOS. This will allow us to use the fb as if it was fully formed before we register it. Cc: intel-gfx at lists.freedesktop.org Signed-off-by: Ville Syrjälä --- drivers/gp

[PATCH 20/32] drm/vmwgfx: Populate fb->format correctly

2016-11-17 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Populate the fb->format to point at the correct format information structure. Cc: linux-graphics-maintainer at vmware.com Cc: Sinclair Yeh Cc: Thomas Hellstrom Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 2 ++ 1 file changed, 2 insertions(+)

[PATCH 19/32] drm: Store a pointer to drm_format_info under drm_framebuffer

2016-11-17 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä To avoid having to look up the format information struct every time, let's just store a pointer to it under drm_framebuffer. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_framebuffer.c| 4 +++- drivers/gpu/drm/drm_modeset_helper.c | 1 + include/drm/drm_frame

[PATCH 18/32] drm: Populate fb->dev from drm_helper_mode_fill_fb_struct()

2016-11-17 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Populating fb->dev before drm_framebuffer_init() allows us to use fb->dev already while validating the framebuffer. Let's have drm_helper_mode_fill_fb_struct() do that for us. Also make drm_framebuffer_init() warn us if a different device pointer is passed to it than was pa

[PATCH 17/32] drm/i915: Set fb->dev early on for inherited fbs

2016-11-17 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä We want the fbs inherited from the BIOS to be more or less fully working prior to actually registering them. This will allow us to just pass the fb to various helper function instead of having to pass all the different parameters separately. Cc: intel-gfx at lists.freedeskt

[PATCH 16/32] drm/virtio: Call drm_helper_mode_fill_fb_struct() before drm_framebuffer_init()

2016-11-17 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä We want framebuffers to be mostly useable already before drm_framebuffer_init() get called, and so we will start demanding that all the interesting format/size/etc. information be filled in before drm_framebuffer_init(). drm_helper_mode_fill_fb_struct() will do that for us,

[PATCH 15/32] drm/qxl: Call drm_helper_mode_fill_fb_struct() before drm_framebuffer_init()

2016-11-17 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä We want framebuffers to be mostly useable already before drm_framebuffer_init() is called, and so we will start demanding that all the interesting format/size/etc. information be filled in before drm_framebuffer_init(). drm_helper_mode_fill_fb_struct() will do that for us, s

[PATCH 14/32] drm/vmwgfx: Populate fb->pixel_format

2016-11-17 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Stuff something semi-reasonable into fb->pixel_format. I had to guess as to which formats we should pick. Did I guess correctly? We can't quite use drm_mode_legacy_fb_format() due to the ARGB1555 vs. XRGB155 mess. However use of 'A' formats should imply per-pixel alpha blen

[PATCH 13/32] drm: Pass 'dev' to drm_helper_mode_fill_fb_struct()

2016-11-17 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Pass the drm_device to drm_helper_mode_fill_fb_struct() so that we can populate fb->dev early. Will make it easier to use the fb before we register it. @@ identifier fb, mode_cmd; @@ void drm_helper_mode_fill_fb_struct( +struct drm_devic

[PATCH 12/32] drm/vmwgfx: Populate fb->dev before drm_framebuffer_init()

2016-11-17 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä drm_framebuffer_init() will start to check that fb->dev is already populated, so let's to that manually since vmwgfx isn't using drm_helper_mode_fill_fb_struct(). Cc: linux-graphics-maintainer at vmware.com Cc: Sinclair Yeh Cc: Thomas Hellstrom Signed-off-by: Ville Syrjä

[PATCH 11/32] drm/nouveau: Add local 'fb' variables

2016-11-17 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Add a local 'fb' variable to a few places to get rid of the 'crtc->primary->fb' stuff. Looks neater and helps me with my poor coccinelle skills later. Cc: Ben Skeggs Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/nouveau/dispnv04/crtc.c | 5 +++-- drivers/gpu/drm/nou

[PATCH 10/32] drm/nouveau: Fix crtc->primary->fb vs. drm_fb fail

2016-11-17 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä So it looks like the code is trying to pick between the passed in fb and crtc->primary->fb based on that funky 'bool atomic'. But later it will mix uses of both drm_fb (which was picked by the aforementioned logic) and crtc->primary->fb. So looks like a bug to me. Let's make

[PATCH 09/32] drm/arm: Add local 'fb' variables

2016-11-17 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Add a local 'fb' variable to a few places to get rid of the 'crtc->primary->fb' stuff. Looks neater and helps me with my ppor coccinelle skills later. In some places the local variable was already there, just not used consistently. Cc: Liviu Dudau Cc: Brian Starkey Cc: M

[PATCH 08/32] drm/arcpgu: Add local 'fb' variables

2016-11-17 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Add a local 'fb' variable to a few places to get rid of the 'crtc->primary->fb' stuff. Looks neater and helps me with my ppor coccinelle skills later. Cc: Alexey Brodkin Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/arc/arcpgu_crtc.c | 3 ++- 1 file changed, 2 inser

[PATCH 07/32] drm/cirrus: Add some local 'fb' variables

2016-11-17 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Add a local 'fb' variable to a few places to get rid of the 'crtc->primary->fb' stuff. Looks neater and helps me with my poor coccinelle skills later. Cc: Dave Airlie Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/cirrus/cirrus_mode.c | 9 + 1 file changed, 5

[PATCH 06/32] drm/gma500: Add some local 'fb' variables

2016-11-17 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Add a local 'fb' variable to a few places to get rid of the 'crtc->primary->fb' stuff. Looks neater and helps me with my poor coccinelle skills later. Cc: Patrik Jakobsson Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/gma500/gma_display.c | 13 +++--

[PATCH 05/32] drm/ast: Add local 'fb' variables

2016-11-17 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Add a local 'fb' variable to a few places to get rid of the 'crtc->primary->fb' stuff. Looks neater and helps me with my poor coccinelle skills later. Cc: Dave Airlie Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/ast/ast_mode.c | 15 ++- 1 file changed,

[PATCH 04/32] drm/mgag200: Add local 'fb' variable

2016-11-17 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Add a local 'fb' variable to a few places to get rid of the 'crtc->primary->fb' stuff. Looks neater and helps me with my poor coccinelle skills later. Cc: Dave Airlie Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/mgag200/mgag200_mode.c | 17 + 1 file

[PATCH 03/32] drm/radeon: Use DIV_ROUND_UP()

2016-11-17 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Use DIV_ROUND_UP() instead of hand rolling it. Just a drive-by change. Cc: Alex Deucher Cc: "Christian König" Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/radeon/radeon_legacy_crtc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers

[PATCH 02/32] drm/radeon: Add local 'fb' variables

2016-11-17 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Add a local 'fb' variable to a few places to get rid of the 'crtc->primary->fb' stuff. Looks neater and helps me with my poor coccinelle skills later. Cc: Alex Deucher Cc: "Christian König" Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/radeon/r100.c

[PATCH 01/32] drm/i915: Add local 'fb' variables

2016-11-17 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Add a local 'fb' variable to a few places to get rid of the 'crtc->primary->fb' stuff. Looks neater and helps me with my poor coccinelle skills later. While at it switch over to using the pixel format rather than depth+bpp. Cc: intel-gfx at lists.freedesktop.org Signed-off

[PATCH 00/32] drm: Deduplicate fb format information

2016-11-17 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä This series aims to remove the duplicated format information stored under drm_framebuffer (depth,bits_per_pixel,pixel_format), and instead we just use the drm_format_info structure. And we store a pointer to the approriate drm_format_info under drm_framebuffer so that we don

[RFC][PATCH] drm: Nuke modifier[1-3]

2016-11-16 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä It has been suggested that having per-plane modifiers is making life more difficult for userspace, so let's just retire modifier[1-3] and use modifier[0] to apply to the entire framebuffer. Obviosuly this means that if individual planes need different tiling layouts and wha

[PATCH] drm/uapi: Add a warning that mode flags must match the xrandr definitions

2016-11-03 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Existing userspace expected the mode flags to match the xrandr definitions 1:1, and even adding new flags in he previously unused bits is likely to break existing userspace. Add a comment warning people about this potential trap. Cc: Shashank Sharma Cc: "Lin, Jia" Cc: Aka

[PATCH 2/2] drm/edid: Consider alternate cea timings to be the same VIC

2016-11-03 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä CEA-861 specifies that the vertical front porch may vary by one or two lines for specific VICs. Up to now we've only considered a mode to match the VIC if it matched the shortest possible vertical front porch length (as that is the variant we store in cea_modes[]). Let's all

[PATCH 1/2] drm/edid: Add the missing "Hz" to VIC 58,59 comment

2016-11-03 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä All the VICs apart from 58 and 59 have the word "Hz" included in the comment. Include it for 59 and 59 as well. Cc: Shashank Sharma Cc: Andrzej Hajda Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_edid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[PATCH 2/2] Revert "drm: Add aspect ratio parsing in DRM layer"

2016-11-03 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä This reverts commit 6dffd431e2296cda08e7e4f0242e02df1d1698cd. Adding new mode flags willy nilly breaks existing userspace. We need to coordinate this better, potentially with a new client cap that only exposes the aspect ratio flags when userspace is prepared for them (simi

[PATCH 1/2] Revert "drm: Add and handle new aspect ratios in DRM layer"

2016-11-03 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä This reverts commit a68362fe3e84fcbedd49939aa200519aa5410135. Adding new mode flags willy nilly breaks existing userspace. We need to coordinate this better, potentially with a new client cap that only exposes the aspect ratio flags when userspace is prepared for them (simi

  1   2   3   4   5   6   7   8   9   10   >