[PATCH 1/2] drm/radeon/mst: port some MST setup code from DAL.
From: Dave Airlie This ports the DAL timeouts and MST rate calculations for the hw from the DAL codebase. Signed-off-by: Dave Airlie --- drivers/gpu/drm/radeon/ni_reg.h| 2 ++ drivers/gpu/drm/radeon/radeon_dp_mst.c | 23 +++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/radeon/ni_reg.h b/drivers/gpu/drm/radeon/ni_reg.h index da310a7..827ccc8 100644 --- a/drivers/gpu/drm/radeon/ni_reg.h +++ b/drivers/gpu/drm/radeon/ni_reg.h @@ -109,6 +109,8 @@ #define NI_DP_MSE_SAT2 0x7398 #define NI_DP_MSE_SAT_UPDATE 0x739c +# define NI_DP_MSE_SAT_UPDATE_MASK 0x3 +# define NI_DP_MSE_16_MTP_KEEPOUT0x100 #define NI_DIG_BE_CNTL 0x7140 # define NI_DIG_FE_SOURCE_SELECT(x) (((x) & 0x7f) << 8) diff --git a/drivers/gpu/drm/radeon/radeon_dp_mst.c b/drivers/gpu/drm/radeon/radeon_dp_mst.c index 43cffb5..b3b2d05 100644 --- a/drivers/gpu/drm/radeon/radeon_dp_mst.c +++ b/drivers/gpu/drm/radeon/radeon_dp_mst.c @@ -89,8 +89,16 @@ static int radeon_dp_mst_set_stream_attrib(struct radeon_encoder *primary, WREG32(NI_DP_MSE_SAT_UPDATE + primary->offset, 1); do { + unsigned value1, value2; + udelay(10); temp = RREG32(NI_DP_MSE_SAT_UPDATE + primary->offset); - } while ((temp & 0x1) && retries++ < 1); + + value1 = temp & NI_DP_MSE_SAT_UPDATE_MASK; + value2 = temp & NI_DP_MSE_16_MTP_KEEPOUT; + + if (!value1 && !value2) + break; + } while (retries++ < 50); if (retries == 1) DRM_ERROR("timed out waitin for SAT update %d\n", primary->offset); @@ -150,7 +158,7 @@ static int radeon_dp_mst_update_stream_attribs(struct radeon_connector *mst_conn return 0; } -static int radeon_dp_mst_set_vcp_size(struct radeon_encoder *mst, uint32_t x, uint32_t y) +static int radeon_dp_mst_set_vcp_size(struct radeon_encoder *mst, s64 avg_time_slots_per_mtp) { struct drm_device *dev = mst->base.dev; struct radeon_device *rdev = dev->dev_private; @@ -158,6 +166,8 @@ static int radeon_dp_mst_set_vcp_size(struct radeon_encoder *mst, uint32_t x, ui uint32_t val, temp; uint32_t offset = radeon_atom_set_enc_offset(mst_enc->fe); int retries = 0; + uint32_t x = drm_fixp2int(avg_time_slots_per_mtp); + uint32_t y = drm_fixp2int_ceil((avg_time_slots_per_mtp - x) << 26); val = NI_DP_MSE_RATE_X(x) | NI_DP_MSE_RATE_Y(y); @@ -165,6 +175,7 @@ static int radeon_dp_mst_set_vcp_size(struct radeon_encoder *mst, uint32_t x, ui do { temp = RREG32(NI_DP_MSE_RATE_UPDATE + offset); + udelay(10); } while ((temp & 0x1) && (retries++ < 1)); if (retries >= 1) @@ -394,7 +405,7 @@ radeon_mst_encoder_dpms(struct drm_encoder *encoder, int mode) struct drm_crtc *crtc; struct radeon_crtc *radeon_crtc; int ret, slots; - + s64 fixed_pbn, fixed_pbn_per_slot, avg_time_slots_per_mtp; if (!ASIC_IS_DCE5(rdev)) { DRM_ERROR("got mst dpms on non-DCE5\n"); return; @@ -456,7 +467,11 @@ radeon_mst_encoder_dpms(struct drm_encoder *encoder, int mode) mst_enc->enc_active = true; radeon_dp_mst_update_stream_attribs(radeon_connector->mst_port, primary); - radeon_dp_mst_set_vcp_size(radeon_encoder, slots, 0); + + fixed_pbn = drm_int2fixp(mst_enc->pbn); + fixed_pbn_per_slot = drm_int2fixp(radeon_connector->mst_port->mst_mgr.pbn_div); + avg_time_slots_per_mtp = drm_fixp_div(fixed_pbn, fixed_pbn_per_slot); + radeon_dp_mst_set_vcp_size(radeon_encoder, avg_time_slots_per_mtp); atombios_dig_encoder_setup2(&primary->base, ATOM_ENCODER_CMD_DP_VIDEO_ON, 0, mst_enc->fe); -- 2.5.0
[PATCH 2/2] drm/radeon: use helper for mst connector dpms.
From: Dave Airlie I noticed my monitor didn't power off when it should, this should fix it. Signed-off-by: Dave Airlie --- drivers/gpu/drm/radeon/radeon_dp_mst.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_dp_mst.c b/drivers/gpu/drm/radeon/radeon_dp_mst.c index b3b2d05..de504ea 100644 --- a/drivers/gpu/drm/radeon/radeon_dp_mst.c +++ b/drivers/gpu/drm/radeon/radeon_dp_mst.c @@ -257,14 +257,8 @@ radeon_dp_mst_connector_destroy(struct drm_connector *connector) kfree(radeon_connector); } -static int radeon_connector_dpms(struct drm_connector *connector, int mode) -{ - DRM_DEBUG_KMS("\n"); - return 0; -} - static const struct drm_connector_funcs radeon_dp_mst_connector_funcs = { - .dpms = radeon_connector_dpms, + .dpms = drm_helper_connector_dpms, .detect = radeon_dp_mst_detect, .fill_modes = drm_helper_probe_single_connector_modes, .destroy = radeon_dp_mst_connector_destroy, -- 2.5.0
[Bug 93767] Glitches with soft shadows and MSAA in Knights of the Old Republic 2
https://bugs.freedesktop.org/show_bug.cgi?id=93767 --- Comment #5 from Nicolai H�hnle --- Hi Daniel, thanks for the apitrace and preliminary investigation. I can confirm that the trace shows a rendering error on Verde, Bonaire, and Tonga. A workaround for now is to set R600_DEBUG=nohyperz. Could you please test whether the problem appears also on lower MSAA levels? almos, I'm surprised that you're not seeing the glitch. What's your system setup and hardware? A proper fix may involve disabling ALLOW_EXPCLEAR for MSAA stencil. -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160406/de11f2e0/attachment.html>
[PATCH] drm/radeon: add support for SET_APPEND_CNT packet3
From: Dave Airlie This adds support to the command parser for the set append counter packet3, this is required to support atomic counters on evergreen/cayman GPUs. Signed-off-by: Dave Airlie --- drivers/gpu/drm/radeon/evergreen_cs.c | 38 +++ drivers/gpu/drm/radeon/evergreend.h | 20 ++ drivers/gpu/drm/radeon/radeon_drv.c | 3 ++- 3 files changed, 60 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/radeon/evergreen_cs.c b/drivers/gpu/drm/radeon/evergreen_cs.c index 9e93205..1f618c5 100644 --- a/drivers/gpu/drm/radeon/evergreen_cs.c +++ b/drivers/gpu/drm/radeon/evergreen_cs.c @@ -2608,6 +2608,44 @@ static int evergreen_packet3_check(struct radeon_cs_parser *p, } } break; + case PACKET3_SET_APPEND_CNT: + { + uint32_t areg; + if (pkt->count != 2) { + DRM_ERROR("bad SET_APPEND_CNT (invalid count)\n"); + return -EINVAL; + } + + areg = idx_value >> 16; + if (areg < 0x1cb || areg > 0x1cb + 8) { + dev_warn(p->dev, "forbidden register for append cnt 0x%08x at %d\n", +areg, idx); + return -EINVAL; + } + + if ((idx_value & 0x3) == 0x3) { /* Read from memory address */ + uint64_t offset; + uint32_t swap; + r = radeon_cs_packet_next_reloc(p, &reloc, 0); + if (r) { + DRM_ERROR("bad SET_APPEND_CNT (missing reloc)\n"); + return -EINVAL; + } + offset = radeon_get_ib_value(p, idx+1); + swap = offset & 0x3; + offset &= ~0x3; + + offset += ((u64)(radeon_get_ib_value(p, idx+2) & 0xff)) << 32; + + offset += reloc->gpu_offset; + ib[idx+1] = (offset & 0xfffc) | swap; + ib[idx+2] = upper_32_bits(offset) & 0xff; + } else { + DRM_ERROR("bad SET_APPEND_CNT (unsupported operation)\n"); + return -EINVAL; + } + break; + } case PACKET3_NOP: break; default: diff --git a/drivers/gpu/drm/radeon/evergreend.h b/drivers/gpu/drm/radeon/evergreend.h index 13b6029..2e2f740 100644 --- a/drivers/gpu/drm/radeon/evergreend.h +++ b/drivers/gpu/drm/radeon/evergreend.h @@ -1689,6 +1689,26 @@ #definePACKET3_SET_CONTEXT_REG_INDIRECT0x73 #definePACKET3_SET_RESOURCE_INDIRECT 0x74 #definePACKET3_SET_APPEND_CNT 0x75 +/* SET_APPEND_CNT - documentation + * 1. header + * 2. COMMAND + * 1:0 - SOURCE SEL + * 15:2 - Reserved + * 31:16 - WR_REG_OFFSET - context register to write source data to. + * (one of R_02872C_GDS_APPEND_COUNT_0-8) + * 3. CONTROL + * (for source == mem) + * 31:2 SRC_ADDRESS_LO + * 0:1 SWAP + * (for source == GDS) + * 31:0 GDS offset + * (for source == DATA) + * 31:0 DATA + * (for source == REG) + * 31:0 REG + * 4. SRC_ADDRESS_HI[7:0] + * kernel driver 2.44 only supports SRC == MEM. + */ #defineSQ_RESOURCE_CONSTANT_WORD7_00x3001c #defineS__SQ_CONSTANT_TYPE(x) (((x) & 3) << 30) diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index a4b5dbd..1f96b04 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c @@ -93,9 +93,10 @@ * 2.41.0 - evergreen/cayman: Add SET_BASE/DRAW_INDIRECT command parsing support * 2.42.0 - Add VCE/VUI (Video Usability Information) support * 2.43.0 - RADEON_INFO_GPU_RESET_COUNTER + * 2.44.0 - SET_APPEND_CNT packet3 support */ #define KMS_DRIVER_MAJOR 2 -#define KMS_DRIVER_MINOR 43 +#define KMS_DRIVER_MINOR 44 #define KMS_DRIVER_PATCHLEVEL 0 int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags); int radeon_driver_unload_kms(struct drm_device *dev); -- 2.5.5
[Bug 93767] Glitches with soft shadows and MSAA in Knights of the Old Republic 2
https://bugs.freedesktop.org/show_bug.cgi?id=93767 --- Comment #6 from Daniel Scharrer --- Hi, thanks for looking into this. The problem happens on all MSAA levels the game offers: 2, 4 and 6 (I assume this maps to 8). The there are less lines with lower MSAA levels though, or at least they are less noticeable. R600_DEBUG=nohyperz does get rid of the glitches for all MSAA levels. -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160406/96ee247a/attachment-0001.html>
[Bug 93767] Glitches with soft shadows and MSAA in Knights of the Old Republic 2
https://bugs.freedesktop.org/show_bug.cgi?id=93767 --- Comment #7 from almos --- Created attachment 122748 --> https://bugs.freedesktop.org/attachment.cgi?id=122748&action=edit kotor2-shadows-frame296.png (In reply to Nicolai H�hnle from comment #5) > almos, I'm surprised that you're not seeing the glitch. What's your system > setup and hardware? I attached the saved image of frame 296 (which contains call 1919333 mentioned in the original report) from the shadows trace. I don't see corruption on it, even though MSAA seems to be enabled in glretrace. My card is a R9 270x, and I have Mesa 11.1.2, LLVM 3.7.1. -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160406/614e9fa8/attachment.html>
[Bug 94835] Increase fragment shader sample limits from 16 to 32 (AMD Linux - Mesa/RadeonSi)
https://bugs.freedesktop.org/show_bug.cgi?id=94835 Bug ID: 94835 Summary: Increase fragment shader sample limits from 16 to 32 (AMD Linux - Mesa/RadeonSi) Product: Mesa Version: git Hardware: All OS: Linux (All) Status: NEW Severity: normal Priority: medium Component: Drivers/Gallium/radeonsi Assignee: dri-devel at lists.freedesktop.org Reporter: esmith at feralinteractive.com QA Contact: dri-devel at lists.freedesktop.org Please increase fragment shader sample limits from 16 to 32. This is causing serious issues with Company Of Heroes 2 as the engine needs more than 16 samplers to correctly render the floor. Please note: Mesa support 32 samplers with their Intel drivers, but not AMD. See GL_MAX_TEXTURE_IMAGE_UNITS_ARB in https://people.freedesktop.org/~imirkin/glxinfo/glxinfo.html Feral can provide a Steam key to active Mesa engineers working on this issue if that would help their progress. YOU should be abel to use Intel Mesa as a reference as that draws correctly as it has a higher texture sampler limit. -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160406/5abdf797/attachment.html>
[Bug 94835] Increase fragment shader sample limits from 16 to 32 (AMD Linux - Mesa/RadeonSi)
https://bugs.freedesktop.org/show_bug.cgi?id=94835 Edwin Smith changed: What|Removed |Added See Also||https://bugs.freedesktop.or ||g/show_bug.cgi?id=94705, ||https://bugs.freedesktop.or ||g/show_bug.cgi?id=91951 Blocks||94705 -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160406/911752b7/attachment.html>
[Bug 94705] [radeonsi] blue ground in Company of Heroes 2
https://bugs.freedesktop.org/show_bug.cgi?id=94705 Edwin Smith changed: What|Removed |Added Depends on||94835 See Also||https://bugs.freedesktop.or ||g/show_bug.cgi?id=94835 -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160406/a5c50bbd/attachment.html>
[Bug 94835] Increase fragment shader sample limits from 16 to 32 (AMD Linux - Mesa/RadeonSi)
https://bugs.freedesktop.org/show_bug.cgi?id=94835 --- Comment #1 from Edwin Smith --- Added links to: 94705 - CoH2 specific bug logged by an end user showing the side effect if the sampler limit is reached on AMD. 91951 - Unsure if exactly the same issue but potentially a similar root cause. This was logged agains ARMA 3 developer by another developer so I have no insight other than finding the bug when looking for duplicates before logging. -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160406/9e3db029/attachment.html>
[Bug 94705] [radeonsi] blue ground in Company of Heroes 2
https://bugs.freedesktop.org/show_bug.cgi?id=94705 --- Comment #5 from Edwin Smith --- I have logged a specific bug for this request here along with some extra information that might come in handy when implementing this: https://bugs.freedesktop.org/show_bug.cgi?id=94835 I have also marked this bug as depends on 94835. -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160406/012351ee/attachment.html>
[PATCH] drm/radeon: add support for SET_APPEND_CNT packet3
Am 06.04.2016 um 08:03 schrieb Dave Airlie: > From: Dave Airlie > > This adds support to the command parser for the set append counter > packet3, this is required to support atomic counters on > evergreen/cayman GPUs. > > Signed-off-by: Dave Airlie > --- > drivers/gpu/drm/radeon/evergreen_cs.c | 38 > +++ > drivers/gpu/drm/radeon/evergreend.h | 20 ++ > drivers/gpu/drm/radeon/radeon_drv.c | 3 ++- > 3 files changed, 60 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/radeon/evergreen_cs.c > b/drivers/gpu/drm/radeon/evergreen_cs.c > index 9e93205..1f618c5 100644 > --- a/drivers/gpu/drm/radeon/evergreen_cs.c > +++ b/drivers/gpu/drm/radeon/evergreen_cs.c > @@ -2608,6 +2608,44 @@ static int evergreen_packet3_check(struct > radeon_cs_parser *p, > } > } > break; > + case PACKET3_SET_APPEND_CNT: > + { > + uint32_t areg; > + if (pkt->count != 2) { > + DRM_ERROR("bad SET_APPEND_CNT (invalid count)\n"); > + return -EINVAL; > + } > + > + areg = idx_value >> 16; > + if (areg < 0x1cb || areg > 0x1cb + 8) { Using defines instead of numbers would be nice to have here. With or without this change the patch is Reviewed-by: Christian König Regards, Christian. > + dev_warn(p->dev, "forbidden register for append cnt > 0x%08x at %d\n", > + areg, idx); > + return -EINVAL; > + } > + > + if ((idx_value & 0x3) == 0x3) { /* Read from memory address */ > + uint64_t offset; > + uint32_t swap; > + r = radeon_cs_packet_next_reloc(p, &reloc, 0); > + if (r) { > + DRM_ERROR("bad SET_APPEND_CNT (missing > reloc)\n"); > + return -EINVAL; > + } > + offset = radeon_get_ib_value(p, idx+1); > + swap = offset & 0x3; > + offset &= ~0x3; > + > + offset += ((u64)(radeon_get_ib_value(p, idx+2) & 0xff)) > << 32; > + > + offset += reloc->gpu_offset; > + ib[idx+1] = (offset & 0xfffc) | swap; > + ib[idx+2] = upper_32_bits(offset) & 0xff; > + } else { > + DRM_ERROR("bad SET_APPEND_CNT (unsupported > operation)\n"); > + return -EINVAL; > + } > + break; > + } > case PACKET3_NOP: > break; > default: > diff --git a/drivers/gpu/drm/radeon/evergreend.h > b/drivers/gpu/drm/radeon/evergreend.h > index 13b6029..2e2f740 100644 > --- a/drivers/gpu/drm/radeon/evergreend.h > +++ b/drivers/gpu/drm/radeon/evergreend.h > @@ -1689,6 +1689,26 @@ > #define PACKET3_SET_CONTEXT_REG_INDIRECT0x73 > #define PACKET3_SET_RESOURCE_INDIRECT 0x74 > #define PACKET3_SET_APPEND_CNT 0x75 > +/* SET_APPEND_CNT - documentation > + * 1. header > + * 2. COMMAND > + * 1:0 - SOURCE SEL > + * 15:2 - Reserved > + * 31:16 - WR_REG_OFFSET - context register to write source data to. > + * (one of R_02872C_GDS_APPEND_COUNT_0-8) > + * 3. CONTROL > + * (for source == mem) > + * 31:2 SRC_ADDRESS_LO > + * 0:1 SWAP > + * (for source == GDS) > + * 31:0 GDS offset > + * (for source == DATA) > + * 31:0 DATA > + * (for source == REG) > + * 31:0 REG > + * 4. SRC_ADDRESS_HI[7:0] > + * kernel driver 2.44 only supports SRC == MEM. > + */ > > #define SQ_RESOURCE_CONSTANT_WORD7_00x3001c > #define S__SQ_CONSTANT_TYPE(x) (((x) & 3) << > 30) > diff --git a/drivers/gpu/drm/radeon/radeon_drv.c > b/drivers/gpu/drm/radeon/radeon_drv.c > index a4b5dbd..1f96b04 100644 > --- a/drivers/gpu/drm/radeon/radeon_drv.c > +++ b/drivers/gpu/drm/radeon/radeon_drv.c > @@ -93,9 +93,10 @@ >* 2.41.0 - evergreen/cayman: Add SET_BASE/DRAW_INDIRECT command parsing > support >* 2.42.0 - Add VCE/VUI (Video Usability Information) support >* 2.43.0 - RADEON_INFO_GPU_RESET_COUNTER > + * 2.44.0 - SET_APPEND_CNT packet3 support >*/ > #define KMS_DRIVER_MAJOR2 > -#define KMS_DRIVER_MINOR 43 > +#define KMS_DRIVER_MINOR 44 > #define KMS_DRIVER_PATCHLEVEL 0 > int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags); > int radeon_driver_unload_kms(struct drm_device *dev);
[Intel-gfx] [PATCH 1/3] drm/edid: Add drm_edid_get_monitor_name()
On Tue, 05 Apr 2016, Jim Bride wrote: > In order to include monitor name information in debugfs > output we needed to add a function that would extract the > monitor name from the EDID, and that function needed to > reside in the file where the rest of the EDID helper > functions are implemented. > > cc: dri-devel at lists.freedesktop.org > Signed-off-by: Jim Bride > --- > drivers/gpu/drm/drm_edid.c | 28 > include/drm/drm_crtc.h | 1 + > 2 files changed, 29 insertions(+) > > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c > index 558ef9f..fc69a46 100644 > --- a/drivers/gpu/drm/drm_edid.c > +++ b/drivers/gpu/drm/drm_edid.c > @@ -3569,6 +3569,34 @@ struct drm_connector *drm_select_eld(struct > drm_encoder *encoder) > EXPORT_SYMBOL(drm_select_eld); > > /** > + * drm_edid_get_monitor_name - fetch the monitor name from the edid > + * @edid: monitor EDID information > + * @name: pointer to a character array of at least 13 chars to hold the name Mixed feelings about "at least 13 chars". It might be simpler for this one thing, but I hate to see this assumption of "at least 13 chars" get spread around in patch 2 to where it's no longer obvious where this requirement comes from. Seeing that this is mostly copy-paste from drm_edid_to_eld(), I think this patch should be an abstraction of that code to a separate function. > + * > + * Return: True if the name could be extracted, false otherwise > + */ > +bool drm_edid_get_monitor_name(struct edid *edid, char *name) > +{ > + char *edid_name = NULL; > + int mnl; > + > + if (!edid || !name) > + return false; > + > + drm_for_each_detailed_block((u8 *)edid, monitor_name, &edid_name); > + for (mnl = 0; edid_name && mnl < 13; mnl++) { > + if (edid_name[mnl] == 0x0a) { > + name[mnl] = '\0'; Depending on edid_name you might not terminate the string. And, in fact, if you make this an abstraction for drm_edid_to_eld(), you might be better off *not* terminating, which OTOH is not nice for your other use in patch 2. So how about first adding an internal abstraction: static int get_monitor_name(struct edid *edid, char name[13]) which does *not* terminate the string, and returns length, 0 for edid_name == NULL. Works nicely for drm_edid_to_eld(). Then you could add the external interface on top of that: static void drm_edid_get_monitor_name(struct edid *edid, char *buf, int bufsize) which would always terminate the string (assuming bufsize > 0), even on errors so you can get rid of the return value. This simplifies your follow up code, and if we later on need more robust error handling, it's easy to add the return value. BR, Jani. > + break; > + } > + name[mnl] = edid_name[mnl]; > + } > + > + return mnl ? true : false; > +} > +EXPORT_SYMBOL(drm_edid_get_monitor_name); > + > +/** > * drm_detect_hdmi_monitor - detect whether monitor is HDMI > * @edid: monitor EDID information > * > diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h > index 8cb377c..2590168 100644 > --- a/include/drm/drm_crtc.h > +++ b/include/drm/drm_crtc.h > @@ -2500,6 +2500,7 @@ extern int drm_edid_header_is_valid(const u8 *raw_edid); > extern bool drm_edid_block_valid(u8 *raw_edid, int block, bool > print_bad_edid, >bool *edid_corrupt); > extern bool drm_edid_is_valid(struct edid *edid); > +extern bool drm_edid_get_monitor_name(struct edid *edid, char *name); > > extern struct drm_tile_group *drm_mode_create_tile_group(struct drm_device > *dev, >char topology[8]); -- Jani Nikula, Intel Open Source Technology Center
Black screen with KABINI with kernel 4.5 with or without DAL
2016-04-05 08:27 keltezéssel, Michel Dänzer Ãrta: > On 05.04.2016 13:07, Boszormenyi Zoltan wrote: >> 2016-04-05 05:40 keltezéssel, Michel Dänzer Ãrta: >>> On 05.04.2016 00:25, Boszormenyi Zoltan wrote: The application is Chromium in kiosk mode. The problem is that sometimes the screen stays black after KMS kicks in. >>> So the problem occurs even without X? Does it affect HDMI or >>> DisplayPort, or both? >> It occurs on both but not without X. Ctrl-Alt-F2 gives me the >> console login prompt. My phrasing was not what I wanted to write >> and didn't finish the sentence really. X is started very early during >> boot so I can see the console message only momentarily while >> the screen is still in 80x25 VGA text mode. Restarting Xorg via >> systemctl makes it working most of the time. >> >> Apparently, it's not Radeon specific. We were also able to reproduce >> it on an Intel machine, too, with internal LVDS and external VGA outputs. > I suspect it's a client side problem then. I have upgraded a bunch of Xorg libraries, the server to 1.18.3 and rebuilt all the drivers for the new server and the problem doesn't occur anymore. It may be possible that we have hit some race problems (like the one fixed in libxcb-1.11.1) but I didn't have the time to test every piece separately. I would have done this mass upgrade sooner or later anyway. > Comparing the good and bad > dmesg output shows that Xorg is busily updating the screen in the good > case (visible as radeon_crtc_page_flip gets called by TearFree) but not > so in the bad case. Since the default Xorg startup behaviour is a black > screen, it sounds like simply no client connects to Xorg / draws > anything to the screen in the bad case. Maybe there's a race which can > result in the client(s) starting up before Xorg, failing to establish > the display connection, or something like that. > > >> Is Xorg 1.16.4 still a supported version with new kernels? > There's no direct version inter-dependency between Xorg and the kernel. Noted. Thanks for looking into it, Zoltán Böszörményi
RFC: Some TTM patches
Hi everyone, attached are six TTM patches and one Amdgpu patch I came up with while working on a new TTM feature. The first patch is a bug fix. TTM was always waiting for on a BO to be idle when initially creating it. Previously that didn't matter much because a newly created BO should always be idle. But with the possibility of importing DMA-buf reservation objects into a TTM BO that sometimes isn't the case any more. Patches 2, 3 and 4 are just cleanups, e.g. removal of unused parameters and variables. Patches 5 and 6 now finally implement the new LRU features in TTM. Basically we want to give the driver more fine grained control about the order in which the BOs are added to the LRU. For this patch number 5 implements an optional LRU removal callback, giving the driver the chance to updates it's internal LRU handling as well. Patch number 6 add two callback functions which return the list head after which a BO should be inserted into the LRU. Default implementations for those are provided and wired up in all drivers with this patch. The Amdgpu patch now uses the new callbacks to implement a LRU order so that VM page table BOs always come behind everything else. I actually don't intent to commit this patch, but it was good for testing. In the end we want to use this LRU order for allowing HSA applications to have their BOs after the graphics allocations because preempting HSA processes under resource shortage has a huge bunch of overhead. Another use Alex suggested is to sort the BOs in the LRU by size. So that we don't swap out a 200MB BO to make room for a 1MB allocation. Please review and comment, Christian.
[PATCH 4/7] drm/ttm: remove unused validation sequence
From: Christian König Not used any more. Signed-off-by: Christian König Reviewed-by: Alex Deucher --- drivers/gpu/drm/ttm/ttm_bo.c| 1 - include/drm/ttm/ttm_bo_driver.h | 2 -- 2 files changed, 3 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 1a5a0a2..dbb0bb7 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -1514,7 +1514,6 @@ int ttm_bo_device_init(struct ttm_bo_device *bdev, bdev->dev_mapping = mapping; bdev->glob = glob; bdev->need_dma32 = need_dma32; - bdev->val_seq = 0; mutex_lock(&glob->device_list_mutex); list_add_tail(&bdev->device_list, &glob->device_list); mutex_unlock(&glob->device_list_mutex); diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index 5d118ed..391ef04 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h @@ -502,7 +502,6 @@ struct ttm_bo_global { * @vma_manager: Address space manager * lru_lock: Spinlock that protects the buffer+device lru lists and * ddestroy lists. - * @val_seq: Current validation sequence. * @dev_mapping: A pointer to the struct address_space representing the * device address space. * @wq: Work queue structure for the delayed delete workqueue. @@ -528,7 +527,6 @@ struct ttm_bo_device { * Protected by the global:lru lock. */ struct list_head ddestroy; - uint32_t val_seq; /* * Protected by load / firstopen / lastclose /unload sync. -- 2.5.0
[PATCH 1/7] drm/ttm: don't wait for BO on initial allocation
From: Christian König When we use an extern reservation object that otherwise waits for every fence registered with it. Signed-off-by: Christian König Reviewed-by: Alex Deucher --- drivers/gpu/drm/ttm/ttm_bo.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 4cbf265..367b87b 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -998,13 +998,19 @@ static int ttm_bo_move_buffer(struct ttm_buffer_object *bo, lockdep_assert_held(&bo->resv->lock.base); /* -* FIXME: It's possible to pipeline buffer moves. -* Have the driver move function wait for idle when necessary, -* instead of doing it here. +* Don't wait for the BO on initial allocation. This is important when +* the BO has an imported reservation object. */ - ret = ttm_bo_wait(bo, false, interruptible, no_wait_gpu); - if (ret) - return ret; + if (bo->mem.mem_type != TTM_PL_SYSTEM || bo->ttm != NULL) { + /* +* FIXME: It's possible to pipeline buffer moves. +* Have the driver move function wait for idle when necessary, +* instead of doing it here. +*/ + ret = ttm_bo_wait(bo, false, interruptible, no_wait_gpu); + if (ret) + return ret; + } mem.num_pages = bo->num_pages; mem.size = mem.num_pages << PAGE_SHIFT; mem.page_alignment = bo->mem.page_alignment; -- 2.5.0
[PATCH 7/7] drm/amdgpu: prefer VM page tables over normal BOs
From: Christian König Keep VM page tables behind normal BOs on the LRU. Signed-off-by: Christian König Acked-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 4 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 53 +++-- 2 files changed, 55 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index c4a21c6..1b5e7db 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -408,6 +408,10 @@ struct amdgpu_mman { struct amdgpu_ring *buffer_funcs_ring; /* Scheduler entity for buffer moves */ struct amd_sched_entity entity; + + /* custom LRU management */ + struct list_head*lru[TTM_NUM_MEM_TYPES]; + struct list_head*swap_lru; }; int amdgpu_copy_buffer(struct amdgpu_ring *ring, diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index fefaa9b..f3d118b 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c @@ -910,6 +910,49 @@ uint32_t amdgpu_ttm_tt_pte_flags(struct amdgpu_device *adev, struct ttm_tt *ttm, return flags; } +static void amdgpu_ttm_lru_removal(struct ttm_buffer_object *tbo) +{ + struct amdgpu_device *adev = amdgpu_get_adev(tbo->bdev); + + if (&tbo->lru == adev->mman.lru[tbo->mem.mem_type]) + adev->mman.lru[tbo->mem.mem_type] = tbo->lru.prev; + + if (&tbo->swap == adev->mman.swap_lru) + adev->mman.swap_lru = tbo->swap.prev; +} + +static struct list_head *amdgpu_ttm_lru_tail(struct ttm_buffer_object *tbo) +{ + struct amdgpu_bo *bo = container_of(tbo, struct amdgpu_bo, tbo); + struct amdgpu_device *adev = amdgpu_get_adev(tbo->bdev); + struct list_head *res; + + /* only VM BOs have a parent set */ + if (bo->parent) + return ttm_bo_default_lru_tail(tbo); + + res = adev->mman.lru[tbo->mem.mem_type]; + adev->mman.lru[tbo->mem.mem_type] = &tbo->lru; + + return res; +} + +static struct list_head *amdgpu_ttm_swap_lru_tail(struct ttm_buffer_object *tbo) +{ + struct amdgpu_bo *bo = container_of(tbo, struct amdgpu_bo, tbo); + struct amdgpu_device *adev = amdgpu_get_adev(tbo->bdev); + struct list_head *res; + + /* only VM BOs have a parent set */ + if (bo->parent) + return ttm_bo_default_swap_lru_tail(tbo); + + res = adev->mman.swap_lru; + adev->mman.swap_lru = &tbo->swap; + + return res; +} + static struct ttm_bo_driver amdgpu_bo_driver = { .ttm_tt_create = &amdgpu_ttm_tt_create, .ttm_tt_populate = &amdgpu_ttm_tt_populate, @@ -923,12 +966,14 @@ static struct ttm_bo_driver amdgpu_bo_driver = { .fault_reserve_notify = &amdgpu_bo_fault_reserve_notify, .io_mem_reserve = &amdgpu_ttm_io_mem_reserve, .io_mem_free = &amdgpu_ttm_io_mem_free, - .lru_tail = &ttm_bo_default_lru_tail, - .swap_lru_tail = &ttm_bo_default_swap_lru_tail, + .lru_removal = &amdgpu_ttm_lru_removal, + .lru_tail = &amdgpu_ttm_lru_tail, + .swap_lru_tail = &amdgpu_ttm_swap_lru_tail, }; int amdgpu_ttm_init(struct amdgpu_device *adev) { + unsigned i; int r; r = amdgpu_ttm_global_init(adev); @@ -946,6 +991,10 @@ int amdgpu_ttm_init(struct amdgpu_device *adev) DRM_ERROR("failed initializing buffer object driver(%d).\n", r); return r; } + for (i = 0; i < TTM_NUM_MEM_TYPES; ++i) + adev->mman.lru[i] = &adev->mman.bdev.man[i].lru; + adev->mman.swap_lru = &adev->mman.bdev.glob->swap_lru; + adev->mman.initialized = true; r = ttm_bo_init_mm(&adev->mman.bdev, TTM_PL_VRAM, adev->mc.real_vram_size >> PAGE_SHIFT); -- 2.5.0
[PATCH 6/7] drm/ttm: implement LRU add callbacks v2
From: Christian König This allows fine grained control for the driver where to add a BO into the LRU. v2: fix typo in comment Signed-off-by: Christian König Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 ++ drivers/gpu/drm/ast/ast_ttm.c | 2 ++ drivers/gpu/drm/bochs/bochs_mm.c| 2 ++ drivers/gpu/drm/cirrus/cirrus_ttm.c | 2 ++ drivers/gpu/drm/mgag200/mgag200_ttm.c | 2 ++ drivers/gpu/drm/nouveau/nouveau_bo.c| 2 ++ drivers/gpu/drm/qxl/qxl_ttm.c | 2 ++ drivers/gpu/drm/radeon/radeon_ttm.c | 2 ++ drivers/gpu/drm/ttm/ttm_bo.c| 29 - drivers/gpu/drm/virtio/virtgpu_ttm.c| 2 ++ drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c | 2 ++ include/drm/ttm/ttm_bo_driver.h | 9 + 12 files changed, 49 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index 9d3341d..fefaa9b 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c @@ -923,6 +923,8 @@ static struct ttm_bo_driver amdgpu_bo_driver = { .fault_reserve_notify = &amdgpu_bo_fault_reserve_notify, .io_mem_reserve = &amdgpu_ttm_io_mem_reserve, .io_mem_free = &amdgpu_ttm_io_mem_free, + .lru_tail = &ttm_bo_default_lru_tail, + .swap_lru_tail = &ttm_bo_default_swap_lru_tail, }; int amdgpu_ttm_init(struct amdgpu_device *adev) diff --git a/drivers/gpu/drm/ast/ast_ttm.c b/drivers/gpu/drm/ast/ast_ttm.c index 08f82ea..59f2f93 100644 --- a/drivers/gpu/drm/ast/ast_ttm.c +++ b/drivers/gpu/drm/ast/ast_ttm.c @@ -245,6 +245,8 @@ struct ttm_bo_driver ast_bo_driver = { .verify_access = ast_bo_verify_access, .io_mem_reserve = &ast_ttm_io_mem_reserve, .io_mem_free = &ast_ttm_io_mem_free, + .lru_tail = &ttm_bo_default_lru_tail, + .swap_lru_tail = &ttm_bo_default_swap_lru_tail, }; int ast_mm_init(struct ast_private *ast) diff --git a/drivers/gpu/drm/bochs/bochs_mm.c b/drivers/gpu/drm/bochs/bochs_mm.c index d812ad0..24a30f6 100644 --- a/drivers/gpu/drm/bochs/bochs_mm.c +++ b/drivers/gpu/drm/bochs/bochs_mm.c @@ -212,6 +212,8 @@ struct ttm_bo_driver bochs_bo_driver = { .verify_access = bochs_bo_verify_access, .io_mem_reserve = &bochs_ttm_io_mem_reserve, .io_mem_free = &bochs_ttm_io_mem_free, + .lru_tail = &ttm_bo_default_lru_tail, + .swap_lru_tail = &ttm_bo_default_swap_lru_tail, }; int bochs_mm_init(struct bochs_device *bochs) diff --git a/drivers/gpu/drm/cirrus/cirrus_ttm.c b/drivers/gpu/drm/cirrus/cirrus_ttm.c index dfffd52..6768b7b 100644 --- a/drivers/gpu/drm/cirrus/cirrus_ttm.c +++ b/drivers/gpu/drm/cirrus/cirrus_ttm.c @@ -245,6 +245,8 @@ struct ttm_bo_driver cirrus_bo_driver = { .verify_access = cirrus_bo_verify_access, .io_mem_reserve = &cirrus_ttm_io_mem_reserve, .io_mem_free = &cirrus_ttm_io_mem_free, + .lru_tail = &ttm_bo_default_lru_tail, + .swap_lru_tail = &ttm_bo_default_swap_lru_tail, }; int cirrus_mm_init(struct cirrus_device *cirrus) diff --git a/drivers/gpu/drm/mgag200/mgag200_ttm.c b/drivers/gpu/drm/mgag200/mgag200_ttm.c index 05108b5..9d5083d 100644 --- a/drivers/gpu/drm/mgag200/mgag200_ttm.c +++ b/drivers/gpu/drm/mgag200/mgag200_ttm.c @@ -245,6 +245,8 @@ struct ttm_bo_driver mgag200_bo_driver = { .verify_access = mgag200_bo_verify_access, .io_mem_reserve = &mgag200_ttm_io_mem_reserve, .io_mem_free = &mgag200_ttm_io_mem_free, + .lru_tail = &ttm_bo_default_lru_tail, + .swap_lru_tail = &ttm_bo_default_swap_lru_tail, }; int mgag200_mm_init(struct mga_device *mdev) diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index 5fe5000..74a8a2c 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c @@ -1611,6 +1611,8 @@ struct ttm_bo_driver nouveau_bo_driver = { .fault_reserve_notify = &nouveau_ttm_fault_reserve_notify, .io_mem_reserve = &nouveau_ttm_io_mem_reserve, .io_mem_free = &nouveau_ttm_io_mem_free, + .lru_tail = &ttm_bo_default_lru_tail, + .swap_lru_tail = &ttm_bo_default_swap_lru_tail, }; struct nvkm_vma * diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c index 9534127..0738d74 100644 --- a/drivers/gpu/drm/qxl/qxl_ttm.c +++ b/drivers/gpu/drm/qxl/qxl_ttm.c @@ -384,6 +384,8 @@ static struct ttm_bo_driver qxl_bo_driver = { .io_mem_reserve = &qxl_ttm_io_mem_reserve, .io_mem_free = &qxl_ttm_io_mem_free, .move_notify = &qxl_bo_move_notify, + .lru_tail = &ttm_bo_default_lru_tail, + .swap_lru_tail = &ttm_bo_default_swap_lru_tail, }; int qxl_ttm_init(struct qxl_device *qdev) diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c index 636c1cf..e31f233 100644 --- a/drivers/gpu/drm/radeon/radeon_ttm.c +++ b/drivers/gpu/drm/r
[PATCH 3/7] drm/ttm: remove lazy parameter from ttm_bo_wait
From: Christian König Not used any more. Signed-off-by: Christian König Reviewed-by: Alex Deucher --- drivers/gpu/drm/nouveau/nouveau_bo.c | 2 +- drivers/gpu/drm/nouveau/nouveau_gem.c| 4 ++-- drivers/gpu/drm/qxl/qxl_cmd.c| 2 +- drivers/gpu/drm/qxl/qxl_object.h | 2 +- drivers/gpu/drm/radeon/radeon_object.c | 2 +- drivers/gpu/drm/ttm/ttm_bo.c | 16 drivers/gpu/drm/ttm/ttm_bo_util.c| 2 +- drivers/gpu/drm/ttm/ttm_bo_vm.c | 6 +++--- drivers/gpu/drm/virtio/virtgpu_object.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_resource.c | 4 ++-- include/drm/ttm/ttm_bo_api.h | 2 +- 13 files changed, 24 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index ea89286..5fe5000 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c @@ -1322,7 +1322,7 @@ nouveau_bo_move(struct ttm_buffer_object *bo, bool evict, bool intr, } /* Fallback to software copy. */ - ret = ttm_bo_wait(bo, true, intr, no_wait_gpu); + ret = ttm_bo_wait(bo, intr, no_wait_gpu); if (ret == 0) ret = ttm_bo_move_memcpy(bo, evict, no_wait_gpu, new_mem); diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c index 8d64b65..185 100644 --- a/drivers/gpu/drm/nouveau/nouveau_gem.c +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c @@ -126,7 +126,7 @@ nouveau_gem_object_unmap(struct nouveau_bo *nvbo, struct nvkm_vma *vma) list_del(&vma->head); if (fobj && fobj->shared_count > 1) - ttm_bo_wait(&nvbo->bo, true, false, false); + ttm_bo_wait(&nvbo->bo, false, false); else if (fobj && fobj->shared_count == 1) fence = rcu_dereference_protected(fobj->shared[0], reservation_object_held(resv)); @@ -651,7 +651,7 @@ nouveau_gem_pushbuf_reloc_apply(struct nouveau_cli *cli, data |= r->vor; } - ret = ttm_bo_wait(&nvbo->bo, true, false, false); + ret = ttm_bo_wait(&nvbo->bo, false, false); if (ret) { NV_PRINTK(err, cli, "reloc wait_idle failed: %d\n", ret); break; diff --git a/drivers/gpu/drm/qxl/qxl_cmd.c b/drivers/gpu/drm/qxl/qxl_cmd.c index fdc1833..b5d4b41 100644 --- a/drivers/gpu/drm/qxl/qxl_cmd.c +++ b/drivers/gpu/drm/qxl/qxl_cmd.c @@ -624,7 +624,7 @@ static int qxl_reap_surf(struct qxl_device *qdev, struct qxl_bo *surf, bool stal if (stall) mutex_unlock(&qdev->surf_evict_mutex); - ret = ttm_bo_wait(&surf->tbo, true, true, !stall); + ret = ttm_bo_wait(&surf->tbo, true, !stall); if (stall) mutex_lock(&qdev->surf_evict_mutex); diff --git a/drivers/gpu/drm/qxl/qxl_object.h b/drivers/gpu/drm/qxl/qxl_object.h index 483f131..4d83113 100644 --- a/drivers/gpu/drm/qxl/qxl_object.h +++ b/drivers/gpu/drm/qxl/qxl_object.h @@ -79,7 +79,7 @@ static inline int qxl_bo_wait(struct qxl_bo *bo, u32 *mem_type, if (mem_type) *mem_type = bo->tbo.mem.mem_type; - r = ttm_bo_wait(&bo->tbo, true, true, no_wait); + r = ttm_bo_wait(&bo->tbo, true, no_wait); ttm_bo_unreserve(&bo->tbo); return r; } diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c index 7e0c16c..be30861 100644 --- a/drivers/gpu/drm/radeon/radeon_object.c +++ b/drivers/gpu/drm/radeon/radeon_object.c @@ -838,7 +838,7 @@ int radeon_bo_wait(struct radeon_bo *bo, u32 *mem_type, bool no_wait) if (mem_type) *mem_type = bo->tbo.mem.mem_type; - r = ttm_bo_wait(&bo->tbo, true, true, no_wait); + r = ttm_bo_wait(&bo->tbo, true, no_wait); ttm_bo_unreserve(&bo->tbo); return r; } diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index c935825..1a5a0a2 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -455,7 +455,7 @@ static void ttm_bo_cleanup_refs_or_queue(struct ttm_buffer_object *bo) ret = __ttm_bo_reserve(bo, false, true, NULL); if (!ret) { - if (!ttm_bo_wait(bo, false, false, true)) { + if (!ttm_bo_wait(bo, false, true)) { put_count = ttm_bo_del_from_lru(bo); spin_unlock(&glob->lru_lock); @@ -508,7 +508,7 @@ static int ttm_bo_cleanup_refs_and_unlock(struct ttm_buffer_object *bo, int put_count; int ret; - ret = ttm_bo_wait(bo, false, false, true); + ret = ttm_bo_wait(bo, false, true); if (ret && !no_wait_gpu) { long lret; @@ -545,7 +545,7 @@ static int ttm_bo_cleanup_refs_and_unloc
[PATCH 2/7] drm/ttm: remove use_ticket parameter from ttm_bo_reserve
From: Christian König Not used any more. Signed-off-by: Christian König Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 2 +- drivers/gpu/drm/ast/ast_drv.h | 2 +- drivers/gpu/drm/bochs/bochs_fbdev.c| 2 +- drivers/gpu/drm/bochs/bochs_kms.c | 4 ++-- drivers/gpu/drm/cirrus/cirrus_drv.h| 2 +- drivers/gpu/drm/mgag200/mgag200_drv.h | 2 +- drivers/gpu/drm/nouveau/nouveau_bo.c | 6 +++--- drivers/gpu/drm/nouveau/nouveau_display.c | 4 ++-- drivers/gpu/drm/nouveau/nouveau_gem.c | 6 +++--- drivers/gpu/drm/qxl/qxl_object.h | 4 ++-- drivers/gpu/drm/radeon/radeon_object.c | 2 +- drivers/gpu/drm/radeon/radeon_object.h | 2 +- drivers/gpu/drm/ttm/ttm_bo.c | 17 - drivers/gpu/drm/ttm/ttm_bo_vm.c| 2 +- drivers/gpu/drm/ttm/ttm_execbuf_util.c | 3 +-- drivers/gpu/drm/virtio/virtgpu_drv.h | 2 +- drivers/gpu/drm/virtio/virtgpu_object.c| 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c| 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_dmabuf.c | 8 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c| 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c| 6 +++--- drivers/gpu/drm/vmwgfx/vmwgfx_mob.c| 12 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_resource.c | 7 +++ drivers/gpu/drm/vmwgfx/vmwgfx_shader.c | 2 +- include/drm/ttm/ttm_bo_driver.h| 14 +- 25 files changed, 55 insertions(+), 62 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h index acc0801..bdb01d9 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h @@ -71,7 +71,7 @@ static inline int amdgpu_bo_reserve(struct amdgpu_bo *bo, bool no_intr) { int r; - r = ttm_bo_reserve(&bo->tbo, !no_intr, false, false, 0); + r = ttm_bo_reserve(&bo->tbo, !no_intr, false, NULL); if (unlikely(r != 0)) { if (r != -ERESTARTSYS) dev_err(bo->adev->dev, "%p reserve failed\n", bo); diff --git a/drivers/gpu/drm/ast/ast_drv.h b/drivers/gpu/drm/ast/ast_drv.h index eb57159..908011d 100644 --- a/drivers/gpu/drm/ast/ast_drv.h +++ b/drivers/gpu/drm/ast/ast_drv.h @@ -367,7 +367,7 @@ static inline int ast_bo_reserve(struct ast_bo *bo, bool no_wait) { int ret; - ret = ttm_bo_reserve(&bo->bo, true, no_wait, false, NULL); + ret = ttm_bo_reserve(&bo->bo, true, no_wait, NULL); if (ret) { if (ret != -ERESTARTSYS && ret != -EBUSY) DRM_ERROR("reserve failed %p\n", bo); diff --git a/drivers/gpu/drm/bochs/bochs_fbdev.c b/drivers/gpu/drm/bochs/bochs_fbdev.c index 7520bf8..815c185 100644 --- a/drivers/gpu/drm/bochs/bochs_fbdev.c +++ b/drivers/gpu/drm/bochs/bochs_fbdev.c @@ -82,7 +82,7 @@ static int bochsfb_create(struct drm_fb_helper *helper, bo = gem_to_bochs_bo(gobj); - ret = ttm_bo_reserve(&bo->bo, true, false, false, NULL); + ret = ttm_bo_reserve(&bo->bo, true, false, NULL); if (ret) return ret; diff --git a/drivers/gpu/drm/bochs/bochs_kms.c b/drivers/gpu/drm/bochs/bochs_kms.c index 96926f0..22d7055 100644 --- a/drivers/gpu/drm/bochs/bochs_kms.c +++ b/drivers/gpu/drm/bochs/bochs_kms.c @@ -43,7 +43,7 @@ static int bochs_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y, if (old_fb) { bochs_fb = to_bochs_framebuffer(old_fb); bo = gem_to_bochs_bo(bochs_fb->obj); - ret = ttm_bo_reserve(&bo->bo, true, false, false, NULL); + ret = ttm_bo_reserve(&bo->bo, true, false, NULL); if (ret) { DRM_ERROR("failed to reserve old_fb bo\n"); } else { @@ -57,7 +57,7 @@ static int bochs_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y, bochs_fb = to_bochs_framebuffer(crtc->primary->fb); bo = gem_to_bochs_bo(bochs_fb->obj); - ret = ttm_bo_reserve(&bo->bo, true, false, false, NULL); + ret = ttm_bo_reserve(&bo->bo, true, false, NULL); if (ret) return ret; diff --git a/drivers/gpu/drm/cirrus/cirrus_drv.h b/drivers/gpu/drm/cirrus/cirrus_drv.h index b774d63..2188d6b 100644 --- a/drivers/gpu/drm/cirrus/cirrus_drv.h +++ b/drivers/gpu/drm/cirrus/cirrus_drv.h @@ -245,7 +245,7 @@ static inline int cirrus_bo_reserve(struct cirrus_bo *bo, bool no_wait) { int ret; - ret = ttm_bo_reserve(&bo->bo, true, no_wait, false, NULL); + ret = ttm_bo_reserve(&bo->bo, true, no_wait, NULL); if (ret) { if (ret != -ERESTARTSYS && ret != -EBUSY) DRM_ERROR("reserve failed %p\n", bo); diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.h b/drivers/gpu/drm/mgag200/mgag200_drv.h index 205b280..3e02ac2 100644 --- a/drivers/gpu/drm/mgag200/mgag200_drv.h +++ b/drivers/gpu/drm/mgag200/m
[PATCH 5/7] drm/ttm: add optional LRU removal callback v2
From: Christian König Useful for driver specific LRU handling. v2: fix typo in comment Signed-off-by: Christian König Reviewed-by: Alex Deucher --- drivers/gpu/drm/ttm/ttm_bo.c| 12 +++- include/drm/ttm/ttm_bo_driver.h | 6 ++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index dbb0bb7..84ad992 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -186,8 +186,12 @@ EXPORT_SYMBOL(ttm_bo_add_to_lru); int ttm_bo_del_from_lru(struct ttm_buffer_object *bo) { + struct ttm_bo_device *bdev = bo->bdev; int put_count = 0; + if (bdev->driver->lru_removal) + bdev->driver->lru_removal(bo); + if (!list_empty(&bo->swap)) { list_del_init(&bo->swap); ++put_count; @@ -197,11 +201,6 @@ int ttm_bo_del_from_lru(struct ttm_buffer_object *bo) ++put_count; } - /* -* TODO: Add a driver hook to delete from -* driver-specific LRU's here. -*/ - return put_count; } @@ -235,6 +234,9 @@ void ttm_bo_move_to_lru_tail(struct ttm_buffer_object *bo) lockdep_assert_held(&bo->resv->lock.base); + if (bdev->driver->lru_removal) + bdev->driver->lru_removal(bo); + if (bo->mem.placement & TTM_PL_FLAG_NO_EVICT) { list_del_init(&bo->swap); list_del_init(&bo->lru); diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index 391ef04..23a30b3 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h @@ -434,6 +434,12 @@ struct ttm_bo_driver { */ int (*io_mem_reserve)(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem); void (*io_mem_free)(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem); + + /** +* Optional driver callback for when BO is removed from the LRU. +* Called with LRU lock held immediately before the removal. +*/ + void (*lru_removal)(struct ttm_buffer_object *bo); }; /** -- 2.5.0
[Bug 94043] Distorted graphics when running Battle.net app under Wine with Radeon hardware
https://bugs.freedesktop.org/show_bug.cgi?id=94043 --- Comment #11 from Erik Brangs --- When I replay the trace from bug 87496 with qapitrace, there are two message about an incomplete FBO: 13655: message: api issue 1: FBO incomplete: driver marked FBO as incomplete [-1] 14156: message: api issue 1: FBO incomplete: driver marked FBO as incomplete [-1] Enabling thumbnails shows that all frames are broken. Frames either don't have useful content (only colored rectangles) or the content is distorted as described above. -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160406/0908364d/attachment.html>
[Bug 94043] Distorted graphics when running Battle.net app under Wine with Radeon hardware
https://bugs.freedesktop.org/show_bug.cgi?id=94043 --- Comment #12 from Erik Brangs --- Created attachment 122755 --> https://bugs.freedesktop.org/attachment.cgi?id=122755&action=edit dumped state from apitrace (from bug 87496) at index 13655 -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160406/9c6b7867/attachment.html>
[Bug 94043] Distorted graphics when running Battle.net app under Wine with Radeon hardware
https://bugs.freedesktop.org/show_bug.cgi?id=94043 --- Comment #13 from Erik Brangs --- Created attachment 122756 --> https://bugs.freedesktop.org/attachment.cgi?id=122756&action=edit dumped state from apitrace (from bug 87496) at index 14156 -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160406/4c4f3584/attachment.html>
[Intel-gfx] [PATCH 5/6] drm,i915: Introduce drm_malloc_gfp()
On 05/04/16 14:05, Chris Wilson wrote: > On Tue, Apr 05, 2016 at 01:57:36PM +0100, Chris Wilson wrote: >> I have instances where I want to use drm_malloc_ab() but with a custom >> gfp mask. And with those, where I want a temporary allocation, I want to >> try a high-order kmalloc() before using a vmalloc(). >> >> So refactor my usage into drm_malloc_gfp(). >> >> Signed-off-by: Chris Wilson >> Cc: dri-devel at lists.freedesktop.org >> Cc: Ville Syrjälä >> Reviewed-by: Ville Syrjälä >> Acked-by: Dave Airlie > >> +static __inline__ void *drm_malloc_gfp(size_t nmemb, size_t size, gfp_t gfp) >> +{ >> +if (size != 0 && nmemb > SIZE_MAX / size) >> +return NULL; > > I know Dave G. has some fancy code to detect when the size parameter is > not constant, but one thing I noticed was that gcc would uninline this > function and we would lose the constant folding. Is there anything we > can do to convince gcc to avoid a div here (other than pure macro)? Don't know, apart from maybe _always_inline if it is not considered too big. But I wanted to ask, why it is interesting to allow size == 0 ? Why not: if (size == 0 || nmemb > SIZE_MAX / size) return NULL; ? Regards, Tvrtko
[PATCH] drm: rcar-du: Only unwindow as necessary on probe failure
Simply calling rcar_du_remove on any error can cause unbalanced calls to various functions (e.g. drm_connector_register/unregister, drm_dev_register/drm_dev_unref). This can be seen at bootup of my Porter boards with current next: [2.789322] rcar-du feb0.display: failed to initialize DRM/KMS (-517) [2.796267] [ cut here ] [2.800996] WARNING: CPU: 1 PID: 1 at include/drm/drm_crtc.h:2623 drm_connector_unregister_all+0x60/0x68 [2.810689] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.6.0-rc2-next-20160405-dirty #11 [2.818864] Hardware name: Generic R8A7791 (Flattened Device Tree) [2.825174] Backtrace: [2.827699] [] (dump_backtrace) from [] (show_stack+0x18/0x1c) [2.835430] r7:c042da78 r6:0009 r5:6013 r4: [2.841251] [] (show_stack) from [] (dump_stack+0x84/0xa4) [2.848632] [] (dump_stack) from [] (__warn+0xd0/0x100) [2.855739] r5: r4: [2.859409] [] (__warn) from [] (warn_slowpath_null+0x28/0x30) [2.867139] r9:0001 r8:ef1dc610 r7:ef114010 r6:ef1dc600 r5:ef114010 r4:ef2f2400 [2.875096] [] (warn_slowpath_null) from [] (drm_connector_unregister_all+0x60/0x68) [2.884785] [] (drm_connector_unregister_all) from [] (rcar_du_remove+0x1c/0x5c) [2.894111] r5:ef114010 r4:ef2f2400 [2.897780] [] (rcar_du_remove) from [] (rcar_du_probe+0x1d0/0x210) [2.905953] r5:ef2f2400 r4:fdfb [2.909625] [] (rcar_du_probe) from [] (platform_drv_probe+0x58/0xa8) [2.917976] r9: r8:c0a1cca4 r7:c0a71a48 r6:c0a1cca4 r5:ef1dc610 r4:c0440b80 Adjust the code to only unwind as necessary on probe failures Signed-off-by: Sjoerd Simons --- drivers/gpu/drm/rcar-du/rcar_du_drv.c | 32 +--- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c index 644db36..deb75fa 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c @@ -333,7 +333,7 @@ static int rcar_du_probe(struct platform_device *pdev) rcdu->mmio = devm_ioremap_resource(&pdev->dev, mem); if (IS_ERR(rcdu->mmio)) { ret = PTR_ERR(rcdu->mmio); - goto error; + goto error_dev; } /* Initialize vertical blanking interrupts handling. Start with vblank @@ -342,14 +342,17 @@ static int rcar_du_probe(struct platform_device *pdev) ret = drm_vblank_init(ddev, (1 << rcdu->info->num_crtcs) - 1); if (ret < 0) { dev_err(&pdev->dev, "failed to initialize vblank\n"); - goto error; + goto error_dev; } /* DRM/KMS objects */ ret = rcar_du_modeset_init(rcdu); if (ret < 0) { + /* modeset_init could have failed partway through and doesn't +* do its own cleanup, so needs to be completely undone. +*/ dev_err(&pdev->dev, "failed to initialize DRM/KMS (%d)\n", ret); - goto error; + goto error_modeset; } ddev->irq_enabled = 1; @@ -359,7 +362,7 @@ static int rcar_du_probe(struct platform_device *pdev) */ ret = drm_dev_register(ddev, 0); if (ret) - goto error; + goto error_modeset; mutex_lock(&ddev->mode_config.mutex); drm_for_each_connector(connector, ddev) { @@ -369,15 +372,30 @@ static int rcar_du_probe(struct platform_device *pdev) } mutex_unlock(&ddev->mode_config.mutex); + /* One or more connects could have been registered, so unregister all +* connectors. +*/ if (ret < 0) - goto error; + goto error_connector; DRM_INFO("Device %s probed\n", dev_name(&pdev->dev)); return 0; -error: - rcar_du_remove(pdev); +error_connector: + drm_connector_unregister_all(ddev); + drm_dev_unregister(ddev); + +error_modeset: + if (rcdu->fbdev) + drm_fbdev_cma_fini(rcdu->fbdev); + + drm_kms_helper_poll_fini(ddev); + drm_mode_config_cleanup(ddev); + drm_vblank_cleanup(ddev); + +error_dev: + drm_dev_unref(ddev); return ret; } -- 2.8.0.rc3
[Intel-gfx] [PATCH 5/6] drm,i915: Introduce drm_malloc_gfp()
On Wed, Apr 06, 2016 at 10:40:19AM +0100, Tvrtko Ursulin wrote: > > On 05/04/16 14:05, Chris Wilson wrote: > >On Tue, Apr 05, 2016 at 01:57:36PM +0100, Chris Wilson wrote: > >>I have instances where I want to use drm_malloc_ab() but with a custom > >>gfp mask. And with those, where I want a temporary allocation, I want to > >>try a high-order kmalloc() before using a vmalloc(). > >> > >>So refactor my usage into drm_malloc_gfp(). > >> > >>Signed-off-by: Chris Wilson > >>Cc: dri-devel at lists.freedesktop.org > >>Cc: Ville Syrjälä > >>Reviewed-by: Ville Syrjälä > >>Acked-by: Dave Airlie > > > >>+static __inline__ void *drm_malloc_gfp(size_t nmemb, size_t size, gfp_t > >>gfp) > >>+{ > >>+ if (size != 0 && nmemb > SIZE_MAX / size) > >>+ return NULL; > > > >I know Dave G. has some fancy code to detect when the size parameter is > >not constant, but one thing I noticed was that gcc would uninline this > >function and we would lose the constant folding. Is there anything we > >can do to convince gcc to avoid a div here (other than pure macro)? > > Don't know, apart from maybe _always_inline if it is not considered too big. > > But I wanted to ask, why it is interesting to allow size == 0 ? Why not: > > if (size == 0 || nmemb > SIZE_MAX / size) > return NULL; > > ? Cargo-culting. I guess the only thought was to avoid the div-by-zero and to fallthrough to returning kmalloc(0) for equivalent behaviour. -Chris -- Chris Wilson, Intel Open Source Technology Centre
[PATCH 1/2] drm/rockchip: vop: Do check if an update is pending during disable
When a plane is being disabled but it's still enabled, do check if the previous update has been completed by reading yrgb_mst back. Otherwise, pending pageflips would remain pending after a CRTC is disabled. Signed-off-by: Tomeu Vizoso --- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index a9b1e8b5ac85..f46b1fd1887b 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -1064,8 +1064,9 @@ static bool vop_win_pending_is_complete(struct vop_win *vop_win) struct vop_plane_state *state = to_vop_plane_state(plane->state); dma_addr_t yrgb_mst; - if (!state->enable) - return VOP_WIN_GET(vop_win->vop, vop_win->data, enable) == 0; + if (!state->enable && + VOP_WIN_GET(vop_win->vop, vop_win->data, enable) == 0) + return true; yrgb_mst = VOP_WIN_GET_YRGBADDR(vop_win->vop, vop_win->data); -- 2.5.5
[PATCH 2/2] drm/rockchip: vop: Wait for pending events when disabling a CRTC
When a VOP is disabled, it will stop raising interrupts. If we had a pending pageflip when the VOP is disabled, userspace won't get that event until the corresponding CRTC is enabled again. So let's wait for any pending events that may be right before disabling a CRTC. Signed-off-by: Tomeu Vizoso --- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index f46b1fd1887b..6dc87fa96f29 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -142,6 +142,8 @@ struct vop { struct vop_win win[]; }; +static void vop_crtc_wait_for_update(struct drm_crtc *crtc); + static inline void vop_writel(struct vop *vop, uint32_t offset, uint32_t v) { writel(v, vop->regs + offset); @@ -504,6 +506,9 @@ static void vop_crtc_disable(struct drm_crtc *crtc) if (!vop->is_enabled) return; + if (crtc->state->event || vop->event) + vop_crtc_wait_for_update(crtc); + /* * We need to make sure that all windows are disabled before we * disable that crtc. Otherwise we might try to scan from a destroyed -- 2.5.5
[Bug 94835] Increase fragment shader sample limits from 16 to 32 (AMD Linux - Mesa/RadeonSi)
https://bugs.freedesktop.org/show_bug.cgi?id=94835 --- Comment #2 from Ilia Mirkin --- (In reply to Edwin Smith from comment #0) > Feral can provide a Steam key to active Mesa engineers working on this issue > if that would help their progress. A little bit off-topic, but would such a key be provided for people working on drivers other than radeonsi? [r600 and nvc0 come to mind] > YOU should be abel to use Intel Mesa as a > reference as that draws correctly as it has a higher texture sampler limit. By the way, that's only true for Haswell and newer. Ivybridge (gen7) is limited to 16, at least on Mesa. -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160406/79cfab86/attachment.html>
[Bug 93767] Glitches with soft shadows and MSAA in Knights of the Old Republic 2
https://bugs.freedesktop.org/show_bug.cgi?id=93767 --- Comment #8 from Nicolai H�hnle --- This makes sense. Mesa 11.1 does not contain the stencil fast clear changes. I'm going to try to get some clarification on what's going wrong here. -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160406/d5fe9871/attachment.html>
[PATCH] mdfld_dsi: remove bogus if check
From: Alan Both cases produce the same result. Kill the junk code. Signed-off-by: Alan Cox --- drivers/gpu/drm/gma500/mdfld_dsi_dpi.c |6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/gpu/drm/gma500/mdfld_dsi_dpi.c b/drivers/gpu/drm/gma500/mdfld_dsi_dpi.c index 7cd87a0..a05c0206 100644 --- a/drivers/gpu/drm/gma500/mdfld_dsi_dpi.c +++ b/drivers/gpu/drm/gma500/mdfld_dsi_dpi.c @@ -979,11 +979,7 @@ struct mdfld_dsi_encoder *mdfld_dsi_dpi_init(struct drm_device *dev, return NULL; } - if (dsi_connector->pipe) - dpi_output->panel_on = 0; - else - dpi_output->panel_on = 0; - + dpi_output->panel_on = 0; dpi_output->dev = dev; if (mdfld_get_panel_type(dev, pipe) != TC35876X) dpi_output->p_funcs = p_funcs;
[PATCH 1/7] drm/ttm: don't wait for BO on initial allocation
I don't know much about AMD gpu. Patches 1-6 look good to me. On Wed, Apr 06, 2016 at 11:12:02AM +0200, Christian König wrote: > From: Christian König > > When we use an extern reservation object that otherwise waits for every > fence registered with it. > > Signed-off-by: Christian König > Reviewed-by: Alex Deucher > --- > drivers/gpu/drm/ttm/ttm_bo.c | 18 -- > 1 file changed, 12 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c > index 4cbf265..367b87b 100644 > --- a/drivers/gpu/drm/ttm/ttm_bo.c > +++ b/drivers/gpu/drm/ttm/ttm_bo.c > @@ -998,13 +998,19 @@ static int ttm_bo_move_buffer(struct ttm_buffer_object > *bo, > lockdep_assert_held(&bo->resv->lock.base); > > /* > - * FIXME: It's possible to pipeline buffer moves. > - * Have the driver move function wait for idle when necessary, > - * instead of doing it here. > + * Don't wait for the BO on initial allocation. This is important when > + * the BO has an imported reservation object. >*/ > - ret = ttm_bo_wait(bo, false, interruptible, no_wait_gpu); > - if (ret) > - return ret; > + if (bo->mem.mem_type != TTM_PL_SYSTEM || bo->ttm != NULL) { > + /* > + * FIXME: It's possible to pipeline buffer moves. > + * Have the driver move function wait for idle when necessary, > + * instead of doing it here. > + */ > + ret = ttm_bo_wait(bo, false, interruptible, no_wait_gpu); > + if (ret) > + return ret; > + } > mem.num_pages = bo->num_pages; > mem.size = mem.num_pages << PAGE_SHIFT; > mem.page_alignment = bo->mem.page_alignment; > -- > 2.5.0 > > ___ > dri-devel mailing list > dri-devel at lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 1/3] drm: Make drm.h uapi header safe for C++
On Wed, 30 Mar 2016 16:19:42 +0200 Daniel Vetter wrote: > virtual is a protected keyword in C++ and can't be used at all. Ugh. > > This aligns the kernel versions of the drm headers with the ones in > libdrm. > > Cc: Emil Velikov > Signed-off-by: Daniel Vetter > --- > include/uapi/drm/drm.h | 4 > 1 file changed, 4 insertions(+) > > diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h > index a0ebfe7c9a28..d299c7749091 100644 > --- a/include/uapi/drm/drm.h > +++ b/include/uapi/drm/drm.h > @@ -373,7 +373,11 @@ struct drm_buf_pub { > */ > struct drm_buf_map { > int count; /**< Length of the buffer list */ > +#ifdef __cplusplus > + void *virt; > +#else > void __user *virtual; /**< Mmap'd area in > user-virtual */ +#endif > struct drm_buf_pub __user *list;/**< Buffer > information */ }; > Why not simply rename the field ? -- Gabriel Laskar
[pull] radeon and amdgpu drm-fixes-4.6
Hi Dave, Lots of misc bug fixes for radeon and amdgpu and one for ttm. - fix vram info fetching on Fiji and unposted boards - additional vblank fixes from the conversion to drm_vblank_on/off - UVD dGPU suspend and resume fixes - lots of powerplay fixes - fix a fence leak in the pageflip code - ttm fix for platforms where CPU is 32 bit, but physical addresses are >32bits The following changes since commit 72b9ff0612ad8fc969b910cd00ac16b57a1a9ba4: drm/udl: Use unlocked gem unreferencing (2016-04-01 13:22:33 +1000) are available in the git repository at: git://people.freedesktop.org/~agd5f/linux drm-fixes-4.6 for you to fetch changes up to 7c0ecda15b01bc88d762d9263d2cf0f69ffd4c23: drm/amdgpu: total vram size also reduces pin size (2016-04-05 15:23:31 -0400) Alex Deucher (4): drm/amdgpu/gmc: move vram type fetching into sw_init drm/amdgpu/gmc: use proper register for vram type on Fiji drm/amdgpu: print vram type rather than just DDR drm/ttm: use phys_addr_t for ttm_bus_placement Christian König (1): drm/amdgpu: fix leaking fence in the pageflip code Chunming Zhou (2): drm/amdgpu: fence wait old rcu slot drm/amdgpu: total vram size also reduces pin size Leo Liu (2): drm/amdgpu: save and restore UVD context with suspend and resume drm/amdgpu: save and restore the firwmware cache part when suspend resume Michel Dänzer (3): drm/radeon: Set vblank_disable_allowed = true drm/amdgpu: Set vblank_disable_allowed = true drm/radeon: Only call drm_vblank_on/off between drm_vblank_init/cleanup Rex Zhu (9): drm/amd/powerplay: fix segment fault issue in multi-display case. drm/amdgpu: add an cgs interface to notify amdgpu the dpm state. drm/amdgpu: Not support disable dpm in powerplay. drm/amd/powerplay: notify amdgpu whether dpm is enabled or not. drm/amdgpu: check dpm state before pm system fs initialized. drm/amd/powerplay: add new Fiji function for not setting same ps. drm/amd/powerplay: Need to change boot to performance state in resume. drm/amd/powerplay: fix issue that resume back, dpm can't work on FIJI. drm/amd/powerplay: add uvd/vce dpm enabling flag default. drivers/gpu/drm/amd/amdgpu/amdgpu.h| 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c| 24 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c| 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 8 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c| 2 + drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c| 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 15 - drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c | 10 +--- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c| 58 +- drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 16 ++--- drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 23 +--- drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c | 4 +- drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c | 4 +- drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 7 ++- drivers/gpu/drm/amd/include/cgs_common.h | 8 +++ .../drm/amd/powerplay/eventmgr/eventactionchains.c | 4 +- drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.c | 69 ++ .../gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c | 16 - drivers/gpu/drm/radeon/atombios_crtc.c | 6 +- drivers/gpu/drm/radeon/radeon_irq_kms.c| 2 + drivers/gpu/drm/radeon/radeon_legacy_crtc.c| 6 +- include/drm/ttm/ttm_bo_api.h | 2 +- 22 files changed, 210 insertions(+), 78 deletions(-)
[PATCH 1/3] drm: Make drm.h uapi header safe for C++
On 6 April 2016 at 16:58, Gabriel Laskar wrote: > On Wed, 30 Mar 2016 16:19:42 +0200 > Daniel Vetter wrote: > >> virtual is a protected keyword in C++ and can't be used at all. Ugh. >> >> This aligns the kernel versions of the drm headers with the ones in >> libdrm. >> >> Cc: Emil Velikov >> Signed-off-by: Daniel Vetter >> --- >> include/uapi/drm/drm.h | 4 >> 1 file changed, 4 insertions(+) >> >> diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h >> index a0ebfe7c9a28..d299c7749091 100644 >> --- a/include/uapi/drm/drm.h >> +++ b/include/uapi/drm/drm.h >> @@ -373,7 +373,11 @@ struct drm_buf_pub { >> */ >> struct drm_buf_map { >> int count; /**< Length of the buffer list */ >> +#ifdef __cplusplus >> + void *virt; >> +#else >> void __user *virtual; /**< Mmap'd area in >> user-virtual */ +#endif >> struct drm_buf_pub __user *list;/**< Buffer >> information */ }; >> > > Why not simply rename the field ? > It will break existing users. Some of which haven't been updated/maintained in a long while. -Emil
[PATCH libdrm 5/7] include: Fix spelling mistakes
Hi Eric, On 3 April 2016 at 19:48, Eric Engestrom wrote: > Signed-off-by: Eric Engestrom > --- > include/drm/drm_mode.h | 2 +- > include/drm/i915_drm.h | 2 +- > include/drm/mga_drm.h| 2 +- > include/drm/savage_drm.h | 2 +- > include/drm/vmwgfx_drm.h | 2 +- > 5 files changed, 5 insertions(+), 5 deletions(-) > Can you please re-spin this patch against the kernel UAPI headers ? These files are meant to be imported from there, so things will end up badly next time we do. Thanks Emil
[PATCH libdrm 3/7] freedreno: Fix spelling mistakes
Hi Eric, On 3 April 2016 at 19:48, Eric Engestrom wrote: > Signed-off-by: Eric Engestrom > --- > freedreno/kgsl/kgsl_drm.h | 2 +- > freedreno/kgsl/msm_kgsl.h | 4 ++-- Not 100% sure how Rob deals with these. Although I'm suspecting that they come from a kernel (similar to the ones in PATCH 5/7). Rob, is any of the above true - are they from a upstream/downstream kernel somewhere ? If so should we update them here, or in the 'master' project ? Thanks Emil
[PATCH libdrm 3/7] freedreno: Fix spelling mistakes
On 6 April 2016 at 17:42, Emil Velikov wrote: > Hi Eric, > > On 3 April 2016 at 19:48, Eric Engestrom wrote: >> Signed-off-by: Eric Engestrom >> --- >> freedreno/kgsl/kgsl_drm.h | 2 +- >> freedreno/kgsl/msm_kgsl.h | 4 ++-- > > Not 100% sure how Rob deals with these. Although I'm suspecting that > they come from a kernel (similar to the ones in PATCH 5/7). > > Rob, is any of the above true - are they from a upstream/downstream > kernel somewhere ? If so should we update them here, or in the > 'master' project ? > Completely forgot: I'll pull the lot (without 5/7 and optionally this one) as we hear from Rob. Thank for the patches Eric. Some of these are a bit hard to spot ;-) -Emil
[Bug 94835] Increase fragment shader sample limits from 16 to 32 (AMD Linux - Mesa/RadeonSi)
https://bugs.freedesktop.org/show_bug.cgi?id=94835 --- Comment #3 from Nicolai H�hnle --- I have a preliminary patch set for this, but I still need to put it through its testing paces. -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160406/651ab48b/attachment.html>
[Bug 89420] DELL U2415 monitor detection issue
https://bugs.freedesktop.org/show_bug.cgi?id=89420 Benjamin Bellec changed: What|Removed |Added CC||b.bellec at gmail.com --- Comment #5 from Benjamin Bellec --- I have the same powersave issue with a Dell U2414H (1920*1080). It's a simple monitor setup (only one screen plugged to the videocard). On a Radeon HD5850 or a GeForce GTX 950 (both with free drivers), my motherboard POST is displayed, but when Fedora begins to load the screen goes to powersave. I have to unplug and plug again the DisplayPort cable on the videocard to get the screen back. Note that if I remember well, sometimes it works perfectly. The problem also occurs when I reboot the computer from Fedora, then the screen stays in powersave mode, I don't even see the motherboard POST. The screen is plugged with a DisplayPort (to videocard) <--> MiniDisplayPort (to the screen). This is cable which comes with the screen. The screen is configured in DP1.1a mode. I can switch to DP1.2 with the OSD screen menu, in that case the Radeon seems to handle it (though the powersave issue remains) but the GeForce card get not more screen at all. I just got a second screen from Dell RMA, and the problem remains. My config: Fedora 23 (x86-64) kernel 4.4.6-300.fc23.x86_64 libdrm 2.4.66-1.fc23 Please please fix it, this is a really boring issue :( -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160406/91c1cd86/attachment.html>
[PATCH 2/2] drm/radeon: use helper for mst connector dpms.
On Tue, Apr 5, 2016 at 7:24 PM, Dave Airlie wrote: > From: Dave Airlie > > I noticed my monitor didn't power off when it should, > this should fix it. > > Signed-off-by: Dave Airlie Applied the series. Thanks! Alex > --- > drivers/gpu/drm/radeon/radeon_dp_mst.c | 8 +--- > 1 file changed, 1 insertion(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/radeon/radeon_dp_mst.c > b/drivers/gpu/drm/radeon/radeon_dp_mst.c > index b3b2d05..de504ea 100644 > --- a/drivers/gpu/drm/radeon/radeon_dp_mst.c > +++ b/drivers/gpu/drm/radeon/radeon_dp_mst.c > @@ -257,14 +257,8 @@ radeon_dp_mst_connector_destroy(struct drm_connector > *connector) > kfree(radeon_connector); > } > > -static int radeon_connector_dpms(struct drm_connector *connector, int mode) > -{ > - DRM_DEBUG_KMS("\n"); > - return 0; > -} > - > static const struct drm_connector_funcs radeon_dp_mst_connector_funcs = { > - .dpms = radeon_connector_dpms, > + .dpms = drm_helper_connector_dpms, > .detect = radeon_dp_mst_detect, > .fill_modes = drm_helper_probe_single_connector_modes, > .destroy = radeon_dp_mst_connector_destroy, > -- > 2.5.0 > > ___ > dri-devel mailing list > dri-devel at lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH] drm/tilcdc: Recover from sync lost error flood by resetting the LCDC
Recover from sync lost error flood by resetting the LCDC in stead of turning off the SYNC_LOST error IRQ. When LCDC starves on limited memory bandwidth it may sometimes result an error situation when the picture may have shifted couple of pixels to right and SYNC_LOST interrupt is generated on every frame. LCDC main reset recovers from this situation and causes a brief blanking on the screen. Signed-off-by: Jyri Sarha --- drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 34 +++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c index 051e5e1..5aa86e9 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c @@ -46,6 +46,8 @@ struct tilcdc_crtc { int sync_lost_count; bool frame_intact; + struct workqueue_struct *wq; + struct work_struct recover_work; }; #define to_tilcdc_crtc(x) container_of(x, struct tilcdc_crtc, base) @@ -60,6 +62,25 @@ static void unref_worker(struct drm_flip_work *work, void *val) mutex_unlock(&dev->mode_config.mutex); } +static void stop(struct drm_crtc *crtc); +static void start(struct drm_crtc *crtc); +static void tilcdc_crtc_recover_work(struct work_struct *work) +{ + struct tilcdc_crtc *tilcdc_crtc = + container_of(work, struct tilcdc_crtc, recover_work); + struct drm_crtc *crtc = &tilcdc_crtc->base; + + dev_info(crtc->dev->dev, "%s: Reset CRTC", __func__); + + if (tilcdc_crtc->dpms == DRM_MODE_DPMS_OFF) + return; + + drm_modeset_lock_crtc(crtc, NULL); + stop(crtc); + start(crtc); + drm_modeset_unlock_crtc(crtc); +} + static void set_scanout(struct drm_crtc *crtc, struct drm_framebuffer *fb) { struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); @@ -125,6 +146,7 @@ static void tilcdc_crtc_destroy(struct drm_crtc *crtc) tilcdc_crtc_dpms(crtc, DRM_MODE_DPMS_OFF); of_node_put(crtc->port); + destroy_workqueue(tilcdc_crtc->wq); drm_crtc_cleanup(crtc); drm_flip_work_cleanup(&tilcdc_crtc->unref_work); } @@ -732,10 +754,10 @@ irqreturn_t tilcdc_crtc_irq(struct drm_crtc *crtc) tilcdc_crtc->frame_intact = false; if (tilcdc_crtc->sync_lost_count++ > SYNC_LOST_COUNT_LIMIT) { dev_err(dev->dev, - "%s(0x%08x): Sync lost flood detected, disabling the interrupt", + "%s(0x%08x): Sync lost flood detected, recovering", __func__, stat); - tilcdc_write(dev, LCDC_INT_ENABLE_CLR_REG, -LCDC_SYNC_LOST); + queue_work(tilcdc_crtc->wq, &tilcdc_crtc->recover_work); + tilcdc_crtc->sync_lost_count = 0; } } @@ -768,6 +790,12 @@ struct drm_crtc *tilcdc_crtc_create(struct drm_device *dev) "unref", unref_worker); spin_lock_init(&tilcdc_crtc->irq_lock); + tilcdc_crtc->wq = create_singlethread_workqueue("tilcdc/crtc"); + if (!tilcdc_crtc->wq) { + kfree(tilcdc_crtc); + return NULL; + } + INIT_WORK(&tilcdc_crtc->recover_work, tilcdc_crtc_recover_work); ret = drm_crtc_init(dev, crtc, &tilcdc_crtc_funcs); if (ret < 0) -- 1.9.1
drm: bridge: analogix/dp: Fix the possible dead lock in bridge disable time
Hello Yakir Yang, The patch 7b4b7a8db439: "drm: bridge: analogix/dp: Fix the possible dead lock in bridge disable time" from Feb 15, 2016, leads to the following static checker warning: drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:875 analogix_dp_irq_thread() warn: bitwise AND condition is false here drivers/gpu/drm/bridge/analogix/analogix_dp_core.c 869 static irqreturn_t analogix_dp_irq_thread(int irq, void *arg) 870 { 871 struct analogix_dp_device *dp = arg; 872 enum dp_irq_type irq_type; 873 874 irq_type = analogix_dp_get_irq_type(dp); 875 if (irq_type & DP_IRQ_TYPE_HP_CABLE_IN || ^^ This is never true. Maybe test_bit() for these? 876 irq_type & DP_IRQ_TYPE_HP_CABLE_OUT) { 877 dev_dbg(dp->dev, "Detected cable status changed!\n"); 878 if (dp->drm_dev) 879 drm_helper_hpd_irq_event(dp->drm_dev); 880 } 881 882 if (irq_type != DP_IRQ_TYPE_UNKNOWN) { 883 analogix_dp_clear_hotplug_interrupts(dp); 884 analogix_dp_unmute_hpd_interrupt(dp); 885 } 886 887 return IRQ_HANDLED; 888 } regards, dan carpenter
[PATCH 1/2] drm/radeon: add support for loading new UVD fw
From: Arindam Nath Signed-off-by: Christian König Signed-off-by: Arindam Nath Reviewed-by: Leo Liu --- drivers/gpu/drm/radeon/radeon.h | 1 + drivers/gpu/drm/radeon/radeon_uvd.c | 55 +++-- drivers/gpu/drm/radeon/uvd_v4_2.c | 8 +- 3 files changed, 49 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index 78a51b3..34694ad 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h @@ -1674,6 +1674,7 @@ int radeon_pm_get_type_index(struct radeon_device *rdev, #define RADEON_UVD_HEAP_SIZE (1024*1024) struct radeon_uvd { + boolfw_header_present; struct radeon_bo*vcpu_bo; void*cpu_addr; uint64_tgpu_addr; diff --git a/drivers/gpu/drm/radeon/radeon_uvd.c b/drivers/gpu/drm/radeon/radeon_uvd.c index 6edcb54..0897c66 100644 --- a/drivers/gpu/drm/radeon/radeon_uvd.c +++ b/drivers/gpu/drm/radeon/radeon_uvd.c @@ -34,6 +34,7 @@ #include #include "radeon.h" +#include "radeon_ucode.h" #include "r600d.h" /* 1 second timeout */ @@ -47,7 +48,8 @@ #define FIRMWARE_CYPRESS "radeon/CYPRESS_uvd.bin" #define FIRMWARE_SUMO "radeon/SUMO_uvd.bin" #define FIRMWARE_TAHITI"radeon/TAHITI_uvd.bin" -#define FIRMWARE_BONAIRE "radeon/BONAIRE_uvd.bin" +#define FIRMWARE_BONAIRE_LEGACY"radeon/BONAIRE_uvd.bin" +#define FIRMWARE_BONAIRE "radeon/bonaire_uvd.bin" MODULE_FIRMWARE(FIRMWARE_R600); MODULE_FIRMWARE(FIRMWARE_RS780); @@ -56,6 +58,7 @@ MODULE_FIRMWARE(FIRMWARE_RV710); MODULE_FIRMWARE(FIRMWARE_CYPRESS); MODULE_FIRMWARE(FIRMWARE_SUMO); MODULE_FIRMWARE(FIRMWARE_TAHITI); +MODULE_FIRMWARE(FIRMWARE_BONAIRE_LEGACY); MODULE_FIRMWARE(FIRMWARE_BONAIRE); static void radeon_uvd_idle_work_handler(struct work_struct *work); @@ -63,7 +66,7 @@ static void radeon_uvd_idle_work_handler(struct work_struct *work); int radeon_uvd_init(struct radeon_device *rdev) { unsigned long bo_size; - const char *fw_name; + const char *fw_name = NULL, *legacy_fw_name = NULL; int i, r; INIT_DELAYED_WORK(&rdev->uvd.idle_work, radeon_uvd_idle_work_handler); @@ -74,22 +77,22 @@ int radeon_uvd_init(struct radeon_device *rdev) case CHIP_RV670: case CHIP_RV620: case CHIP_RV635: - fw_name = FIRMWARE_R600; + legacy_fw_name = FIRMWARE_R600; break; case CHIP_RS780: case CHIP_RS880: - fw_name = FIRMWARE_RS780; + legacy_fw_name = FIRMWARE_RS780; break; case CHIP_RV770: - fw_name = FIRMWARE_RV770; + legacy_fw_name = FIRMWARE_RV770; break; case CHIP_RV710: case CHIP_RV730: case CHIP_RV740: - fw_name = FIRMWARE_RV710; + legacy_fw_name = FIRMWARE_RV710; break; case CHIP_CYPRESS: @@ -97,7 +100,7 @@ int radeon_uvd_init(struct radeon_device *rdev) case CHIP_JUNIPER: case CHIP_REDWOOD: case CHIP_CEDAR: - fw_name = FIRMWARE_CYPRESS; + legacy_fw_name = FIRMWARE_CYPRESS; break; case CHIP_SUMO: @@ -107,7 +110,7 @@ int radeon_uvd_init(struct radeon_device *rdev) case CHIP_BARTS: case CHIP_TURKS: case CHIP_CAICOS: - fw_name = FIRMWARE_SUMO; + legacy_fw_name = FIRMWARE_SUMO; break; case CHIP_TAHITI: @@ -115,7 +118,7 @@ int radeon_uvd_init(struct radeon_device *rdev) case CHIP_PITCAIRN: case CHIP_ARUBA: case CHIP_OLAND: - fw_name = FIRMWARE_TAHITI; + legacy_fw_name = FIRMWARE_TAHITI; break; case CHIP_BONAIRE: @@ -123,6 +126,7 @@ int radeon_uvd_init(struct radeon_device *rdev) case CHIP_KAVERI: case CHIP_HAWAII: case CHIP_MULLINS: + legacy_fw_name = FIRMWARE_BONAIRE_LEGACY; fw_name = FIRMWARE_BONAIRE; break; @@ -130,11 +134,34 @@ int radeon_uvd_init(struct radeon_device *rdev) return -EINVAL; } - r = request_firmware(&rdev->uvd_fw, fw_name, rdev->dev); - if (r) { - dev_err(rdev->dev, "radeon_uvd: Can't load firmware \"%s\"\n", - fw_name); - return r; + rdev->uvd.fw_header_present = false; + if (fw_name) { + /* Let's try to load the newer firmware first */ + r = request_firmware(&rdev->uvd_fw, fw_name, rdev->dev); + if (r) { + dev_err(rdev->dev, "radeon_uvd: Can't load firmware \"%s\"\n", + fw_name); + } else { + r = radeon_ucode_validate(rdev->uvd_fw); + if (r) +
Applied "ALSA: pcm: add IEC958 channel status helper for hw_params" to the asoc tree
The patch ALSA: pcm: add IEC958 channel status helper for hw_params has been applied to the asoc tree at git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From 4a4436573a6669516f73bac25016683d396ed4c4 Mon Sep 17 00:00:00 2001 From: Jyri Sarha Date: Thu, 31 Mar 2016 16:35:58 +0300 Subject: [PATCH] ALSA: pcm: add IEC958 channel status helper for hw_params Add IEC958 channel status helper that gets the audio properties from snd_pcm_hw_params instead of snd_pcm_runtime. This is needed to produce the channel status bits already in audio stream configuration phase. Signed-off-by: Jyri Sarha Reviewed-by: Takashi Iwai Signed-off-by: Mark Brown --- include/sound/pcm_iec958.h | 2 ++ sound/core/pcm_iec958.c| 64 ++ 2 files changed, 49 insertions(+), 17 deletions(-) diff --git a/include/sound/pcm_iec958.h b/include/sound/pcm_iec958.h index 0eed397aca8e..36f023acb201 100644 --- a/include/sound/pcm_iec958.h +++ b/include/sound/pcm_iec958.h @@ -6,4 +6,6 @@ int snd_pcm_create_iec958_consumer(struct snd_pcm_runtime *runtime, u8 *cs, size_t len); +int snd_pcm_create_iec958_consumer_hw_params(struct snd_pcm_hw_params *params, +u8 *cs, size_t len); #endif diff --git a/sound/core/pcm_iec958.c b/sound/core/pcm_iec958.c index 36b2d7aca1bd..e016871a978f 100644 --- a/sound/core/pcm_iec958.c +++ b/sound/core/pcm_iec958.c @@ -9,30 +9,18 @@ #include #include #include +#include #include -/** - * snd_pcm_create_iec958_consumer - create consumer format IEC958 channel status - * @runtime: pcm runtime structure with ->rate filled in - * @cs: channel status buffer, at least four bytes - * @len: length of channel status buffer - * - * Create the consumer format channel status data in @cs of maximum size - * @len corresponding to the parameters of the PCM runtime @runtime. - * - * Drivers may wish to tweak the contents of the buffer after creation. - * - * Returns: length of buffer, or negative error code if something failed. - */ -int snd_pcm_create_iec958_consumer(struct snd_pcm_runtime *runtime, u8 *cs, - size_t len) +static int create_iec958_consumer(uint rate, uint sample_width, + u8 *cs, size_t len) { unsigned int fs, ws; if (len < 4) return -EINVAL; - switch (runtime->rate) { + switch (rate) { case 32000: fs = IEC958_AES3_CON_FS_32000; break; @@ -59,7 +47,7 @@ int snd_pcm_create_iec958_consumer(struct snd_pcm_runtime *runtime, u8 *cs, } if (len > 4) { - switch (snd_pcm_format_width(runtime->format)) { + switch (sample_width) { case 16: ws = IEC958_AES4_CON_WORDLEN_20_16; break; @@ -92,4 +80,46 @@ int snd_pcm_create_iec958_consumer(struct snd_pcm_runtime *runtime, u8 *cs, return len; } + +/** + * snd_pcm_create_iec958_consumer - create consumer format IEC958 channel status + * @runtime: pcm runtime structure with ->rate filled in + * @cs: channel status buffer, at least four bytes + * @len: length of channel status buffer + * + * Create the consumer format channel status data in @cs of maximum size + * @len corresponding to the parameters of the PCM runtime @runtime. + * + * Drivers may wish to tweak the contents of the buffer after creation. + * + * Returns: length of buffer, or negative error code if something failed. + */ +int snd_pcm_create_iec958_consumer(struct snd_pcm_runtime *runtime, u8 *cs, + size_t len) +{ + return create_iec958_consumer(runtime->rate, + snd_pcm_format_width(runtime->format), + cs, len); +} EXPORT_SYMBOL(snd_pcm_create_iec958_consumer); + +/** + * snd_pcm_create_iec958_consumer_hw_params - create IEC958 channel status + * @hw_params: the hw_params instance for extracting rate and sample format + * @cs: channel status buffer, at least four bytes + * @len: length of channel status buffer + * + * Create the consumer format channel status data in @cs of maximum size + * @len corresponding
Applied "ALSA: pcm: Allow 32 bit sample format in IEC958 channel status helper" to the asoc tree
The patch ALSA: pcm: Allow 32 bit sample format in IEC958 channel status helper has been applied to the asoc tree at git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From 4a462ce084d5beb92cfc68f53f88c035c82e6b59 Mon Sep 17 00:00:00 2001 From: Jyri Sarha Date: Thu, 31 Mar 2016 16:35:59 +0300 Subject: [PATCH] ALSA: pcm: Allow 32 bit sample format in IEC958 channel status helper Treat 32 bit sample width as if it was 24 bits when generating IEC958 channel status bits. On some platforms 24 sample width is problematic and to get full 24 bit precision a 32 bit format, using only the 24 most significant bits, may have to be used. Signed-off-by: Jyri Sarha Reviewed-by: Takashi Iwai Signed-off-by: Mark Brown --- sound/core/pcm_iec958.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/core/pcm_iec958.c b/sound/core/pcm_iec958.c index e016871a978f..5e6aed64f451 100644 --- a/sound/core/pcm_iec958.c +++ b/sound/core/pcm_iec958.c @@ -59,6 +59,7 @@ static int create_iec958_consumer(uint rate, uint sample_width, IEC958_AES4_CON_MAX_WORDLEN_24; break; case 24: + case 32: /* Assume 24-bit width for 32-bit samples. */ ws = IEC958_AES4_CON_WORDLEN_24_20 | IEC958_AES4_CON_MAX_WORDLEN_24; break; -- 2.8.0.rc3
[PATCH 2/2] drm/radeon: handle more than 10 UVD sessions
From: Arindam Nath Signed-off-by: Christian König Signed-off-by: Arindam Nath Reviewed-by: Leo Liu --- drivers/gpu/drm/radeon/cikd.h | 1 + drivers/gpu/drm/radeon/radeon.h | 9 ++--- drivers/gpu/drm/radeon/radeon_uvd.c | 33 + drivers/gpu/drm/radeon/uvd_v1_0.c | 5 +++-- drivers/gpu/drm/radeon/uvd_v2_2.c | 5 +++-- drivers/gpu/drm/radeon/uvd_v4_2.c | 8 ++-- 6 files changed, 44 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/radeon/cikd.h b/drivers/gpu/drm/radeon/cikd.h index 391ff9d..cead228 100644 --- a/drivers/gpu/drm/radeon/cikd.h +++ b/drivers/gpu/drm/radeon/cikd.h @@ -2071,6 +2071,7 @@ #define UVD_UDEC_DBW_ADDR_CONFIG 0xef54 #define UVD_LMI_EXT40_ADDR 0xf498 +#define UVD_GP_SCRATCH40xf4e0 #define UVD_LMI_ADDR_EXT 0xf594 #define UVD_VCPU_CACHE_OFFSET0 0xf608 #define UVD_VCPU_CACHE_SIZE0 0xf60c diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index 34694ad..827e623 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h @@ -1669,15 +1669,18 @@ int radeon_pm_get_type_index(struct radeon_device *rdev, /* * UVD */ -#define RADEON_MAX_UVD_HANDLES 10 -#define RADEON_UVD_STACK_SIZE (1024*1024) -#define RADEON_UVD_HEAP_SIZE (1024*1024) +#define RADEON_DEFAULT_UVD_HANDLES 10 +#define RADEON_MAX_UVD_HANDLES 30 +#define RADEON_UVD_STACK_SIZE (200*1024) +#define RADEON_UVD_HEAP_SIZE (256*1024) +#define RADEON_UVD_SESSION_SIZE(50*1024) struct radeon_uvd { boolfw_header_present; struct radeon_bo*vcpu_bo; void*cpu_addr; uint64_tgpu_addr; + unsignedmax_handles; atomic_thandles[RADEON_MAX_UVD_HANDLES]; struct drm_file *filp[RADEON_MAX_UVD_HANDLES]; unsignedimg_size[RADEON_MAX_UVD_HANDLES]; diff --git a/drivers/gpu/drm/radeon/radeon_uvd.c b/drivers/gpu/drm/radeon/radeon_uvd.c index 0897c66..f8de6d0 100644 --- a/drivers/gpu/drm/radeon/radeon_uvd.c +++ b/drivers/gpu/drm/radeon/radeon_uvd.c @@ -135,6 +135,7 @@ int radeon_uvd_init(struct radeon_device *rdev) } rdev->uvd.fw_header_present = false; + rdev->uvd.max_handles = RADEON_DEFAULT_UVD_HANDLES; if (fw_name) { /* Let's try to load the newer firmware first */ r = request_firmware(&rdev->uvd_fw, fw_name, rdev->dev); @@ -142,11 +143,27 @@ int radeon_uvd_init(struct radeon_device *rdev) dev_err(rdev->dev, "radeon_uvd: Can't load firmware \"%s\"\n", fw_name); } else { + struct common_firmware_header *hdr = (void *)rdev->uvd_fw->data; + unsigned version_major, version_minor, family_id; + r = radeon_ucode_validate(rdev->uvd_fw); if (r) return r; rdev->uvd.fw_header_present = true; + + family_id = le32_to_cpu(hdr->ucode_version) & 0xff; + version_major = (le32_to_cpu(hdr->ucode_version) >> 24) & 0xff; + version_minor = (le32_to_cpu(hdr->ucode_version) >> 8) & 0xff; + DRM_INFO("Found UVD firmware Version: %hu.%hu Family ID: %hu\n", +version_major, version_minor, family_id); + + /* +* Limit the number of UVD handles depending on +* microcode major and minor versions. +*/ + if ((version_major >= 0x01) && (version_minor >= 0x37)) + rdev->uvd.max_handles = RADEON_MAX_UVD_HANDLES; } } @@ -166,7 +183,7 @@ int radeon_uvd_init(struct radeon_device *rdev) bo_size = RADEON_GPU_PAGE_ALIGN(rdev->uvd_fw->size + 8) + RADEON_UVD_STACK_SIZE + RADEON_UVD_HEAP_SIZE + - RADEON_GPU_PAGE_SIZE; + RADEON_UVD_SESSION_SIZE * rdev->uvd.max_handles; r = radeon_bo_create(rdev, bo_size, PAGE_SIZE, true, RADEON_GEM_DOMAIN_VRAM, 0, NULL, NULL, &rdev->uvd.vcpu_bo); @@ -199,7 +216,7 @@ int radeon_uvd_init(struct radeon_device *rdev) radeon_bo_unreserve(rdev->uvd.vcpu_bo); - for (i = 0; i < RADEON_MAX_UVD_HANDLES; ++i) { + for (i = 0; i < rdev->uvd.max_handles; ++i) { atomic_set(&rdev->uvd.handles[i], 0); rdev->uvd.filp[i] = NULL; rdev->uvd.img_size[i] = 0; @@ -236,7 +253,7 @@ int radeon_uvd_suspend(struct radeon_device *rdev) if (rdev->uvd.vcpu_bo == NULL) return 0; - fo
[PATCH libdrm 3/7] freedreno: Fix spelling mistakes
On Wed, Apr 6, 2016 at 12:42 PM, Emil Velikov wrote: > Hi Eric, > > On 3 April 2016 at 19:48, Eric Engestrom wrote: >> Signed-off-by: Eric Engestrom >> --- >> freedreno/kgsl/kgsl_drm.h | 2 +- >> freedreno/kgsl/msm_kgsl.h | 4 ++-- > > Not 100% sure how Rob deals with these. Although I'm suspecting that > they come from a kernel (similar to the ones in PATCH 5/7). > > Rob, is any of the above true - are they from a upstream/downstream > kernel somewhere ? If so should we update them here, or in the > 'master' project ? these come from kernel.. but from non-upstream vendor fork, and probably aren't even up to date w/ more recent vendor kernel branches. So I guess, meh? let's just fix it downstream and not worry about it? BR, -R > Thanks > Emil
[Intel-gfx] [PATCH 1/3] drm/edid: Add drm_edid_get_monitor_name()
On Wed, Apr 06, 2016 at 11:35:44AM +0300, Jani Nikula wrote: > On Tue, 05 Apr 2016, Jim Bride wrote: > > In order to include monitor name information in debugfs > > output we needed to add a function that would extract the > > monitor name from the EDID, and that function needed to > > reside in the file where the rest of the EDID helper > > functions are implemented. > > > > cc: dri-devel at lists.freedesktop.org > > Signed-off-by: Jim Bride > > --- > > drivers/gpu/drm/drm_edid.c | 28 > > include/drm/drm_crtc.h | 1 + > > 2 files changed, 29 insertions(+) > > > > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c > > index 558ef9f..fc69a46 100644 > > --- a/drivers/gpu/drm/drm_edid.c > > +++ b/drivers/gpu/drm/drm_edid.c > > @@ -3569,6 +3569,34 @@ struct drm_connector *drm_select_eld(struct > > drm_encoder *encoder) > > EXPORT_SYMBOL(drm_select_eld); > > > > /** > > + * drm_edid_get_monitor_name - fetch the monitor name from the edid > > + * @edid: monitor EDID information > > + * @name: pointer to a character array of at least 13 chars to hold the > > name > > Mixed feelings about "at least 13 chars". It might be simpler for this > one thing, but I hate to see this assumption of "at least 13 chars" get > spread around in patch 2 to where it's no longer obvious where this > requirement comes from. > > Seeing that this is mostly copy-paste from drm_edid_to_eld(), I think > this patch should be an abstraction of that code to a separate function. Yeah, I see what you mean. Writing something that works with both this use and drm_edid_to_eld() for the name parsing makes sense. > > + * > > + * Return: True if the name could be extracted, false otherwise > > + */ > > +bool drm_edid_get_monitor_name(struct edid *edid, char *name) > > +{ > > + char *edid_name = NULL; > > + int mnl; > > + > > + if (!edid || !name) > > + return false; > > + > > + drm_for_each_detailed_block((u8 *)edid, monitor_name, &edid_name); > > + for (mnl = 0; edid_name && mnl < 13; mnl++) { > > + if (edid_name[mnl] == 0x0a) { > > + name[mnl] = '\0'; > > Depending on edid_name you might not terminate the string. And, in fact, > if you make this an abstraction for drm_edid_to_eld(), you might be > better off *not* terminating, which OTOH is not nice for your other use > in patch 2. > > So how about first adding an internal abstraction: > > static int get_monitor_name(struct edid *edid, char name[13]) > > which does *not* terminate the string, and returns length, 0 for > edid_name == NULL. Works nicely for drm_edid_to_eld(). > > Then you could add the external interface on top of that: > > static void drm_edid_get_monitor_name(struct edid *edid, char *buf, int > bufsize) > > which would always terminate the string (assuming bufsize > 0), even on > errors so you can get rid of the return value. This simplifies your > follow up code, and if we later on need more robust error handling, it's > easy to add the return value. Seems reasonable; I'll update the patch. Jim > BR, > Jani. > > > > + break; > > + } > > + name[mnl] = edid_name[mnl]; > > + } > > + > > + return mnl ? true : false; > > +} > > +EXPORT_SYMBOL(drm_edid_get_monitor_name); > > + > > +/** > > * drm_detect_hdmi_monitor - detect whether monitor is HDMI > > * @edid: monitor EDID information > > * > > diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h > > index 8cb377c..2590168 100644 > > --- a/include/drm/drm_crtc.h > > +++ b/include/drm/drm_crtc.h > > @@ -2500,6 +2500,7 @@ extern int drm_edid_header_is_valid(const u8 > > *raw_edid); > > extern bool drm_edid_block_valid(u8 *raw_edid, int block, bool > > print_bad_edid, > > bool *edid_corrupt); > > extern bool drm_edid_is_valid(struct edid *edid); > > +extern bool drm_edid_get_monitor_name(struct edid *edid, char *name); > > > > extern struct drm_tile_group *drm_mode_create_tile_group(struct drm_device > > *dev, > > char topology[8]); > > -- > Jani Nikula, Intel Open Source Technology Center