[PATCH] drm/dp: Allow signals to interrupt drm_aux-dev reads/writes

2016-04-27 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Let's be nice and interrupt the dpcd aux-dev reads/writes when there's a signal pending. Much nicer if the user can hit ^C instead of having to sit around waiting for the read/write to finish. time dd if=/dev/drm_dp_aux0 bs=$((1024*1024)) ^C before: real 0m34.681s user

[PATCH 00/10] drm/edid: Clean up display_info stuff

2016-08-03 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä This series aims to clean up the way we fill out the display_info structure a bit. Mainly doing a clean separation of the audio and video related bits. My aim is getting i915 to respect the HDMI sink TMDS clock limit (currently we respect only the DP++ dongle limit, and th

[PATCH 01/10] drm/edid: Clear old audio latency values before parsing the new EDID

2016-08-03 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Clear out stale audio latency information (potentially from a previous EDID) before constructing the ELD from the EDID. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_edid.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/drm_edid.c b/dr

[PATCH 02/10] drm/edid: Clear old dvi_dual/max_tmds_clock before parsing the new EDID

2016-08-03 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Clear out old max_tmds_clock and dvi_dual information (possibly from a previous EDID) before parsing the current EDID. Tne current EDID might not even have these in its HDMI VSDB, which would mean that we'd leave the old stale values in place. Signed-off-by: Ville Syrjälä

[PATCH 03/10] drm/edid: Make max_tmds_clock kHz instead of MHz

2016-08-03 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä We generally store clocks in kHz, so let's do that for the HDMI max TMDS clock value as well. Less surpising. Cc: Alex Deucher Cc: "Christian König" Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 2 +- drivers/gpu/drm/drm_edid.c

[PATCH 06/10] drm/edid: Reduce the number of times we parse the CEA extension block

2016-08-03 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Instead of parsing parts of the CEA extension block in two places to determine supported color formats and whatnot, let's just consolidate it to one function. This also makes it possible to neatly flatten drm_assign_hdmi_deep_color_info(). Signed-off-by: Ville Syrjälä --

[PATCH 04/10] drm/edid: Move dvi_dual/max_tmds_clock to drm_display_info

2016-08-03 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä We have the drm_display_info for storing information about the sink, so let's move dvi_dual and max_tmds_clock in there. Cc: Alex Deucher Cc: "Christian König" Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 4 ++-- drivers/gpu/drm/

[PATCH 07/10] drm/edid: Clear the old cea_rev when there's no CEA extension in the new EDID

2016-08-03 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä It's not a good idea to leave stale cea_rev in the drm_display_info. The current EDID might not even have a CEA ext block in which case we'd end up leaving the stale value in place. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_edid.c | 1 + 1 file changed, 1 ins

[PATCH 08/10] drm/edid: Move dvi_dual/max_tmds_clock parsing out from drm_edid_to_eld()

2016-08-03 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä drm_edid_to_eld() is just mean to cook up the ELD for the audio driver, so having it parse non-audio related stuff seems just wrong, and potentially could lead to that information not being even filled out if the function doesn't even get called. Let's move that stuff to the

[PATCH 05/10] drm/edid: Don't pass around drm_display_info needlessly

2016-08-03 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä We already pass the connector to drm_add_display_info() and drm_assign_hdmi_deep_color_info(), so passing the connector->display_info also is pointless. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_edid.c | 11 --- 1 file changed, 4 insertions(+), 7 dele

[PATCH 09/10] drm/i915: Replace a bunch of connector->base.display_info with a local variable

2016-08-03 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Reduce the eyesore with a local variable. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_display.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.

[PATCH 10/10] drm/i915: Account for sink max TMDS clock when checking the port clock

2016-08-03 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä It's perfectly legal for the sink to support 12bpc only for some lower resolution modes, while the higher resolution modes can only be used with 8bpc. So let's take the sink's max TMDS clock into account before we go and decide that a particular mode can be used with 12bpc.

[PATCH v3 3/9] drm/plane-helper: Add drm_plane_helper_check_state()

2016-08-08 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Add a version of drm_plane_helper_check_update() which takes a plane state instead of having the caller pass in everything. And to reduce code duplication, let's reimplement drm_plane_helper_check_update() in terms of the new function, by having a tempororary plane state on

[PATCH] drm: Don't force all planes to be added to the state due to zpos

2016-10-10 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä We don't want all planes to be added to the state whenever a plane with fixed zpos gets enabled/disabled. This is true especially for eg. cursor planes on i915, as we want cursor updates to go through w/o throttling. Same holds for drivers that don't support zpos at all (i91

[PATCH v2] drm: Don't force all planes to be added to the state due to zpos

2016-10-10 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä We don't want all planes to be added to the state whenever a plane with fixed zpos gets enabled/disabled. This is true especially for eg. cursor planes on i915, as we want cursor updates to go through w/o throttling. Same holds for drivers that don't support zpos at all (i91

[PATCH 0/6] drm/i915: Remaining PSR fixes

2016-05-31 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Here's a repost of my PSR fixes, and one straggler from Daniel. One interesting thing I noticed is that my SKL actually hits the PSR setup time vs. vblank length check, so after these patches that machine won't actually use PSR. The panel does support a lower refresh rate t

[PATCH v2 1/6] drm/dp: Add drm_dp_psr_setup_time()

2016-05-31 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Add a small helper to parse the PSR setup time from the DPCD PSR capabilities and return the value in microseconds. v2: Don't waste so many bytes on the psr_setup_time_us[] table Cc: Daniel Vetter Reviewed-by: Daniel Vetter Signed-off-by: Ville Syrjälä --- drivers/gp

[PATCH v2 2/6] drm/dp: Add drm_dp_psr_need_train_on_exit()

2016-05-31 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Add a small helper to parse from the DPCD whether link training is required when exiting PSR main-link off mode. v2: Rebased Cc: Daniel Vetter Reviewed-by: Daniel Vetter Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_dp_helper.c | 14 ++ include/drm

[PATCH 3/6] drm/i915: Check PSR setup time vs. vblank length

2016-05-31 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Bspec says: "Restriction : SRD must not be enabled when the PSR Setup time from DPCD 00071h is greater than the time for vertical blank minus one line." Let's check for that and disallow PSR if we exceed the limit. Cc: Daniel Vetter Reviewed-by: Daniel Vetter Signed-off-

[PATCH 4/6] drm/i915/psr: Skip aux handeshake if the vbt tells us to

2016-05-31 Thread ville.syrj...@linux.intel.com
From: Daniel Vetter Not sure we can trust VBT on this one, but let's try. Cc: Rodrigo Vivi Cc: Sonika Jindal Cc: Durgadoss R Signed-off-by: Daniel Vetter Reviewed-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_psr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm

[PATCH 5/6] drm/i915: Ask the sink whether training is required when exiting PSR main-link off mode

2016-05-31 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä The sink can tell us if link training needs to be performed when exiting PSR main-link off mode. Currently we get that information from the VBT, but at least on my HSW the VBT says one thing, the sink another. And in practice the sink doesn't seem to notice any screen update

[PATCH 6/6] drm/i915: Move psr.link_standby setup to intel_psr_match_conditions()

2016-05-31 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Determine the value of psr.link_standby at runtime rather than at init time. This helps in testing since you can change between link-off and link-standby at runtime. Reviewed-by: Daniel Vetter Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_psr.c | 41 +

[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

[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] 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] 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] 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

[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 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

[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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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-

  1   2   3   4   5   6   7   8   9   10   >