[PATCH v2 4/7] drm/i915: Use a custom restore_fbdev_mode hook

2013-05-31 Thread ville.syrj...@linux.intel.com
From: Ville Syrj?l? Disable sprite planes and cursors when restoring the fbdev mode. Should makes oopses more readable if they're not covered by sprites and cursors. v2: Rebased due to changes earlier in the series Signed-off-by: Ville Syrj?l? --- drivers/gpu/drm/i915/intel_fb.c | 23 +++

[PATCH 5/7] drm/i915: Use container_of() in the fbdev code

2013-05-31 Thread ville.syrj...@linux.intel.com
From: Ville Syrj?l? Use container_of() instead of a cast to get struct intel_fbdev from struct drm_fb_helper. Also populate the fb_info->par correctly with the drm_fb_helper pointer instead of the intel_fbdev pointer. There's no actual functional change since the drm_fb_helper happens to be the

[PATCH 6/7] drm/i915: s/drm_i915_private_t/struct drm_i915_private/

2013-05-31 Thread ville.syrj...@linux.intel.com
From: Ville Syrj?l? People don't like typedefs these days. Eliminate their use from intel_fb.c. Signed-off-by: Ville Syrj?l? --- drivers/gpu/drm/i915/intel_fb.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i9

[PATCH v2 7/7] drm: Remove some unused stuff from drm_plane

2013-05-31 Thread ville.syrj...@linux.intel.com
From: Ville Syrj?l? There's a bunch of unused members inside drm_plane, bloating the size of the structure needlessly. Eliminate them. v2: Remove all of it from kernel-doc too Reviewed-by: Laurent Pinchart Signed-off-by: Ville Syrj?l? --- drivers/gpu/drm/drm_crtc.c | 2 +- include/drm/drm_c

[PATCH 0/3] drm: drm_sysfs_connector_add() stuff

2013-11-04 Thread ville.syrj...@linux.intel.com
Most drivers don't appear to bother with checking drm_connector_sysfs_add() return value. That means the recent changes to drm_connector_sysfs_add() have left most drivers susceptible to oopsing on cleanup if drm_connector_sysfs_add() somehow failed. This series makes drm_connector_sysfs_remove()

[PATCH 1/3] drm/sysfs: Remove stale comments about calling drm_sysfs_connector_add() multiple times

2013-11-04 Thread ville.syrj...@linux.intel.com
From: Ville Syrj?l? drm_connector_sysfs_add() explicitly checks if connector->kdev is already populated and returns success. So it clearly now allows being called multiple times. Remove some stale comments to the contrary. Signed-off-by: Ville Syrj?l? --- drivers/gpu/drm/drm_sysfs.c | 6 --

[PATCH 2/3] drm/sysfs: Don't pollute connector->kdev if drm_connector_sysfs_add() fails

2013-11-04 Thread ville.syrj...@linux.intel.com
From: Ville Syrj?l? Currently if drm_connector_sysfs_add() fails, it can leave connector->kdev populated with an ERR_PTR value, or pointing to an already freed device. Use a temporarary kdev pointer during drm_connector_sysfs_add(), and only set connector->kdev if the function succeeds. This avoi

[PATCH 3/3] drm/i915: Clean up if drm_sysfs_connector_add() fails

2013-11-04 Thread ville.syrj...@linux.intel.com
From: Ville Syrj?l? While we can now call drm_sysfs_connector_remove() even if drm_connector_sysfs_add() failed, it would seem better for the user to know that something went wrong. So instead of ignoring drm_sysfs_connector_add() return value, checl it and fail the whole connector registration.

[PATCH v2] drm/i915: Make AGP support optional

2013-11-05 Thread ville.syrj...@linux.intel.com
From: Ville Syrj?l? We only depend on the intel-gtt module for GTT frobbign on older gens. The intel_agp module is optional, except for UMS and some old XvMC userland on gen3. So make AGP support optional. As before, we will fail the i915 init for UMS and gen3 KMS the same as before if intel_agp

[PATCH v2 2/3] drm/sysfs: Don't pollute connector->kdev if drm_sysfs_connector_add() fails

2013-11-06 Thread ville.syrj...@linux.intel.com
From: Ville Syrj?l? Currently if drm_sysfs_connector_add() fails, it can leave connector->kdev populated with an ERR_PTR value, or pointing to an already freed device. Use a temporary kdev pointer during drm_sysfs_connector_add(), and only set connector->kdev if the function succeeds. This avoids

[PATCH] drm/atomic: Constify a bunch of functions pointer structs

2015-03-10 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Make the helper function pointer structs const to make it clear they should not be modified. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_atomic_helper.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/dri

[PATCH] drm: Silence sparse warnings

2015-03-13 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä ../drivers/gpu/drm/drm_vm.c:405:6: warning: symbol 'drm_vm_open_locked' was not declared. Should it be static? ../drivers/gpu/drm/drm_vm.c:431:6: warning: symbol 'drm_vm_close_locked' was not declared. Should it be static? ../drivers/gpu/drm/drm_vm.c:681:5: warning: symbol

[PATCH 1/5] drm/dp: s/I2C_STATUS/I2C_WRITE_STATUS_UPDATE/

2015-03-13 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Rename the I2C_STATUS request to I2C_WRITE_STATUS_UPDATE to match the spec. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/tegra/dpaux.c | 2 +- include/drm/drm_dp_helper.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/tegra/

[PATCH 0/5] drm/dp: i2c-over-aux short write support

2015-03-13 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä This series tries to implement support for short i2c-over-aux writes. I did notice that my monitor (HP ZR24w) does support DDC/CI so I was able to do some writes, but I only saw native defers instead of i2c defers/short acks. So I've not actually been able to test this. An

[PATCH 2/5] drm/i915: Handle DP_AUX_I2C_WRITE_STATUS_UPDATE

2015-03-13 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä When we get an i2c defer or short ack for i2c-over-aux write we need to switch to WRITE_STATUS_UPDATE to poll for the completion of the original request. i915 doesn't try to interpret wht request type apart from separating reads from writes, and so we should be able to trea

[PATCH 3/5] drm/radeon: Handle DP_AUX_I2C_WRITE_STATUS_UPDATE

2015-03-13 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä When we get an i2c defer or short ack for i2c-over-aux write we need to switch to WRITE_STATUS_UPDATE to poll for the completion of the original request. Looks like radeon doesn't do anything special with the request type, so hopefully just treating it the same as a i2c wri

[PATCH 4/5] drm/tegra: Handle I2C_WRITE_STATUS_UPDATE for address only writes

2015-03-13 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä A address-only I2C_WRITE can't be replied with a short i2c ack, but I suppose it could be replied with an i2c defer. So the code should be prepared for an address-only I2C_WRITE_STATUS_UPDATE. Cc: Thierry Reding Cc: "Terje Bergström" Signed-off-by: Ville Syrjälä ---

[PATCH 5/5] drm/dp: Use I2C_WRITE_STATUS_UPDATE to drain partial I2C_WRITE requests

2015-03-13 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä When an i2c WRITE gets an i2c defer or short i2c ack reply, we are supposed to switch the request from I2C_WRITE to I2C_WRITE_STATUS_UPDATE when we continue to poll for the completion of the request. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_dp_helper.c | 41

[PATCH 1/3] drm/dp: Print the number of bytes processed for aux nacks

2015-03-19 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä When doing a native or i2c aux write the sink will indicate the number of bytes written even if it the nacks the transfer. When we receive a nack we just return an error upwards, but it might still be interesting to see how many bytes made it before the nack. So include that

[PATCH 2/3] drm/i915: Send out the full AUX address

2015-03-19 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä AUX addresses are 20 bits long. Send out the entire address instead of just the low 16 bits. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_dp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drive

[PATCH 3/3] drm/radeon: Send out the full AUX address

2015-03-19 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä AUX addresses are 20 bits long. Send out the entire address instead of just the low 16 bits. Cc: Alex Deucher Cc: "Christian König" Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/radeon/atombios_dp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff

[PATCH v2 1/3] drm/dp: Print the number of bytes processed for aux nacks

2015-03-19 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä When doing a native or i2c aux write the sink will indicate the number of bytes written even if it the nacks the transfer. When we receive a nack we just return an error upwards, but it might still be interesting to see how many bytes made it before the nack. So include that

[PATCH 0/6] drm: Ioctl code cleanups

2015-03-27 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä In response to a recently noticed fumble with some i915 ioctls, I proceeded to read the ioctl code again and didn't really like what I saw. So I tried to clean it up a bit to make it less confusing. grep also tells me the drm_ioctl pattern has been dutifully copied into amd

[PATCH 1/6] drm: Fix DRM_IOCTL_DEF_DRV()

2015-03-27 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Currently DRM_IOCTL_DEF_DRV does '[DRM_IOCTL_NR(DRM_##ioctl)]' which doesn't make much sense since DRM_##ioctl is already a the raw ioctl number. So change it to 'DRM_IOCTL_NR(DRM_IOCTL_##ioctl) - DRM_COMMAND_BASE' which means the DRM_IOCTL_NR() now makes sense, and also thi

[PATCH 2/6] drm: Drop ioctl->cmd_drv

2015-03-27 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä ioctl->cmd_drv is pointless and we can just as well stick the full ioctl definition into ioctl->cmd. Cc: Jakob Bornecrantz Cc: Thomas Hellstrom Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_ioctl.c | 6 +++--- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 4 ++-

[PATCH 3/6] drm/vmwgfx: Replace VMW_IOCTL_DEF with DRM_IOCTL_DEF_DRV

2015-03-27 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä DRM_IOCTL_DEF_DRV is now identical to VMW_IOCTL_DEF (apart from the .name assignment), so just replace the use of the latter with the former. With .name now assigned this should also make decoding kernel logs a bit easier. Cc: Jakob Bornecrantz Cc: Thomas Hellstrom Signe

[PATCH 4/6] drm: Simplify core vs. drv ioctl handling

2015-03-27 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Now that cmd_drv is gone the handling for core and driver ioctls is mostly identical, so eliminate the duplication. Also take the opportunity to simplify the range checks to be less cluttered. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_ioctl.c | 39 +++

[PATCH 5/6] drm: Use max() to make the ioctl alloc size code cleaner

2015-03-27 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Use max() to make the code to determine the allocation size for the ioctl data easier to read. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_ioctl.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu

[PATCH 6/6] drm: Rewrite drm_ioctl_flags() to resemble the new drm_ioctl() code

2015-03-27 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Use the same logic when checking for valid ioctl range in drm_ioctl_flags() that is used in drm_ioctl() to avoid confusion. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_ioctl.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/dri

[PATCH] drm/edid: Add CEA modes before inferred modes

2015-05-08 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Currently we're adding CEA modes after the inferred modes, which means we might get multiple modes that are very close to each other, but slightly different, which seems a bit silly. That's because duplicate mode check that occurs when adding inferred modes would not conside

[PATCH] drm: Don't oops in drm_calc_timestamping_constants() if drm_vblank_init() wasn't called

2015-11-12 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Seems the crtc helpers call drm_calc_timestamping_constants() unconditionally even if the driver didn't initialize vblank support by calling drm_vblank_init(). That used to be OK since the constants were stored under drm_crtc. However I broke this with commit eba1f35dfe14 (

[PATCH 0/6] drm: Give crtcs and planes actual names

2015-11-12 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä I got sick and tired of staring at the line noise produced by drm.debug=0x1e, so I decided to give the crtcs and planes human readable names. Each driver can give whatever names it wants, and for i915 I gave something that makes some sense w.r.t. to the spec. The only magic

[PATCH 1/6] drm: Add crtc->name and use it in debug messages

2015-11-12 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_atomic.c| 41 ++- drivers/gpu/drm/drm_atomic_helper.c | 56 +++-- drivers/gpu/drm/drm_crtc.c | 8 -- drivers/gpu/drm/drm_crtc_helper.c | 2

[PATCH 2/6] drm: Add plane->name and use it in debug prints

2015-11-12 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_atomic.c| 12 ++-- drivers/gpu/drm/drm_atomic_helper.c | 4 ++-- drivers/gpu/drm/drm_crtc.c | 3 +++ include/drm/drm_crtc.h | 2 ++ 4 files changed, 13 insertions(+), 8 deletion

[PATCH 5/6] drm/i915: Set crtc->name to "pipe A", "pipe B", etc.

2015-11-12 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_display.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index b628dab..2b5e81a 100644 --- a/drive

[PATCH 4/6] drm/i915: Use plane->name in debug prints

2015-11-12 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_display.c | 38 +--- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 9845687..b6

[PATCH 3/6] drm/i915: Use crtc->name in debug messages

2015-11-12 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_display.c | 55 drivers/gpu/drm/i915/intel_fbdev.c | 5 ++-- 2 files changed, 33 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drive

[PATCH 6/6] drm/i915: Give meaningful names to all the planes

2015-11-12 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Let's name our planes in a way that makes sense wrt. the spec: - skl+ -> "plane 1A", "plane 2A", "plane 1C", "cursor A" etc. - g4x+ -> "primary A", "primary B", "sprite A", "cursor C" etc. - pre-g4x -> "plane A", "cursor B" etc. Signed-off-by: Ville Syrjälä --- drivers/

[PATCH v2 0/8] drm: Give crtcs and planes actual names (v2)

2015-11-12 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä OK, so another attempt. This time the error handling and cleanup should be more solid. Previus attempt was at http://lists.freedesktop.org/archives/dri-devel/2015-November/094331.html I pushed v2 to: git://github.com/vsyrjala/linux.git crtc_plane_name_2 Ville Syrjälä (8

[PATCH 1/8] drm: Add crtc->name and use it in debug messages

2015-11-12 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_atomic.c| 41 ++- drivers/gpu/drm/drm_atomic_helper.c | 56 +++-- drivers/gpu/drm/drm_crtc.c | 8 -- drivers/gpu/drm/drm_crtc_helper.c | 2

[PATCH 2/8] drm: Add plane->name and use it in debug prints

2015-11-12 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_atomic.c| 12 ++-- drivers/gpu/drm/drm_atomic_helper.c | 4 ++-- drivers/gpu/drm/drm_crtc.c | 3 +++ include/drm/drm_crtc.h | 2 ++ 4 files changed, 13 insertions(+), 8 deletion

[PATCH 3/8] drm/i915: Use crtc->name in debug messages

2015-11-12 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_display.c | 55 drivers/gpu/drm/i915/intel_fbdev.c | 5 ++-- 2 files changed, 33 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drive

[PATCH 4/8] drm/i915: Use plane->name in debug prints

2015-11-12 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_display.c | 38 +--- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 9845687..b6

[PATCH 6/8] drm/i915: Fix plane init failure paths

2015-11-12 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Deal with errors from drm_universal_plane_init() in primary and cursor plane init paths (sprites were already covered). Also make the code neater by using goto for error handling. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_display.c | 64 +++

[PATCH 7/8] drm/i915: Don't leak primary/cursor planes on crtc init failure

2015-11-12 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Call intel_plane_destroy() instead of drm_plane_cleanup() so that we also free the plane struct itself when bailing out of the crtc init. And make intel_plane_destroy() NULL tolerant to avoid having to check for it in the caller. Signed-off-by: Ville Syrjälä --- driver

[PATCH v2 8/8] drm/i915: Give meaningful names to all the planes

2015-11-12 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Let's name our planes in a way that makes sense wrt. the spec: - skl+ -> "plane 1A", "plane 2A", "plane 1C", "cursor A" etc. - g4x+ -> "primary A", "primary B", "sprite A", "cursor C" etc. - pre-g4x -> "plane A", "cursor B" etc. v2: Rebase on top of the fixed/cleaned error

[PATCH v2 5/8] drm/i915: Set crtc->name to "pipe A", "pipe B", etc.

2015-11-12 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä v2: Fix intel_crtc leak on failure to allocate the name Use a local 'name' variable to make things easier Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_display.c | 21 + 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a

[PATCH v3 0/9] drm: Give crtcs and planes actual names (v3)

2015-11-13 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Another attempt to give crtcs and planes human friendly names. This time I pulled out coccinelle and added a 'name' parameter to all the crtc and plane init functions. Third time's the charm, eh? Previous series at: http://lists.freedesktop.org/archives/dri-devel/2015-Novem

[PATCH v2 2/9] drm: Add crtc->name and use it in debug messages

2015-11-13 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä v2: kstrdup() the name passed by the caller (Jani) Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_atomic.c| 41 ++- drivers/gpu/drm/drm_atomic_helper.c | 56 +++-- drivers/gpu/drm/drm_crtc.c

[PATCH v2 3/9] drm: Add plane->name and use it in debug prints

2015-11-13 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä v2: kstrdup() the name passed by the caller (Jani) Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_atomic.c| 12 ++-- drivers/gpu/drm/drm_atomic_helper.c | 4 ++-- drivers/gpu/drm/drm_crtc.c | 11 ++- include/drm/drm_crtc.h

[PATCH 4/9] drm/i915: Use crtc->name in debug messages

2015-11-13 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_display.c | 55 drivers/gpu/drm/i915/intel_fbdev.c | 5 ++-- 2 files changed, 33 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drive

[PATCH 5/9] drm/i915: Use plane->name in debug prints

2015-11-13 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_display.c | 38 +--- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 6fac133..77

[PATCH v3 6/9] drm/i915: Set crtc->name to "pipe A", "pipe B", etc.

2015-11-13 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä v2: Fix intel_crtc leak on failure to allocate the name Use a local 'name' variable to make things easier v3: Pass the name as a function arguemnt to drm_crtc_init_with_planes() (Jani) Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_display.c | 13 ++

[PATCH v2 7/9] drm/i915: Fix plane init failure paths

2015-11-13 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Deal with errors from drm_universal_plane_init() in primary and cursor plane init paths (sprites were already covered). Also make the code neater by using goto for error handling. v2: Rebased due to drm_universal_plane_init() 'name' parameter Signed-off-by: Ville Syrjälä

[PATCH 8/9] drm/i915: Don't leak primary/cursor planes on crtc init failure

2015-11-13 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Call intel_plane_destroy() instead of drm_plane_cleanup() so that we also free the plane struct itself when bailing out of the crtc init. And make intel_plane_destroy() NULL tolerant to avoid having to check for it in the caller. Signed-off-by: Ville Syrjälä --- driver

[PATCH v3 9/9] drm/i915: Give meaningful names to all the planes

2015-11-13 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Let's name our planes in a way that makes sense wrt. the spec: - skl+ -> "plane 1A", "plane 2A", "plane 1C", "cursor A" etc. - g4x+ -> "primary A", "primary B", "sprite A", "cursor C" etc. - pre-g4x -> "plane A", "cursor B" etc. v2: Rebase on top of the fixed/cleaned error

[PATCH 1/9] drm: Pass 'name' to crtc and plane init functions

2015-11-13 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Allow the driver to pass a crtc and plane names to the crtc and plane init functions. Will be used later to populate the crtc and plane name that gets printed in debug messages. Done with coccinelle for the most part. It choked on msm/mdp/mdp5/mdp5_plane.c like so: "BAD:!!!

[PATCH 2/4] drm: Keep coordinates in the typical x, y, w, h order instead of x, y, h, w

2015-11-16 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_atomic_helper.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 7857163..d5693b7 100644 --- a/drivers/

[PATCH 3/4] drm: Add "prefix" parameter to drm_rect_debug_print()

2015-11-16 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Allow the caller to specify a "prefix" string to drm_rect_debug_print() to make it easier to see which drm_rect is being printed. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_rect.c | 7 --- drivers/gpu/drm/i915/intel_sprite.c | 8 include/

[PATCH 1/4] drm: Fix primary plane size for stereo doubled modes for legacy setcrtc

2015-11-16 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Properly double the hdisplay/vdisplay timings that we use as the primary plane size with stereo doubled modes. Otherwise the modeset gets rejected on machines where the primary plane must be fullscreen, and on the rest only the first eye would get a visible plane. Cc: Danie

[PATCH 4/4] drm: Print the src/dst/clip rectangles in error in drm_plane_helper

2015-11-16 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä To aid in debugging failures, print the src,dst,clip rectangles when drm_plane_helper_check_update() fails. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_plane_helper.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/drm_plane_helper.c b/

[PATCH] drm/edid: Make the detailed timing CEA/HDMI mode fixup accept up to 5kHz clock difference

2015-11-16 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Rather than using drm_match_cea_mode() to see if the EDID detailed timings are supposed to represent one of the CEA/HDMI modes, add a special version of that function that takes in an explicit clock tolerance value (in kHz). When looking at the detailed timings specify the t

[PATCH 1/3] drm/edid: Fix up clock for CEA/HDMI modes specified via detailed timings

2015-10-08 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä EDID detailed timings have a resolution of 10kHz for the pixel clock, so they can't represent certain CEA/HDMI modes accurately. If we see a mode coming in via detailed timings which otherwise matches one of the CEA/HDMI modes except the clock is just a bit off, let's assume

[PATCH 2/3] drm/edid: Round to closest when computing the CEA/HDMI alternate clock

2015-10-08 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Rounding to the closest kHz seems like the better option that round down or up when computing the alternate clock for CEA/HDMI modes. It'll give us a slightly more accurate clock in some cases. Not sure why I went for the down+up approach originally. Perhaps I was thinking

[PATCH 3/3] drm/i915: Use round to closest when computing the CEA 1.001 pixel clocks

2015-10-08 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä drm_edid.c now computes the alternate CEA clocks using DIV_ROUND_CLOSEST(), so follow suit in the N/CTS setup to make sure we pick the right setting for the mode. Unfortunately we can't actually use DIV_ROUND_CLOSEST() here due to the ({}) construct used, so just stick in r

[PATCH 1/2] drm: Don't use '\' for string literal concatenation

2015-10-09 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä String literals get concatenated just fine on their own, no need to use '\'. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_irq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index 7b

[PATCH 2/2] drm: Add DRM_DEBUG_VBL()

2015-10-09 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Add a new debug class for _verbose_ debug message from the vblank code. That is message we spew out potentially for every vblank interrupt. Thierry already got annoyed at the spew, and now I managed to lock up my box with these debug prints (seems serial console + a few debu

[PATCH 01/22] drm: Add drm_format_plane_width() and drm_format_plane_height()

2015-10-14 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Add a few helpers to get the dimensions of the chroma plane(s). Cc: dri-devel at lists.freedesktop.org Signed-off-by: Ville Syrjälä --- include/drm/drm_crtc.h | 12 1 file changed, 12 insertions(+) diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc

[PATCH 1/2] drm: Set crtc->invert_dimensions from the atomic helpers

2015-10-15 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Pull the crtc->invert_dimensions setting from omapdrm into the atomic helpers so that all drivers will check viewport correctly in setcrtc() after rotating the primary plane, Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_atomic_helper.c | 8 drivers/gpu/

[PATCH 2/2] drm: Swap w/h when converting the mode to src coordidates for a rotated primary plane

2015-10-15 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä When converting the mode hdisplay/vdisplay to primary plane src coordinates we need to take into account the current plane rotation. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_atomic_helper.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff

[PATCH 3/5] drm: Refactor plane src coordinate checks

2015-10-15 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Pull the plane src coordinate checks into a separate function so that we can share them for the legacy and new stuff. Cc: Matt Roper Cc: Tvrtko Ursulin Cc: Daniel Vetter Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_crtc.c | 59 +++-

[PATCH 4/5] drm: Check crtc viewport correctly with rotated primary plane on atomic drivers

2015-10-15 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä On atomic drivers we can dig out the primary plane rotation from the plane state instead of looking at the legacy crtc->invert_dimensions flag. The flag is not set by anyone except omapdrm, and it would be racy to set it the same way in the atomic helpers. Cc: Matt Roper C

[PATCH 5/5] drm: Check plane src coordinates correctly during page flip for atomic drivers

2015-10-15 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Instead of relying on the old crtc-{x,y,mode} gunk, dig out the primary plane coordinates from the plane state when checking them against the new framebuffer during page flip. Cc: Matt Roper Cc: Tvrtko Ursulin Cc: Daniel Vetter Signed-off-by: Ville Syrjälä --- driver

[PATCH 1/5] drm: Don't leak fb when plane crtc coodinates are bad

2015-10-15 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_crtc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index e7c8422..66233a8 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/

[PATCH 2/5] drm: Swap w/h when converting the mode to src coordidates for a rotated primary plane

2015-10-15 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä When converting the mode hdisplay/vdisplay to primary plane src coordinates we need to take into account the current plane rotation. Cc: Matt Roper Cc: Tvrtko Ursulin Cc: Daniel Vetter Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_atomic_helper.c | 9 +++--

[PATCH v2 4/5] drm: Check crtc viewport correctly with rotated primary plane on atomic drivers

2015-10-16 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä On atomic drivers we can dig out the primary plane rotation from the plane state instead of looking at the legacy crtc->invert_dimensions flag. The flag is not set by anyone except omapdrm, and it would be racy to set it the same way in the atomic helpers. v2: Kill crtc->in

[PATCH v3 2/3] drm/dp: Adjust i2c-over-aux retry count based on message size and i2c bus speed

2015-09-01 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Calculate the number of retries we should do for each i2c-over-aux message based on the time it takes to perform the i2c transfer vs. the aux transfer. We assume the shortest possible length for the aux transfer, and the longest possible (exluding clock stretching) for the i

[PATCH 01/20] drm: Constify drm_encoder_slave_funcs

2015-09-02 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Signed-off-by: Ville Syrjälä Reviewed-by: Alex Deucher --- drivers/gpu/drm/drm_encoder_slave.c | 2 +- drivers/gpu/drm/nouveau/nouveau_encoder.h | 2 +- drivers/gpu/drm/rcar-du/rcar_du_hdmicon.c | 6 +++--- drivers/gpu/drm/rcar-du/rcar_du_hdmienc.c | 8 i

[PATCH 02/20] drm/armada: Constify function pointer structs

2015-09-02 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Moves a bunch of junk to .rodata from .data. drivers/gpu/drm/armada/armada.ko: -.rodata 1040 +.rodata 1100 -.data1156 +.data1096 Signed-off-by: Ville Syrjälä Reviewed-by: Alex Deuc

[PATCH 03/20] drm/atmel-hlcdc: Constify function pointer structs

2015-09-02 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Moves a bunch of junk to .rodata from .data. drivers/gpu/drm/atmel-hlcdc/atmel-hlcdc-dc.ko: -.text 12488 +.text 12480 -.rodata 1696 +.rodata 1760 -.data 776 +.data

[PATCH 04/20] drm/bochs: Constify function pointer structs

2015-09-02 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Moves a bunch of junk to .rodata from .data. drivers/gpu/drm/bochs/bochs-drm.ko: -.text7608 +.text7600 -.rodata 648 +.rodata 716 -.data 612 +.data

[PATCH 05/20] drm/bridge/dw_hdmi: Constify function pointer structs

2015-09-02 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Moves a bunch of junk to .rodata from .data. drivers/gpu/drm/bridge/dw_hdmi.ko: -.rodata 120 +.rodata 216 -.data 96 +.data 0 Signed-off-by: Ville Syrjälä Reviewed-by: Alex Deuche

[PATCH 06/20] drm/bridge/nxp-ptn3460: Constify function pointer structs

2015-09-02 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Moves a bunch of junk to .rodata from .data. drivers/gpu/drm/bridge/nxp-ptn3460.ko: -.rodata 440 +.rodata 536 -.data208 +.data112 Signed-off-by: Ville Syrjälä Reviewed-by: Alex De

[PATCH 07/20] drm/i2c/ch7006: Constify function pointer structs

2015-09-02 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Moves a bunch of junk to .rodata from .data. drivers/gpu/drm/i2c/ch7006.ko: -.text5752 +.text5760 -.rodata 6608 +.rodata 6656 -.data 216 +.data

[PATCH 08/20] drm/cirrus: Constify function pointer structs

2015-09-02 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Moves a bunch of junk to .rodata from .data. drivers/gpu/drm/cirrus/cirrus.ko: -.text 10104 +.text 10092 -.rodata 528 +.rodata 596 -.data 608 +.data

[PATCH 09/20] drm/exynos: Constify function pointer structs

2015-09-02 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Moves a bunch of junk to .rodata from .data. drivers/gpu/drm/exynos/exynosdrm.ko: -.text 125792 +.text 125788 -.rodata 10972 +.rodata 11748 -.data 6720 +.data

[PATCH 10/20] drm/i2c/adv7511: Constify function pointer structs

2015-09-02 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Moves a bunch of junk to .rodata from .data. drivers/gpu/drm/i2c/adv7511.ko: -.rodata 1368 +.rodata 1416 -.data164 +.data116 Signed-off-by: Ville Syrjälä Reviewed-by: Alex Deucher

[PATCH 11/20] drm/i2c/sil164: Constify function pointer structs

2015-09-02 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Moves a bunch of junk to .rodata from .data. drivers/gpu/drm/i2c/sil164.ko: -.text 1660 +.text 1656 -.rodata 56 +.rodata 104 -.data212 +.data

[PATCH 12/20] drm/i2c/tda998x: Constify function pointer structs

2015-09-02 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Moves a bunch of junk to .rodata from .data. drivers/gpu/drm/i2c/tda998x.ko: -.rodata 668 +.rodata 716 -.data212 +.data164 Signed-off-by: Ville Syrjälä Reviewed-by: Alex Deucher

[PATCH 13/20] drm/imx: Constify function pointer structs

2015-09-02 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Moves a bunch of junk to .rodata from .data. drivers/gpu/drm/imx/imxdrm.ko: -.rodata 624 +.rodata 652 -.data372 +.data344 drivers/gpu/drm/imx/imx-ipuv3-crtc.ko: -.rodata

[PATCH 14/20] drm/mgag200: Constify function pointer structs

2015-09-02 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Moves a bunch of junk to .rodata from .data. drivers/gpu/drm/mgag200/mgag200.ko: -.text 29244 +.text 29232 -.rodata 600 +.rodata 668 -.data 688 +.data

[PATCH 15/20] drm/nouveau: Constify function pointer structs

2015-09-02 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Moves a bunch of junk to .rodata from .data. drivers/gpu/drm/nouveau/nouveau.ko: -.rodata 105688 +.rodata 105792 -.data125724 +.data125620 Signed-off-by: Ville Syrjälä Reviewed-by

[PATCH 16/20] drm/rockchip: Constify function pointer structs

2015-09-02 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Moves a bunch of junk to .rodata from .data. drivers/gpu/drm/rockchip/dw_hdmi-rockchip.ko: -.rodata 772 +.rodata 828 -.data148 +.data 92 drivers/gpu/drm/rockchip/rockchipdrm.ko: -.r

[PATCH 18/20] drm/tegra: Constify function pointer structs

2015-09-02 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Moves a bunch of junk to .rodata from .data. drivers/gpu/drm/tegra/tegra-drm.ko: -.rodata 13672 +.rodata 13684 -.data1108 +.data1096 Signed-off-by: Ville Syrjälä Reviewed-by: Alex D

[PATCH 19/20] drm/udl: Constify function pointer structs

2015-09-02 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Moves a bunch of junk to .rodata from .data. drivers/gpu/drm/udl/udl.ko: -.text 11336 +.text 11332 -.rodata 560 +.rodata 684 -.data 696 +.data

[PATCH 20/20] drm/vmwgfx: Constify function pointer structs

2015-09-02 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Moves a bunch of junk to .rodata from .data. drivers/gpu/drm/vmwgfx/vmwgfx.ko: -.text 132244 +.text 132240 -.rodata 18296 +.rodata 18680 -.data 5096 +.data

[PATCH 17/20] drm/sti: Constify function pointer structs

2015-09-02 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä Moves a bunch of junk to .rodata from .data. drivers/gpu/drm/sti/sticompositor.ko: -.text 12216 +.text 12212 -.rodata 1284 +.rodata 1400 -.data 488 +.data

[PATCH 1/3] drm: Make some modes const when iterating through them

2015-09-07 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä valid_inferred_mode() don't change the modes over which it iterates, so make the iterator const. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_edid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/

[PATCH 2/3] drm: Remove the 'mode' argument from drm_select_eld()

2015-09-07 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä drm_select_eld() doesn't look at the passed in mode, so don't pass it in. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_edid.c | 4 +--- drivers/gpu/drm/i915/intel_audio.c | 2 +- include/drm/drm_edid.h | 3 +-- 3 files changed, 3 insertions(+

[PATCH 3/3] drm: Make drm_av_sync_delay() 'mode' argument const

2015-09-07 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä drm_av_sync_delay() doesn't change the passed in mode, so make it const. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_edid.c | 2 +- include/drm/drm_edid.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_edid.c b/dr

<    4   5   6   7   8   9   10   >