radeon_connector->audio is set by RADEON_AUDIO_DISABLE as default.
Dear all, I switched my desktop environment to GNOME wayland recently, and I found that no sound in this environment. In X desktop environment, the ioctl DRM_IOCTL_MODE_SETPROPERTY(I confused it with DRM_IOCTL_MODE_OBJ_SETPROPERTY - I deleted the log already :( ) is called by userspace and it makes the sound works. But in Gnome wayland desktop environment, the ioctl is not called. I tried to fixed it, and found that it is because radeon_connector->audio is set by RADEON_AUDIO_DISABLE. In atombios_encoders.c, atombios_get_encoder_mode() if (radeon_connector->audio == RADEON_AUDIO_ENABLE) return ATOM_ENCODER_MODE_HDMI; else if (drm_detect_hdmi_monitor(radeon_connector_edid(connector)) && (radeon_connector->audio == RADEON_AUDIO_AUTO)) return ATOM_ENCODER_MODE_HDMI; else return ATOM_ENCODER_MODE_DVI; This code returns ATOM_ENCODER_MODE_DVI. In atombios_encoders.c, radeon_atom_encoder_mode_set(): encoder_mode = atombios_get_encoder_mode(encoder); if (connector && (radeon_audio != 0) && ((encoder_mode == ATOM_ENCODER_MODE_HDMI) || ENCODER_MODE_IS_DP(encoder_mode))) radeon_audio_mode_set(encoder, adjusted_mode);b So this code bypasses the calling of radeon_audio_mode_set(). I think that radeon_connector->audio should be set by RADEON_AUDIO_AUTO, at least for connectors which can output audio. I fixed the code like below, and it works for me. But I am not familiar with radeon DRM driver, and can't see the big picture. Can you review this code? Thanks, Hyungwon Hwang diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index cfcc099..cf52ea5 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c @@ -1975,11 +1975,12 @@ radeon_add_atom_connector(struct drm_device *dev, rdev->mode_info.output_csc_property, RADEON_OUTPUT_CSC_BYPASS); break; - case DRM_MODE_CONNECTOR_DVII: - case DRM_MODE_CONNECTOR_DVID: case DRM_MODE_CONNECTOR_HDMIA: case DRM_MODE_CONNECTOR_HDMIB: case DRM_MODE_CONNECTOR_DisplayPort: + radeon_connector->audio = RADEON_AUDIO_AUTO; + case DRM_MODE_CONNECTOR_DVII: + case DRM_MODE_CONNECTOR_DVID: drm_connector_init(dev, &radeon_connector->base, &radeon_dp_connector_funcs, connector_type); drm_connector_helper_add(&radeon_connector->base, @@ -2024,8 +2025,9 @@ radeon_add_atom_connector(struct drm_device *dev, 1); } break; - case DRM_MODE_CONNECTOR_LVDS: case DRM_MODE_CONNECTOR_eDP: + radeon_connector->audio = RADEON_AUDIO_AUTO; + case DRM_MODE_CONNECTOR_LVDS: drm_connector_init(dev, &radeon_connector->base, &radeon_lvds_bridge_connector_funcs, connector_type); drm_connector_helper_add(&radeon_connector->base, @@ -2196,6 +2198,7 @@ radeon_add_atom_connector(struct drm_device *dev, connector->doublescan_allowed = true; else connector->doublescan_allowed = false; + radeon_connector->audio = RADEON_AUDIO_AUTO; break; case DRM_MODE_CONNECTOR_DisplayPort: radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL); @@ -2245,6 +2248,7 @@ radeon_add_atom_connector(struct drm_device *dev, connector->interlace_allowed = true; /* in theory with a DP to VGA converter... */ connector->doublescan_allowed = false; + radeon_connector->audio = RADEON_AUDIO_AUTO; break; case DRM_MODE_CONNECTOR_eDP: radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL); @@ -2267,6 +2271,7 @@ radeon_add_atom_connector(struct drm_device *dev, subpixel_order = SubPixelHorizontalRGB; connector->interlace_allowed = false; connector->doublescan_allowed = false; + radeon_connector->audio = RADEON_AUDIO_AUTO; break; case DRM_MODE_CONNECTOR_SVIDEO: case DRM_MODE_CONNECTOR_Composite:
[Bug 116251] New: radeon 5a427809cd9143bef89ee3110f45e84f37484218 "drm/radeon: disable runtime pm on PX laptop" makes dGPU never stop
https://bugzilla.kernel.org/show_bug.cgi?id=116251 Bug ID: 116251 Summary: radeon 5a427809cd9143bef89ee3110f45e84f37484218 "drm/radeon: disable runtime pm on PX laptop" makes dGPU never stop Product: Drivers Version: 2.5 Kernel Version: 4.5.1 Hardware: Intel OS: Linux Tree: Mainline Status: NEW Severity: normal Priority: P1 Component: Video(DRI - non Intel) Assignee: drivers_video-dri at kernel-bugs.osdl.org Reporter: eugene.shalygin at gmail.com Regression: No Clevo P177SM, these two GPUs: 00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06) 01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Neptune XT [Radeon HD 8970M] (rev ff) With kernel 4.5.1 the Radeon card is always on. Reverting 5a427809cd9143bef89ee3110f45e84f37484218 fixes the problem. -- You are receiving this mail because: You are watching the assignee of the bug.
[Bug 116251] radeon 5a427809cd9143bef89ee3110f45e84f37484218 "drm/radeon: disable runtime pm on PX laptop" makes dGPU never stop
https://bugzilla.kernel.org/show_bug.cgi?id=116251 Eugene Shalygin changed: What|Removed |Added Regression|No |Yes -- You are receiving this mail because: You are watching the assignee of the bug.
[Bug 116251] radeon 5a427809cd9143bef89ee3110f45e84f37484218 "drm/radeon: disable runtime pm on PX laptop" makes dGPU never stop
https://bugzilla.kernel.org/show_bug.cgi?id=116251 --- Comment #1 from Michel Dänzer --- Duplicate of bug 115321. (In reply to Eugene Shalygin from comment #0) > With kernel 4.5.1 the Radeon card is always on. Reverting > 5a427809cd9143bef89ee3110f45e84f37484218 fixes the problem. I did warn Greg KH about this regression, but it looks like he backported the change anyway. :( -- You are receiving this mail because: You are watching the assignee of the bug.
drm/amdgpu: start using graphics object ids from DAL.
DAL has a concept of storing the graphics object ids in a special small struct, and adding type safety to them. I'm starting to contemplate bringing some pieces of DAL into the mainline modesetting code (like the bios parser for a start), and I think this is the best first step in that direction. This series converts connectors, encoders and crtcs id to the DAL objects. I haven't done PLLs yet they are a bit messier and I probably need to think about them a bit more. Also DAL doesn't support any of the DVO/external encoders, I've no idea if they even exist on DCE8 or newer GPUs, so I've done a separate patch to drop them. Dave.
[PATCH 1/7] drm/amdgpu: drop apply quirks for now.
From: Dave Airlie This isn't being used so drop it. Signed-off-by: Dave Airlie --- drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 15 --- 1 file changed, 15 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c index 84b0ce3..3b469ea 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c @@ -234,16 +234,6 @@ amdgpu_atombios_get_hpd_info_from_gpio(struct amdgpu_device *adev, return hpd; } -static bool amdgpu_atombios_apply_quirks(struct amdgpu_device *adev, -uint32_t supported_device, -int *connector_type, -struct amdgpu_i2c_bus_rec *i2c_bus, -uint16_t *line_mux, -struct amdgpu_hpd *hpd) -{ - return true; -} - static const int object_connector_convert[] = { DRM_MODE_CONNECTOR_Unknown, DRM_MODE_CONNECTOR_DVII, @@ -514,11 +504,6 @@ bool amdgpu_atombios_get_connector_info_from_object_table(struct amdgpu_device * conn_id = le16_to_cpu(path->usConnObjectId); - if (!amdgpu_atombios_apply_quirks - (adev, le16_to_cpu(path->usDeviceTag), &connector_type, -&ddc_bus, &conn_id, &hpd)) - continue; - amdgpu_display_add_connector(adev, conn_id, le16_to_cpu(path->usDeviceTag), -- 2.5.5
[PATCH 2/7] drm/amdgpu: introduce grph object id from DAL.
From: Dave Airlie DAL has a graphics object id we should re-use this in the mainline driver, and wrap around it for now. This patch introduces the core of the grph functionality ported from DAL. Signed-off-by: Dave Airlie --- drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h | 2 + .../gpu/drm/amd/include/display_grph_object_id.h | 318 + 2 files changed, 320 insertions(+) create mode 100644 drivers/gpu/drm/amd/include/display_grph_object_id.h diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h index 8d432e6..4b80978 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h @@ -40,6 +40,8 @@ #include #include +#include "display_grph_object_id.h" + struct amdgpu_bo; struct amdgpu_device; struct amdgpu_encoder; diff --git a/drivers/gpu/drm/amd/include/display_grph_object_id.h b/drivers/gpu/drm/amd/include/display_grph_object_id.h new file mode 100644 index 000..2bb8642 --- /dev/null +++ b/drivers/gpu/drm/amd/include/display_grph_object_id.h @@ -0,0 +1,318 @@ +/* + * Copyright 2012-15 Advanced Micro Devices, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * Authors: AMD + * + */ + +#ifndef __DISPLAY_GRPH_OBJECT_ID_H__ +#define __DISPLAY_GRPH_OBJECT_ID_H__ + +/* Types of graphics objects */ +enum object_type { + OBJECT_TYPE_UNKNOWN = 0, + + /* Direct ATOM BIOS translation */ + OBJECT_TYPE_GPU, + OBJECT_TYPE_ENCODER, + OBJECT_TYPE_CONNECTOR, + OBJECT_TYPE_ROUTER, + OBJECT_TYPE_GENERIC, + + /* Driver specific */ + OBJECT_TYPE_AUDIO, + OBJECT_TYPE_CONTROLLER, + OBJECT_TYPE_CLOCK_SOURCE, + OBJECT_TYPE_ENGINE, + + OBJECT_TYPE_COUNT +}; + +/* Enumeration inside one type of graphics objects */ +enum object_enum_id { + ENUM_ID_UNKNOWN = 0, + ENUM_ID_1, + ENUM_ID_2, + ENUM_ID_3, + ENUM_ID_4, + ENUM_ID_5, + ENUM_ID_6, + ENUM_ID_7, + + ENUM_ID_COUNT +}; + +/* Generic object ids */ +enum generic_id { + GENERIC_ID_UNKNOWN = 0, + GENERIC_ID_MXM_OPM, + GENERIC_ID_GLSYNC, + GENERIC_ID_STEREO, + + GENERIC_ID_COUNT +}; + +/* Controller object ids */ +enum controller_id { + CONTROLLER_ID_UNDEFINED = 0, + CONTROLLER_ID_D0, + CONTROLLER_ID_D1, + CONTROLLER_ID_D2, + CONTROLLER_ID_D3, + CONTROLLER_ID_D4, + CONTROLLER_ID_D5, + CONTROLLER_ID_UNDERLAY0, + CONTROLLER_ID_MAX = CONTROLLER_ID_UNDERLAY0 +}; + +#define IS_UNDERLAY_CONTROLLER(ctrlr_id) (ctrlr_id >= CONTROLLER_ID_UNDERLAY0) + +/* + * ClockSource object ids. + * We maintain the order matching (more or less) ATOM BIOS + * to improve optimized acquire + */ +enum clock_source_id { + CLOCK_SOURCE_ID_UNDEFINED = 0, + CLOCK_SOURCE_ID_PLL0, + CLOCK_SOURCE_ID_PLL1, + CLOCK_SOURCE_ID_PLL2, + CLOCK_SOURCE_ID_EXTERNAL, /* ID (Phy) ref. clk. for DP */ + CLOCK_SOURCE_ID_DCPLL, + CLOCK_SOURCE_ID_DFS,/* DENTIST */ + CLOCK_SOURCE_ID_VCE,/* VCE does not need a real PLL */ + /* Used to distinguish between programming pixel clock and ID (Phy) clock */ + CLOCK_SOURCE_ID_DP_DTO, + + CLOCK_SOURCE_COMBO_PHY_PLL0, /*combo PHY PLL defines (DC 11.2 and up)*/ + CLOCK_SOURCE_COMBO_PHY_PLL1, + CLOCK_SOURCE_COMBO_PHY_PLL2, + CLOCK_SOURCE_COMBO_PHY_PLL3, + CLOCK_SOURCE_COMBO_PHY_PLL4, + CLOCK_SOURCE_COMBO_PHY_PLL5, + CLOCK_SOURCE_COMBO_DISPLAY_PLL0 +}; + +/* Encoder object ids */ +enum encoder_id { + ENCODER_ID_UNKNOWN = 0, + + /* Radeon Class Display Hardware */ + ENCODER_ID_INTERNAL_LVDS, + ENCODER_ID_INTERNAL_TMDS1, + ENCODER_ID_INTERNAL_TMDS2, + ENCODER_ID_INTERNAL_DAC1, + ENCODER_ID_INTERNAL_DAC2, /* TV/CV DAC */ + + /* External Third Party Encoders */ +
[PATCH 5/7] [RFC] drm/amdgpu: drop DVO encoders support.
From: Dave Airlie I'm a bit confused whether this is needed so it would be good to confirm if hw shipped with it. DAL as currently is doesn't have any support for this, it doesn't have any encoder ids for DVO that I can see. So before porting to DAL graphics objects, I'm removing this code, so we can see if any regressions land here. Signed-off-by: Dave Airlie --- drivers/gpu/drm/amd/amdgpu/atombios_crtc.c | 3 - drivers/gpu/drm/amd/amdgpu/atombios_encoders.c | 100 - drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 8 -- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 8 -- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 8 -- 5 files changed, 127 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_crtc.c b/drivers/gpu/drm/amd/amdgpu/atombios_crtc.c index 49aa350..072a729 100644 --- a/drivers/gpu/drm/amd/amdgpu/atombios_crtc.c +++ b/drivers/gpu/drm/amd/amdgpu/atombios_crtc.c @@ -344,9 +344,6 @@ static u32 amdgpu_atombios_crtc_adjust_pll(struct drm_crtc *crtc, } } - /* DVO wants 2x pixel clock if the DVO chip is in 12 bit mode */ - if (amdgpu_encoder->encoder_id == ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1) - adjusted_clock = mode->clock * 2; if (amdgpu_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT)) amdgpu_crtc->pll_flags |= AMDGPU_PLL_PREFER_CLOSEST_LOWER; if (amdgpu_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c index 4367941..7ef93c6 100644 --- a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c +++ b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c @@ -272,7 +272,6 @@ bool amdgpu_atombios_encoder_is_digital(struct drm_encoder *encoder) { struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); switch (amdgpu_encoder->encoder_id) { - case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1: case ENCODER_OBJECT_ID_INTERNAL_UNIPHY: case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1: case ENCODER_OBJECT_ID_INTERNAL_UNIPHY2: @@ -369,79 +368,8 @@ static u8 amdgpu_atombios_encoder_get_bpc(struct drm_encoder *encoder) } } -union dvo_encoder_control { - ENABLE_EXTERNAL_TMDS_ENCODER_PS_ALLOCATION ext_tmds; - DVO_ENCODER_CONTROL_PS_ALLOCATION dvo; - DVO_ENCODER_CONTROL_PS_ALLOCATION_V3 dvo_v3; - DVO_ENCODER_CONTROL_PS_ALLOCATION_V1_4 dvo_v4; -}; - -static void -amdgpu_atombios_encoder_setup_dvo(struct drm_encoder *encoder, int action) -{ - struct drm_device *dev = encoder->dev; - struct amdgpu_device *adev = dev->dev_private; - struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); - union dvo_encoder_control args; - int index = GetIndexIntoMasterTable(COMMAND, DVOEncoderControl); - uint8_t frev, crev; - - memset(&args, 0, sizeof(args)); - - if (!amdgpu_atom_parse_cmd_header(adev->mode_info.atom_context, index, &frev, &crev)) - return; - - switch (frev) { - case 1: - switch (crev) { - case 1: - /* R4xx, R5xx */ - args.ext_tmds.sXTmdsEncoder.ucEnable = action; - - if (amdgpu_dig_monitor_is_duallink(encoder, amdgpu_encoder->pixel_clock)) - args.ext_tmds.sXTmdsEncoder.ucMisc |= PANEL_ENCODER_MISC_DUAL; - - args.ext_tmds.sXTmdsEncoder.ucMisc |= ATOM_PANEL_MISC_888RGB; - break; - case 2: - /* RS600/690/740 */ - args.dvo.sDVOEncoder.ucAction = action; - args.dvo.sDVOEncoder.usPixelClock = cpu_to_le16(amdgpu_encoder->pixel_clock / 10); - /* DFP1, CRT1, TV1 depending on the type of port */ - args.dvo.sDVOEncoder.ucDeviceType = ATOM_DEVICE_DFP1_INDEX; - - if (amdgpu_dig_monitor_is_duallink(encoder, amdgpu_encoder->pixel_clock)) - args.dvo.sDVOEncoder.usDevAttr.sDigAttrib.ucAttribute |= PANEL_ENCODER_MISC_DUAL; - break; - case 3: - /* R6xx */ - args.dvo_v3.ucAction = action; - args.dvo_v3.usPixelClock = cpu_to_le16(amdgpu_encoder->pixel_clock / 10); - args.dvo_v3.ucDVOConfig = 0; /* XXX */ - break; - case 4: - /* DCE8 */ - args.dvo_v4.ucAction = action; - args.dvo_v4.usPixelClock = cpu_to_le16(amdgpu_encoder->pixel_clock / 10); - args.dvo_v4.ucDVOConfig = 0; /* XXX */ - args.dvo_v4.ucBitPerColor = amdgpu_atombios_encoder_get_bpc(encoder); - break; - default: -
[PATCH 7/7] drm/amdgpu: convert crtc to using graphics object ids.
From: Dave Airlie As before, convert the crtc_id to a graphics object id. Signed-off-by: Dave Airlie --- drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c| 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c| 10 ++--- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c| 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 2 +- drivers/gpu/drm/amd/amdgpu/atombios_crtc.c | 55 ++ drivers/gpu/drm/amd/amdgpu/atombios_crtc.h | 2 +- drivers/gpu/drm/amd/amdgpu/atombios_encoders.c | 8 ++-- drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 31 --- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 31 --- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 33 11 files changed, 93 insertions(+), 85 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c index 8b653f2..11aa704 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c @@ -828,7 +828,7 @@ static int amdgpu_cgs_get_active_displays_info(struct cgs_device *cgs_device, &ddev->mode_config.crtc_list, head) { amdgpu_crtc = to_amdgpu_crtc(crtc); if (crtc->enabled) { - info->active_display_mask |= (1 << amdgpu_crtc->crtc_id); + info->active_display_mask |= (1 << amdgpu_crtc->crtc_object_id.id); info->display_count++; } if (mode_info != NULL && diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c index 448b211..d80d2dd 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c @@ -140,7 +140,7 @@ static void amdgpu_flip_work_func(struct work_struct *__work) DRM_DEBUG_DRIVER("crtc:%d[%p], pflip_stat:AMDGPU_FLIP_SUBMITTED, work: %p,\n", -amdgpuCrtc->crtc_id, amdgpuCrtc, work); +amdgpuCrtc->crtc_object_id.id, amdgpuCrtc, work); } @@ -196,7 +196,7 @@ int amdgpu_crtc_page_flip(struct drm_crtc *crtc, work->event = event; work->adev = adev; - work->crtc_id = amdgpu_crtc->crtc_id; + work->crtc_id = amdgpu_crtc->crtc_object_id.id; /* schedule unpin of the old buffer */ old_amdgpu_fb = to_amdgpu_framebuffer(crtc->primary->fb); @@ -239,7 +239,7 @@ int amdgpu_crtc_page_flip(struct drm_crtc *crtc, work->base = base; - r = drm_vblank_get(crtc->dev, amdgpu_crtc->crtc_id); + r = drm_vblank_get(crtc->dev, amdgpu_crtc->crtc_object_id.id); if (r) { DRM_ERROR("failed to get vblank before flip\n"); goto pflip_cleanup; @@ -259,7 +259,7 @@ int amdgpu_crtc_page_flip(struct drm_crtc *crtc, DRM_DEBUG_DRIVER("crtc:%d[%p], pflip_stat:AMDGPU_FLIP_PENDING, work: %p,\n", -amdgpu_crtc->crtc_id, amdgpu_crtc, work); +amdgpu_crtc->crtc_object_id.id, amdgpu_crtc, work); /* update crtc fb */ crtc->primary->fb = fb; spin_unlock_irqrestore(&crtc->dev->event_lock, flags); @@ -267,7 +267,7 @@ int amdgpu_crtc_page_flip(struct drm_crtc *crtc, return 0; vblank_cleanup: - drm_vblank_put(crtc->dev, amdgpu_crtc->crtc_id); + drm_vblank_put(crtc->dev, amdgpu_crtc->crtc_object_id.id); pflip_cleanup: if (unlikely(amdgpu_bo_reserve(new_rbo, false) != 0)) { diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c index 1f9d318..8449f45 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c @@ -181,7 +181,7 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file crtc = (struct drm_crtc *)minfo->crtcs[i]; if (crtc && crtc->base.id == info->mode_crtc.id) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); - ui32 = amdgpu_crtc->crtc_id; + ui32 = display_graphics_object_id_get_controller_id(amdgpu_crtc->crtc_object_id); found = 1; break; } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h index 96e1de8..5624c81 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h @@ -368,7 +368,7 @@ struct amdgpu_atom_ss { struct amdgpu_crtc { struct drm_crtc base; - int crtc_id; + struct graphics_object_id crtc_object_id; u16 lut_r[256], lut_g[256], lut_b[256]; bool enabled
[PATCH 3/7] drm/amdgpu: introduce graphics object id helpers.
From: Dave Airlie DAL hides these inside the bios parser, we need them separate to use here, so copy them over. I'll add more to this as I go. This also needs the ones to translate objects back that aren't in here currently. Signed-off-by: Dave Airlie --- drivers/gpu/drm/amd/amdgpu/Makefile| 3 +- .../drm/amd/amdgpu/amdgpu_grph_object_id_helpers.c | 183 + drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h | 2 + 3 files changed, 187 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_grph_object_id_helpers.c diff --git a/drivers/gpu/drm/amd/amdgpu/Makefile b/drivers/gpu/drm/amd/amdgpu/Makefile index c7fcdce..376d08a 100644 --- a/drivers/gpu/drm/amd/amdgpu/Makefile +++ b/drivers/gpu/drm/amd/amdgpu/Makefile @@ -23,7 +23,8 @@ amdgpu-y += amdgpu_device.o amdgpu_kms.o \ amdgpu_pm.o atombios_dp.o amdgpu_afmt.o amdgpu_trace_points.o \ atombios_encoders.o amdgpu_sa.o atombios_i2c.o \ amdgpu_prime.o amdgpu_vm.o amdgpu_ib.o amdgpu_pll.o \ - amdgpu_ucode.o amdgpu_bo_list.o amdgpu_ctx.o amdgpu_sync.o + amdgpu_ucode.o amdgpu_bo_list.o amdgpu_ctx.o amdgpu_sync.o \ + amdgpu_grph_object_id_helpers.o # add asic specific block amdgpu-$(CONFIG_DRM_AMDGPU_CIK)+= cik.o cik_ih.o kv_smc.o kv_dpm.o \ diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_grph_object_id_helpers.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_grph_object_id_helpers.c new file mode 100644 index 000..c916d93 --- /dev/null +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_grph_object_id_helpers.c @@ -0,0 +1,183 @@ +/* + * Copyright 2012-15 Advanced Micro Devices, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * Authors: AMD + * + */ + +#include "amdgpu.h" +#include "atom.h" +#include "display_grph_object_id.h" + +/* these are taken from AMD's DAL bios parser code */ + +static uint32_t gpu_id_from_bios_object_id(uint32_t bios_object_id) +{ + return (bios_object_id & OBJECT_ID_MASK) >> OBJECT_ID_SHIFT; +} + +static enum connector_id connector_id_from_bios_object_id(uint32_t bios_object_id) +{ + uint32_t bios_connector_id = gpu_id_from_bios_object_id(bios_object_id); + + enum connector_id id; + + switch (bios_connector_id) { + case CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I: + id = CONNECTOR_ID_SINGLE_LINK_DVII; + break; + case CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I: + id = CONNECTOR_ID_DUAL_LINK_DVII; + break; + case CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_D: + id = CONNECTOR_ID_SINGLE_LINK_DVID; + break; + case CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D: + id = CONNECTOR_ID_DUAL_LINK_DVID; + break; + case CONNECTOR_OBJECT_ID_VGA: + id = CONNECTOR_ID_VGA; + break; + case CONNECTOR_OBJECT_ID_HDMI_TYPE_A: + id = CONNECTOR_ID_HDMI_TYPE_A; + break; + case CONNECTOR_OBJECT_ID_LVDS: + id = CONNECTOR_ID_LVDS; + break; + case CONNECTOR_OBJECT_ID_PCIE_CONNECTOR: + id = CONNECTOR_ID_PCIE; + break; + case CONNECTOR_OBJECT_ID_HARDCODE_DVI: + id = CONNECTOR_ID_HARDCODE_DVI; + break; + case CONNECTOR_OBJECT_ID_DISPLAYPORT: + id = CONNECTOR_ID_DISPLAY_PORT; + break; + case CONNECTOR_OBJECT_ID_eDP: + id = CONNECTOR_ID_EDP; + break; + case CONNECTOR_OBJECT_ID_MXM: + id = CONNECTOR_ID_MXM; + break; + default: + id = CONNECTOR_ID_UNKNOWN; + break; + } + + return id; +} + +static enum object_enum_id enum_id_from_bios_object_id(uint32_t bios_object_id) +{ + uint32_t bios_enum_id = + (bios_object_id & ENUM_ID_MASK) >> ENUM_ID_SHIFT; + enum object_en
[PATCH 4/7] drm/amdgpu: use graphics objects for connectors.
From: Dave Airlie This introduces graphics objects for the connectors code, and replaces the atombios enums with the graphics object ones. These correspond currently so we don't really need a back translation pass for them. Signed-off-by: Dave Airlie --- drivers/gpu/drm/amd/amdgpu/amdgpu.h| 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 22 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 37 +- drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.h | 3 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_encoders.c | 4 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h | 8 +++--- drivers/gpu/drm/amd/amdgpu/atombios_dp.c | 8 +++--- drivers/gpu/drm/amd/amdgpu/atombios_encoders.c | 10 +++ 8 files changed, 37 insertions(+), 57 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index a7a53ac..0e54f4a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -2204,7 +2204,7 @@ amdgpu_get_sdma_instance(struct amdgpu_ring *ring) #define amdgpu_display_page_flip(adev, crtc, base) (adev)->mode_info.funcs->page_flip((adev), (crtc), (base)) #define amdgpu_display_page_flip_get_scanoutpos(adev, crtc, vbl, pos) (adev)->mode_info.funcs->page_flip_get_scanoutpos((adev), (crtc), (vbl), (pos)) #define amdgpu_display_add_encoder(adev, e, s, c) (adev)->mode_info.funcs->add_encoder((adev), (e), (s), (c)) -#define amdgpu_display_add_connector(adev, ci, sd, ct, ib, coi, h, r) (adev)->mode_info.funcs->add_connector((adev), (ci), (sd), (ct), (ib), (coi), (h), (r)) +#define amdgpu_display_add_connector(adev, coi, sd, ct, ib, h, r) (adev)->mode_info.funcs->add_connector((adev), (coi), (sd), (ct), (ib), (h), (r)) #define amdgpu_display_stop_mc_access(adev, s) (adev)->mode_info.funcs->stop_mc_access((adev), (s)) #define amdgpu_display_resume_mc_access(adev, s) (adev)->mode_info.funcs->resume_mc_access((adev), (s)) #define amdgpu_emit_copy_buffer(adev, ib, s, d, b) (adev)->mman.buffer_funcs->emit_copy_buffer((ib), (s), (d), (b)) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c index 3b469ea..5f236d9 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c @@ -273,7 +273,7 @@ bool amdgpu_atombios_get_connector_info_from_object_table(struct amdgpu_device * ATOM_OBJECT_HEADER *obj_header; int i, j, k, path_size, device_support; int connector_type; - u16 conn_id, connector_object_id; + struct graphics_object_id connector_object_id; struct amdgpu_i2c_bus_rec ddc_bus; struct amdgpu_router router; struct amdgpu_gpio_rec gpio; @@ -309,21 +309,10 @@ bool amdgpu_atombios_get_connector_info_from_object_table(struct amdgpu_device * path_size += le16_to_cpu(path->usSize); if (device_support & le16_to_cpu(path->usDeviceTag)) { - uint8_t con_obj_id, con_obj_num, con_obj_type; - - con_obj_id = - (le16_to_cpu(path->usConnObjectId) & OBJECT_ID_MASK) - >> OBJECT_ID_SHIFT; - con_obj_num = - (le16_to_cpu(path->usConnObjectId) & ENUM_ID_MASK) - >> ENUM_ID_SHIFT; - con_obj_type = - (le16_to_cpu(path->usConnObjectId) & -OBJECT_TYPE_MASK) >> OBJECT_TYPE_SHIFT; + connector_object_id = amdgpu_object_id_from_bios_object_id(path->usConnObjectId); connector_type = - object_connector_convert[con_obj_id]; - connector_object_id = con_obj_id; + object_connector_convert[connector_object_id.id]; if (connector_type == DRM_MODE_CONNECTOR_Unknown) continue; @@ -502,13 +491,10 @@ bool amdgpu_atombios_get_connector_info_from_object_table(struct amdgpu_device * /* needed for aux chan transactions */ ddc_bus.hpd = hpd.hpd; - conn_id = le16_to_cpu(path->usConnObjectId); - amdgpu_display_add_connector(adev, - conn_id, + connector_object_id, le16_to_cpu(path->usDeviceTag), connector_type, &ddc_bus, - connector_object_id, &hpd, &router); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/drivers/gpu/drm/amd/amdgpu/am
[PATCH 6/7] drm/amdgpu: convert encoders to using the graphics object ids.
From: Dave Airlie This ports the encoder code over to the common graphics objects from DAL. Note the encoders id don't match 1:1 between atombios and the graphics objects. Signed-off-by: Dave Airlie --- drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 5 +- drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 30 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.h | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c| 46 ++--- drivers/gpu/drm/amd/amdgpu/amdgpu_encoders.c | 14 +- .../drm/amd/amdgpu/amdgpu_grph_object_id_helpers.c | 129 drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h | 7 +- drivers/gpu/drm/amd/amdgpu/atombios_crtc.c | 26 +-- drivers/gpu/drm/amd/amdgpu/atombios_crtc.h | 2 +- drivers/gpu/drm/amd/amdgpu/atombios_dp.c | 8 +- drivers/gpu/drm/amd/amdgpu/atombios_encoders.c | 228 - drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 57 +++--- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 54 ++--- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 54 ++--- .../gpu/drm/amd/include/display_grph_object_id.h | 1 + 15 files changed, 409 insertions(+), 254 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c index 5f236d9..e8855a3 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c @@ -341,7 +341,8 @@ bool amdgpu_atombios_get_connector_info_from_object_table(struct amdgpu_device * le16_to_cpu(enc_obj->asObjects[k].usRecordOffset)); ATOM_ENCODER_CAP_RECORD *cap_record; u16 caps = 0; - + struct graphics_object_id encoder_object_id; + encoder_object_id = amdgpu_object_id_from_bios_object_id(encoder_obj); while (record->ucRecordSize > 0 && record->ucRecordType > 0 && record->ucRecordType <= ATOM_MAX_OBJECT_RECORD_NUMBER) { @@ -355,7 +356,7 @@ bool amdgpu_atombios_get_connector_info_from_object_table(struct amdgpu_device * record = (ATOM_COMMON_RECORD_HEADER *) ((char *)record + record->ucRecordSize); } - amdgpu_display_add_encoder(adev, encoder_obj, + amdgpu_display_add_encoder(adev, encoder_object_id, le16_to_cpu(path->usDeviceTag), caps); } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c index 765309e..eb9b9dc 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c @@ -313,7 +313,7 @@ static void amdgpu_connector_get_edid(struct drm_connector *connector) amdgpu_i2c_router_select_ddc_port(amdgpu_connector); if ((amdgpu_connector_encoder_get_dp_bridge_encoder_id(connector) != -ENCODER_OBJECT_ID_NONE) && +ENCODER_ID_UNKNOWN) && amdgpu_connector->ddc_bus->has_aux) { amdgpu_connector->edid = drm_get_edid(connector, &amdgpu_connector->ddc_bus->aux.ddc); @@ -1228,7 +1228,7 @@ static int amdgpu_connector_dp_get_modes(struct drm_connector *connector) } else { /* need to setup ddc on the bridge */ if (amdgpu_connector_encoder_get_dp_bridge_encoder_id(connector) != - ENCODER_OBJECT_ID_NONE) { + ENCODER_ID_UNKNOWN) { if (encoder) amdgpu_atombios_encoder_setup_ext_encoder_ddc(encoder); } @@ -1262,7 +1262,7 @@ static int amdgpu_connector_dp_get_modes(struct drm_connector *connector) } else { /* need to setup ddc on the bridge */ if (amdgpu_connector_encoder_get_dp_bridge_encoder_id(connector) != - ENCODER_OBJECT_ID_NONE) { + ENCODER_ID_UNKNOWN) { if (encoder) amdgpu_atombios_encoder_setup_ex
radeon_connector->audio is set by RADEON_AUDIO_DISABLE as default.
eon_connector->audio = RADEON_AUDIO_AUTO; > > break; > > case DRM_MODE_CONNECTOR_DisplayPort: > > radeon_dig_connector = kzalloc(sizeof(struct > > radeon_connector_atom_dig), GFP_KERNEL); > > @@ -2245,6 +2248,7 @@ radeon_add_atom_connector(struct drm_device > > *dev, > > connector->interlace_allowed = true; > > /* in theory with a DP to VGA converter... */ > > connector->doublescan_allowed = false; > > + radeon_connector->audio = RADEON_AUDIO_AUTO; > > break; > > case DRM_MODE_CONNECTOR_eDP: > > radeon_dig_connector = kzalloc(sizeof(struct > > radeon_connector_atom_dig), GFP_KERNEL); > > @@ -2267,6 +2271,7 @@ radeon_add_atom_connector(struct drm_device > > *dev, > > subpixel_order = SubPixelHorizontalRGB; > > connector->interlace_allowed = false; > > connector->doublescan_allowed = false; > > + radeon_connector->audio = RADEON_AUDIO_AUTO; > > break; > > case DRM_MODE_CONNECTOR_SVIDEO: > > case DRM_MODE_CONNECTOR_Composite: -- next part -- An HTML attachment was scrubbed... URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160414/44b6032b/attachment-0001.html>
radeon_connector->audio is set by RADEON_AUDIO_DISABLE as default.
S: > > > case DRM_MODE_CONNECTOR_eDP: > > > + radeon_connector->audio = RADEON_AUDIO_AUTO; > > > + case DRM_MODE_CONNECTOR_LVDS: > > > drm_connector_init(dev, &radeon_connector->base, > > > > > > &radeon_lvds_bridge_connector_funcs, connector_type); > > > drm_connector_helper_add(&radeon_connector->base, > > > @@ -2196,6 +2198,7 @@ radeon_add_atom_connector(struct drm_device > > > *dev, > > > connector->doublescan_allowed = true; > > > else > > > connector->doublescan_allowed = false; > > > + radeon_connector->audio = RADEON_AUDIO_AUTO; > > > break; > > > case DRM_MODE_CONNECTOR_DisplayPort: > > > radeon_dig_connector = kzalloc(sizeof(struct > > > radeon_connector_atom_dig), GFP_KERNEL); > > > @@ -2245,6 +2248,7 @@ radeon_add_atom_connector(struct drm_device > > > *dev, > > > connector->interlace_allowed = true; > > > /* in theory with a DP to VGA converter... */ > > > connector->doublescan_allowed = false; > > > + radeon_connector->audio = RADEON_AUDIO_AUTO; > > > break; > > > case DRM_MODE_CONNECTOR_eDP: > > > radeon_dig_connector = kzalloc(sizeof(struct > > > radeon_connector_atom_dig), GFP_KERNEL); > > > @@ -2267,6 +2271,7 @@ radeon_add_atom_connector(struct drm_device > > > *dev, > > > subpixel_order = SubPixelHorizontalRGB; > > > connector->interlace_allowed = false; > > > connector->doublescan_allowed = false; > > > + radeon_connector->audio = RADEON_AUDIO_AUTO; > > > break; > > > case DRM_MODE_CONNECTOR_SVIDEO: > > > case DRM_MODE_CONNECTOR_Composite: -- next part -- An HTML attachment was scrubbed... URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160414/fbf95be9/attachment.html>
[PULL] drm: atmel-hlcdc: various improvements
On 13 April 2016 at 19:45, Boris Brezillon wrote: > Hi, > > Here is a pull request containing several improvement and cleanup patches > for the atmel-hlcdc driver to be applied on drm-next (targeting 4.7). > > Best Regards, > > Boris > > The following changes since commit c1cc68ae84bcce64e63d81b3531296728d407a16: > > drm: atmel-hlcdc: add a ->cleanup_fb() operation (2016-04-13 10:49:13 +0200) > > are available in the git repository at: > > https://github.com/bbrezillon/linux-at91.git cba06c6 This pull request is malformed, please be more careful. Can you reformat it properly and send it? i.e. there shouldn't be a sha1 but a branch/tag name. Dave.
[Bug 116251] radeon 5a427809cd9143bef89ee3110f45e84f37484218 "drm/radeon: disable runtime pm on PX laptop" makes dGPU never stop
https://bugzilla.kernel.org/show_bug.cgi?id=116251 Alex Deucher changed: What|Removed |Added CC||alexdeucher at gmail.com --- Comment #2 from Alex Deucher --- Please attach your full dmesg output. -- You are receiving this mail because: You are watching the assignee of the bug.
[PATCH] drm/crtc_helper: Reset empty plane state in drm_helper_crtc_mode_set_base()
On Wed, Apr 13, 2016 at 6:33 PM, Daniel Vetter wrote: > On Wed, Apr 13, 2016 at 10:52:34AM +0800, Ying Liu wrote: >> On Wed, Apr 13, 2016 at 12:00 AM, Daniel Vetter wrote: >> > On Tue, Apr 05, 2016 at 04:50:39PM +0800, Liu Ying wrote: >> >> Transitional drivers might access the NULL pointer plane->state in >> >> drm_helper_crtc_mode_set_base(), which causes NULL pointer dereference. >> >> So, let's reset it before handing it over to those drivers. >> >> commit e4f31ad2b713 ("drm: reset empty state in transitional helpers") >> >> did the same thing for other transitional helpers, but it seems this one >> >> was missed. >> >> >> >> Signed-off-by: Liu Ying >> > >> > This is kinda intentionally not done, assuming that drivers (when >> > transitioning) can't handle the full state stuff yet. >> >> It's a question whether the assumption is correct or not. >> IMHO, during the transition, the old/new state door has been >> opened to drivers. >> >> > >> > I'm not entirely opposed to this, but then we should do it for both plane >> > and crtc states, and in all cases I think. >> >> It looks this doesn't hurt. >> >> > >> > Completely new drivers should never use transitional helpers, but instead >> > just bring up using native atomic helpers directly. So what exactly do you >> > need this for? >> >> This is needed for my WIP imx-drm transitional plane driver. >> It would access the fb pointer of the old plane state(the empty plane >> state in question) to do atomic check. Also, ->atomic_update() will >> do something like page flip if the fb pointer is not NULL(meaning >> that the plane was enabled before the update). All of this aims to >> make the driver behave the similar way after the transition. > > If you need this in your driver, just make sure you're calling ->reset > hooks yourself as needed? Also this really is just for transitioning, in > the end no driver should permanently end up using these functions. In the > end transitional helpers here are meant as guidelines/crutches, every > driver is slightly different. Adding hacks to make things work smoothly > for all of them is impossible, and imo better to just move real fast to > proper atomic. Granted my driver may call ->reset, it's more appropriate to do that in the helper. There are several reasons for this. First, helper callers do not bother to do this. Secondly, drm_helper_crtc_mode_set_base is somewhat a counterpart of drm_helper_crtc_mode_set, drm_plane_helper_update and drm_plane_helper_disable. Now that commit e4f31ad2b713 calls ->reset in the three helpers, it looks there is no reason this cannot be done for their counterpart. Last but not least, exposing the NULL pointer plane->state to helper callers is not a good behavior, even worse could be a bug. So, this patch is not a hack but a somewhat bug fix. Regards, Liu Ying > -Daniel > >> >> Regards, >> Liu Ying >> >> > -Daniel >> > >> >> --- >> >> drivers/gpu/drm/drm_crtc_helper.c | 8 +--- >> >> 1 file changed, 5 insertions(+), 3 deletions(-) >> >> >> >> diff --git a/drivers/gpu/drm/drm_crtc_helper.c >> >> b/drivers/gpu/drm/drm_crtc_helper.c >> >> index 79555d2..66ca313 100644 >> >> --- a/drivers/gpu/drm/drm_crtc_helper.c >> >> +++ b/drivers/gpu/drm/drm_crtc_helper.c >> >> @@ -1053,10 +1053,12 @@ int drm_helper_crtc_mode_set_base(struct drm_crtc >> >> *crtc, int x, int y, >> >> >> >> if (plane->funcs->atomic_duplicate_state) >> >> plane_state = plane->funcs->atomic_duplicate_state(plane); >> >> - else if (plane->state) >> >> + else { >> >> + if (!plane->state) >> >> + drm_atomic_helper_plane_reset(plane); >> >> + >> >> plane_state = >> >> drm_atomic_helper_plane_duplicate_state(plane); >> >> - else >> >> - plane_state = kzalloc(sizeof(*plane_state), GFP_KERNEL); >> >> + } >> >> if (!plane_state) >> >> return -ENOMEM; >> >> plane_state->plane = plane; >> >> -- >> >> 2.5.0 >> >> >> > >> > -- >> > Daniel Vetter >> > Software Engineer, Intel Corporation >> > http://blog.ffwll.ch > > -- > Daniel Vetter > Software Engineer, Intel Corporation > http://blog.ffwll.ch
[Bug 115321] radeon runpm falsely disabled on Clevo P170EM
https://bugzilla.kernel.org/show_bug.cgi?id=115321 Alex Deucher changed: What|Removed |Added CC||alexdeucher at gmail.com --- Comment #1 from Alex Deucher --- Created attachment 212671 --> https://bugzilla.kernel.org/attachment.cgi?id=212671&action=edit possible fix 1/2 -- You are receiving this mail because: You are watching the assignee of the bug.
[Bug 115321] radeon runpm falsely disabled on Clevo P170EM
https://bugzilla.kernel.org/show_bug.cgi?id=115321 --- Comment #2 from Alex Deucher --- Created attachment 212681 --> https://bugzilla.kernel.org/attachment.cgi?id=212681&action=edit possible fix 2/2 -- You are receiving this mail because: You are watching the assignee of the bug.
[PATCH 1/2] drm/amdgpu: drop CV/TV bits in atombios_encoders.
From: Dave Airlie Converting to engine id doesn't have these. Signed-off-by: Dave Airlie --- drivers/gpu/drm/amd/amdgpu/atombios_encoders.c | 42 -- 1 file changed, 6 insertions(+), 36 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c index 9f7f3fc..37c498b 100644 --- a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c +++ b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c @@ -1336,21 +1336,11 @@ amdgpu_atombios_encoder_set_crtc_source(struct drm_encoder *encoder) break; case ENCODER_ID_INTERNAL_DAC1: case ENCODER_ID_INTERNAL_KLDSCP_DAC1: - if (amdgpu_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT)) - args.v1.ucDevice = ATOM_DEVICE_TV1_INDEX; - else if (amdgpu_encoder->active_device & (ATOM_DEVICE_CV_SUPPORT)) - args.v1.ucDevice = ATOM_DEVICE_CV_INDEX; - else - args.v1.ucDevice = ATOM_DEVICE_CRT1_INDEX; + args.v1.ucDevice = ATOM_DEVICE_CRT1_INDEX; break; case ENCODER_ID_INTERNAL_DAC2: case ENCODER_ID_INTERNAL_KLDSCP_DAC2: - if (amdgpu_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT)) - args.v1.ucDevice = ATOM_DEVICE_TV1_INDEX; - else if (amdgpu_encoder->active_device & (ATOM_DEVICE_CV_SUPPORT)) - args.v1.ucDevice = ATOM_DEVICE_CV_INDEX; - else - args.v1.ucDevice = ATOM_DEVICE_CRT2_INDEX; + args.v1.ucDevice = ATOM_DEVICE_CRT2_INDEX; break; default: return; @@ -1404,20 +1394,10 @@ amdgpu_atombios_encoder_set_crtc_source(struct drm_encoder *encoder) } break; case ENCODER_ID_INTERNAL_KLDSCP_DAC1: - if (amdgpu_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT)) - args.v2.ucEncoderID = ASIC_INT_TV_ENCODER_ID; - else if (amdgpu_encoder->active_device & (ATOM_DEVICE_CV_SUPPORT)) - args.v2.ucEncoderID = ASIC_INT_TV_ENCODER_ID; - else - args.v2.ucEncoderID = ASIC_INT_DAC1_ENCODER_ID; + args.v2.ucEncoderID = ASIC_INT_DAC1_ENCODER_ID; break; case ENCODER_ID_INTERNAL_KLDSCP_DAC2: - if (amdgpu_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT)) - args.v2.ucEncoderID = ASIC_INT_TV_ENCODER_ID; - else if (amdgpu_encoder->active_device & (ATOM_DEVICE_CV_SUPPORT)) - args.v2.ucEncoderID = ASIC_INT_TV_ENCODER_ID; - else - args.v2.ucEncoderID = ASIC_INT_DAC2_ENCODER_ID; + args.v2.ucEncoderID = ASIC_INT_DAC2_ENCODER_ID; break; default: return; @@ -1472,20 +1452,10 @@ amdgpu_atombios_encoder_set_crtc_source(struct drm_encoder *encoder) } break; case ENCODER_ID_INTERNAL_KLDSCP_DAC1: - if (amdgpu_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT)) - args.v3.ucEncoderID = ASIC_INT_TV_ENCODER_ID; - else if (amdgpu_encoder->active_device & (ATOM_DEVICE_CV_SUPPORT)) - args.v3.ucEncoderID = ASIC_INT_TV_ENCODER_ID; - else - args.v3.ucEncoderID = ASIC_INT_DAC1_ENCODER_ID; + args.v3.ucEncoderID = ASIC_INT_DAC1_ENCODER_ID; break; case ENCODER_ID_INTERNAL_KLDSCP_DAC2: - if (amdgpu_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT)) - args.v3.ucEncoderID = ASIC_INT_TV_ENCODER_ID; - else if (amdgpu_encoder->active_device & (ATOM_DEVICE_CV_SUPPORT)) - args.v3.ucEncoderID = ASIC_INT_TV_ENCODER_ID; -
[PATCH 2/2] drm/amdgpu: start using engine_id for encoders.
From: Dave Airlie This moves dig_encoder up a level and starts consistently using engine_id in its place for all the digital and dac engines. Signed-off-by: Dave Airlie --- .../drm/amd/amdgpu/amdgpu_grph_object_id_helpers.c | 37 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h | 3 +- drivers/gpu/drm/amd/amdgpu/atombios_encoders.c | 108 +++-- drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 30 +++--- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 30 +++--- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 31 +++--- 6 files changed, 107 insertions(+), 132 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_grph_object_id_helpers.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_grph_object_id_helpers.c index 122dfdb..32f0e3f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_grph_object_id_helpers.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_grph_object_id_helpers.c @@ -310,3 +310,40 @@ uint8_t amdgpu_encoder_object_to_atom(struct graphics_object_id object_id) enum encoder_id enc_id = display_graphics_object_id_get_encoder_id(object_id); return amdgpu_encoder_id_to_atom(enc_id); } + +bool amdgpu_engine_id_to_atom_encoder(enum engine_id engine, uint8_t *atom_encoder_id) +{ + uint8_t encoder_id = 0; + switch (engine) { + case ENGINE_ID_DIGA: + encoder_id = ASIC_INT_DIG1_ENCODER_ID; + break; + case ENGINE_ID_DIGB: + encoder_id = ASIC_INT_DIG2_ENCODER_ID; + break; + case ENGINE_ID_DIGC: + encoder_id = ASIC_INT_DIG3_ENCODER_ID; + break; + case ENGINE_ID_DIGD: + encoder_id = ASIC_INT_DIG4_ENCODER_ID; + break; + case ENGINE_ID_DIGE: + encoder_id = ASIC_INT_DIG5_ENCODER_ID; + break; + case ENGINE_ID_DIGF: + encoder_id = ASIC_INT_DIG6_ENCODER_ID; + break; + case ENGINE_ID_DIGG: + encoder_id = ASIC_INT_DIG7_ENCODER_ID; + break; + case ENCODER_ID_INTERNAL_KLDSCP_DAC1: + encoder_id = ASIC_INT_DAC1_ENCODER_ID; + break; + case ENCODER_ID_INTERNAL_KLDSCP_DAC2: + encoder_id = ASIC_INT_DAC2_ENCODER_ID; + default: + return false; + } + *atom_encoder_id = encoder_id; + return true; +} diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h index 5624c81..cb7a4f9 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h @@ -416,7 +416,6 @@ struct amdgpu_encoder_atom_dig { bool linkb; /* atom dig */ bool coherent_mode; - int dig_encoder; /* -1 disabled, 0 DIGA, 1 DIGB, etc. */ /* atom lvds/edp */ uint32_t lcd_misc; uint16_t panel_pwr_delay; @@ -446,6 +445,7 @@ struct amdgpu_encoder { int audio_polling_active; bool is_ext_encoder; u16 caps; + enum engine_id engine_id; /* -1 disabled, 0 DIGA, 1 DIGB, etc. */ }; struct amdgpu_connector_atom_dig { @@ -596,4 +596,5 @@ extern const struct drm_mode_config_funcs amdgpu_mode_funcs; struct graphics_object_id amdgpu_object_id_from_bios_object_id(uint32_t bios_object_id); uint8_t amdgpu_encoder_object_to_atom(struct graphics_object_id object_id); uint8_t amdgpu_encoder_id_to_atom(enum encoder_id id); +bool amdgpu_engine_id_to_atom_encoder(enum engine_id engine, uint8_t *atom_encoder_id); #endif diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c index 37c498b..ff24826 100644 --- a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c +++ b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c @@ -520,7 +520,7 @@ amdgpu_atombios_encoder_setup_dig_encoder(struct drm_encoder *encoder, } /* no dig encoder assigned */ - if (dig->dig_encoder == -1) + if (amdgpu_encoder->engine_id == ENGINE_ID_UNKNOWN) return; memset(&args, 0, sizeof(args)); @@ -585,7 +585,7 @@ amdgpu_atombios_encoder_setup_dig_encoder(struct drm_encoder *encoder, if (ENCODER_MODE_IS_DP(args.v3.ucEncoderMode) && (dp_clock == 27)) args.v1.ucConfig |= ATOM_ENCODER_CONFIG_V3_DPLINKRATE_2_70GHZ; - args.v3.acConfig.ucDigSel = dig->dig_encoder; + args.v3.acConfig.ucDigSel = amdgpu_encoder->engine_id; args.v3.ucBitPerColor = amdgpu_atombios_encoder_get_bpc(encoder); break; case 4: @@ -613,7 +613,7 @@ amdgpu_atombios_encoder_setup_dig_encoder(struct drm_encoder *encoder, else args.v1.ucConfig |= ATOM_ENCODER_CONFIG_V4_DPLINKRATE_1_62GHZ; } - args.v4.acConfig.ucDigSel = dig->
[PATCH] drm/i915/hdmi: Fix weak connector detection
On 5 April 2016 at 11:54, Ezequiel Garcia wrote: > (Adding Jani again, who got dropped for some reason) > > On 1 April 2016 at 16:50, Ezequiel Garcia > wrote: >> On 01 Apr 06:46 PM, Ville Syrjälä wrote: >>> On Fri, Apr 01, 2016 at 12:38:11PM -0300, Ezequiel Garcia wrote: >>> > El abr. 1, 2016 11:47 AM, "Ville Syrjälä" >> > linux.intel.com> >>> > escribió: >>> > > >>> > > On Thu, Mar 31, 2016 at 05:55:03PM -0300, Ezequiel Garcia wrote: >>> > > > Currently, our implementation of drm_connector_funcs.detect is >>> > > > based on getting a valid EDID. >>> > > > >>> > > > This requirement makes the driver fail to detect connected >>> > > > connectors in case of EDID corruption, which prevents from falling >>> > > > back to modes provided by builtin or user-provided EDIDs. >>> > > >>> > > So why are you getting corrupted EDIDs? >>> > > >>> > >>> > Does it matter? >>> >>> Yes. We should fix the real cause (if possible) instead of adding >>> more duct tape. >>> >> >> So, there are two things involved in this patch: >> >> 1. >> There are several reasons why EDID can get screwed, this is >> documented at length [1], and it's the motivation for >> CONFIG_DRM_LOAD_EDID_FIRMWARE to exist. >> >> You can find lots of reports on the internet of people getting >> corrupt EDID from their monitors. For instance, here's one [2]. >> >> And even if no firmware is provided using CONFIG_DRM_LOAD_EDID_FIRMWARE, >> the DRM core will provide a 1024x768 fallback mode: >> >> int drm_helper_probe_single_connector_modes(struct drm_connector *connector, >> uint32_t maxX, uint32_t maxY) >> { >> [..] >> if (count == 0 && connector->status == connector_status_connected) >> count = drm_add_modes_noedid(connector, 1024, 768); >> >> But, this only works if the connector is detected. >> >> Since I'm interested in backporting this patch to apply it on the kernels >> I maintain (which are currently deployed on hundreds of machines), I tried >> to find a simple solution. Hence, this patch. >> >> There's no issue to fix here, because broken hardware is a fact of life, >> and not something we can fix or ignore [3]. >> >> 2. >> On the other side, the i915 implementation looks suspicious. IMHO, >> drm_connector_funcs.detect should not try to read a valid EDID, >> and just try to detect if the connector is connected or disconnected. >> >> The EDID can be read in drm_connector_helper_funcs.get_modes, as other >> drm/connector drivers are doing (tda998x, tfp410, tegra). >> >> However, I think it's safer to get a simple fix now, and do this >> as follow-up patches. >> >> How does it sound? >> Are there any other comments regarding this patch? If at all possible, I'd like to see this merged, or otherwise a proposal for an alternative solution. >> [1] Documentation/EDID/HOWTO.txt >> [2] >> http://www.blaicher.com/2012/06/howto-fixing-a-broken-edid-eeprom-with-a-bus-pirate-v4/ >> [3] https://marc.info/?l=linux-kernel&m=112838038415265&w=4 Thanks, -- Ezequiel GarcÃa, VanguardiaSur www.vanguardiasur.com.ar
[PATCH] drm/crtc_helper: Reset empty plane state in drm_helper_crtc_mode_set_base()
On Thu, Apr 14, 2016 at 11:25:00AM +0800, Ying Liu wrote: > On Wed, Apr 13, 2016 at 6:33 PM, Daniel Vetter wrote: > > On Wed, Apr 13, 2016 at 10:52:34AM +0800, Ying Liu wrote: > >> On Wed, Apr 13, 2016 at 12:00 AM, Daniel Vetter wrote: > >> > On Tue, Apr 05, 2016 at 04:50:39PM +0800, Liu Ying wrote: > >> >> Transitional drivers might access the NULL pointer plane->state in > >> >> drm_helper_crtc_mode_set_base(), which causes NULL pointer dereference. > >> >> So, let's reset it before handing it over to those drivers. > >> >> commit e4f31ad2b713 ("drm: reset empty state in transitional helpers") > >> >> did the same thing for other transitional helpers, but it seems this one > >> >> was missed. > >> >> > >> >> Signed-off-by: Liu Ying > >> > > >> > This is kinda intentionally not done, assuming that drivers (when > >> > transitioning) can't handle the full state stuff yet. > >> > >> It's a question whether the assumption is correct or not. > >> IMHO, during the transition, the old/new state door has been > >> opened to drivers. > >> > >> > > >> > I'm not entirely opposed to this, but then we should do it for both plane > >> > and crtc states, and in all cases I think. > >> > >> It looks this doesn't hurt. > >> > >> > > >> > Completely new drivers should never use transitional helpers, but instead > >> > just bring up using native atomic helpers directly. So what exactly do > >> > you > >> > need this for? > >> > >> This is needed for my WIP imx-drm transitional plane driver. > >> It would access the fb pointer of the old plane state(the empty plane > >> state in question) to do atomic check. Also, ->atomic_update() will > >> do something like page flip if the fb pointer is not NULL(meaning > >> that the plane was enabled before the update). All of this aims to > >> make the driver behave the similar way after the transition. > > > > If you need this in your driver, just make sure you're calling ->reset > > hooks yourself as needed? Also this really is just for transitioning, in > > the end no driver should permanently end up using these functions. In the > > end transitional helpers here are meant as guidelines/crutches, every > > driver is slightly different. Adding hacks to make things work smoothly > > for all of them is impossible, and imo better to just move real fast to > > proper atomic. > > Granted my driver may call ->reset, it's more appropriate to do that > in the helper. There are several reasons for this. First, helper callers > do not bother to do this. Secondly, drm_helper_crtc_mode_set_base > is somewhat a counterpart of drm_helper_crtc_mode_set, > drm_plane_helper_update and drm_plane_helper_disable. Now that > commit e4f31ad2b713 calls ->reset in the three helpers, it looks > there is no reason this cannot be done for their counterpart. > Last but not least, exposing the NULL pointer plane->state to helper > callers is not a good behavior, even worse could be a bug. So, this > patch is not a hack but a somewhat bug fix. Hm ok, I was blind and didn't realize that we've done this partially already. Thanks for insisting, I applied your patch to drm-misc now. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
[PATCH v9 4/7] ASoC: hdmi-codec: Add audio abort() callback for video side to use
On 04/13/16 11:31, Arnaud Pouliquen wrote: > > > On 03/31/2016 03:36 PM, Jyri Sarha wrote: >> Add audio abort() callback, that is provided at audio stream start, >> for video side. This is for video side to use in case there is a >> pressing need to tear down the audio playback for some reason. >> >> Signed-off-by: Jyri Sarha >> --- >> include/sound/hdmi-codec.h| 8 ++-- >> sound/soc/codecs/hdmi-codec.c | 20 +++- >> 2 files changed, 25 insertions(+), 3 deletions(-) >> >> diff --git a/include/sound/hdmi-codec.h b/include/sound/hdmi-codec.h >> index fc3a481..15fe70f 100644 >> --- a/include/sound/hdmi-codec.h >> +++ b/include/sound/hdmi-codec.h >> @@ -55,10 +55,14 @@ struct hdmi_codec_params { >> >> struct hdmi_codec_ops { >> /* >> - * Called when ASoC starts an audio stream setup. >> + * Called when ASoC starts an audio stream setup. The call >> + * provides an audio abort callback for stoping an ongoing > stopping >> + * stream from video side driver if the HDMI audio becomes >> + * unavailable. >> * Optional >> */ >> -int (*audio_startup)(struct device *dev); >> +int (*audio_startup)(struct device *dev, >> + void (*abort_cb)(struct device *dev)); >> >> /* >> * Configures HDMI-encoder for audio stream. >> diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c >> index b46b8ed..35151a4 100644 >> --- a/sound/soc/codecs/hdmi-codec.c >> +++ b/sound/soc/codecs/hdmi-codec.c >> @@ -47,6 +47,23 @@ enum { >> DAI_ID_SPDIF, >> }; >> >> +static void hdmi_codec_abort(struct device *dev) >> +{ >> +struct hdmi_codec_priv *hcp = dev_get_drvdata(dev); >> + >> +dev_dbg(dev, "%s()\n", __func__); >> + >> +mutex_lock(&hcp->current_stream_lock); >> +if (hcp->current_stream && hcp->current_stream->runtime && >> +snd_pcm_running(hcp->current_stream)) { >> +dev_info(dev, "HDMI audio playback aborted\n"); >> +snd_pcm_stream_lock_irq(hcp->current_stream); >> +snd_pcm_stop(hcp->current_stream, SNDRV_PCM_STATE_DISCONNECTED); >> +snd_pcm_stream_unlock_irq(hcp->current_stream); >> +} >> +mutex_unlock(&hcp->current_stream_lock); >> +} >> + > still not understand the need... i can not find a use case that > justifies it. > As example, in case of HDMI plug/unplug i would not want that audio > stream is stopped (live playback). From my point of view this should be > a decision from user. > But as it is optional, I'm ok if need is justified. > Well, I think we can drop this as there is no use for it ATM. I copied this feature from my omap-hdmi-audio driver, where the display module on the SoC implements ASoC CPU-DAI itself. In that setup the DMA simply stops if the display is turned off, which eventually causes the audio stream to time out. However, it is unlikely to have a similar situation here, since the purpose is to implement ASoC codec DAI for an external HDMI encoder sitting behind i2s and/or spdif wires and the CPU-DAI can keep on playing the audio even if the whole encoder powered down. That is if the HDMI encoder does not provide the clocks for the DAI link. Anyway, we can add this feature later if there ever is a need for it. >> static int hdmi_codec_new_stream(struct snd_pcm_substream *substream, >> struct snd_soc_dai *dai) >> { >> @@ -78,7 +95,8 @@ static int hdmi_codec_startup(struct snd_pcm_substream >> *substream, >> return ret; >> >> if (hcp->hcd.ops->audio_startup) { >> -ret = hcp->hcd.ops->audio_startup(dai->dev->parent); >> +ret = hcp->hcd.ops->audio_startup(dai->dev->parent, >> + hdmi_codec_abort); >> if (ret) { >> mutex_lock(&hcp->current_stream_lock); >> hcp->current_stream = NULL; >>
[Bug 91880] Radeonsi on Grenada cards (r9 390) exceptionally unstable and poorly performing
https://bugs.freedesktop.org/show_bug.cgi?id=91880 --- Comment #96 from Jan Ziak <0xe2.0x9a.0x9b at gmail.com> --- (In reply to Alex Deucher from comment #94) > (In reply to Christoffer from comment #93) > > @Alex, is the firmware in radeon_ucode/k/ folder the same that was just > > updated in the linux-firmware git tree? > > http://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/ > > commit/?id=6e767c2b85c62fb7325fdc00f51b90f6747c13ab > > No, they are different. I do not mean to sound overly impatient, but this bug has been reported on 2015-09-04 15:00 UTC. Today it is 2016-04-14 06:15 UTC. Also, http://people.freedesktop.org/~agd5f/radeon_ucode/k/hawaii_k_smc.bin has modification date 2015-12-10 05:36. If hawaii_k_smc.bin is better than hawaii_smc.bin, then why hasn't it been uploaded to git.kernel.org firmware tree? Why is http://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/commit/radeon/hawaii_smc.bin?id=6e767c2b85c62fb7325fdc00f51b90f6747c13ab different from hawaii_k_smc.bin? Does, or doesn't, hawaii_smc.bin uploaded to git.kernel.org on 2016-03-31 01:15:57 GMT contain the fix for this freedesktop.org bug? Could the problem be that hawaii_k_smc.bin for R9 390 is incompatible with R9 290? In that case the solution would be to create grenada_smc.bin. There are too many contradictions for me to understand the situation. -- 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/20160414/5aba270f/attachment.html>
[PATCH v8 10/10] MAINTAINERS: Add maintainer for hisilicon DRM driver
On 13 April 2016 at 19:54, Emil Velikov wrote: > Hi Xinliang, > > On 11 April 2016 at 09:55, Xinliang Liu wrote: >> Add maintainer and reviewer for hisilicon DRM driver. >> >> v8: None. >> v7: None. >> v6: None. >> v5: None. >> v4: >> - Add Chen Feng as Designated reviewer. >> v3: First version. >> >> Signed-off-by: Xinliang Liu >> --- >> MAINTAINERS | 10 ++ >> 1 file changed, 10 insertions(+) >> >> diff --git a/MAINTAINERS b/MAINTAINERS >> index 61a323a6b2cf..a2ef58860689 100644 >> --- a/MAINTAINERS >> +++ b/MAINTAINERS >> @@ -3840,6 +3840,16 @@ S: Maintained >> F: drivers/gpu/drm/gma500 >> F: include/drm/gma500* >> >> +DRM DRIVERS FOR HISILICON >> +M: Xinliang Liu >> +R: Xinwei Kong >> +R: Chen Feng >> +L: dri-devel at lists.freedesktop.org >> +T: git git://github.com/xin3liang/linux.git >> +S: Maintained >> +F: drivers/gpu/drm/hisilicon >> +F: Documentation/devicetree/bindings/display/hisilicon > Nit: Can you add append '/' on these two lines. > > As mentioned in commit 144308139cdce95e9c6cff3cc0ef12242181665f > > "It's clearer to have patterns marked as directories." Sure Emil, I will fix this. Thanks to notice me this. Thanks, -xinliang > > Thanks > Emil
[PATCH v3 2/3] drm/dp/mst: Enhance DP MST debugfs output
On Mon, 11 Apr 2016, Jim Bride wrote: > Add some additional information (input vs. output port, sink associated > with VC, peer device type, max number of VCs supported) and ensure that > any embedded '\0' characters in a branch device's devid string are not > written to debugfs. > > v2: Rebase + change drm_edid_get_monitor_name() call to reflect new > signature. > > v3: Minor changes suggested by Jani + rebase. > > cc: dri-devel at lists.freedesktop.org > cc: Jani Nikula > Signed-off-by: Jim Bride Reviewed-by: Jani Nikula > --- > drivers/gpu/drm/drm_dp_mst_topology.c | 29 - > 1 file changed, 24 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c > b/drivers/gpu/drm/drm_dp_mst_topology.c > index 27fbd79..06d8b0a 100644 > --- a/drivers/gpu/drm/drm_dp_mst_topology.c > +++ b/drivers/gpu/drm/drm_dp_mst_topology.c > @@ -2729,7 +2729,7 @@ static void drm_dp_mst_dump_mstb(struct seq_file *m, > > seq_printf(m, "%smst: %p, %d\n", prefix, mstb, mstb->num_ports); > list_for_each_entry(port, &mstb->ports, next) { > - seq_printf(m, "%sport: %d: ddps: %d ldps: %d, sdp: %d/%d, %p, > conn: %p\n", prefix, port->port_num, port->ddps, port->ldps, > port->num_sdp_streams, port->num_sdp_stream_sinks, port, port->connector); > + seq_printf(m, "%sport: %d: input: %d: pdt: %d, ddps: %d ldps: > %d, sdp: %d/%d, %p, conn: %p\n", prefix, port->port_num, port->input, > port->pdt, port->ddps, port->ldps, port->num_sdp_streams, > port->num_sdp_stream_sinks, port, port->connector); > if (port->mstb) > drm_dp_mst_dump_mstb(m, port->mstb); > } > @@ -2750,6 +2750,16 @@ static bool dump_dp_payload_table(struct > drm_dp_mst_topology_mgr *mgr, > return false; > } > > +static void fetch_monitor_name(struct drm_dp_mst_topology_mgr *mgr, > +struct drm_dp_mst_port *port, char *name, > +int namelen) > +{ > + struct edid *mst_edid; > + > + mst_edid = drm_dp_mst_get_edid(port->connector, mgr, port); > + drm_edid_get_monitor_name(mst_edid, name, namelen); > +} > + > /** > * drm_dp_mst_dump_topology(): dump topology to seq file. > * @m: seq_file to dump output to > @@ -2762,6 +2772,7 @@ void drm_dp_mst_dump_topology(struct seq_file *m, > { > int i; > struct drm_dp_mst_port *port; > + > mutex_lock(&mgr->lock); > if (mgr->mst_primary) > drm_dp_mst_dump_mstb(m, mgr->mst_primary); > @@ -2770,14 +2781,21 @@ void drm_dp_mst_dump_topology(struct seq_file *m, > mutex_unlock(&mgr->lock); > > mutex_lock(&mgr->payload_lock); > - seq_printf(m, "vcpi: %lx %lx\n", mgr->payload_mask, mgr->vcpi_mask); > + seq_printf(m, "vcpi: %lx %lx %d\n", mgr->payload_mask, mgr->vcpi_mask, > + mgr->max_payloads); > > for (i = 0; i < mgr->max_payloads; i++) { > if (mgr->proposed_vcpis[i]) { > + char name[14]; > + > port = container_of(mgr->proposed_vcpis[i], struct > drm_dp_mst_port, vcpi); > - seq_printf(m, "vcpi %d: %d %d %d\n", i, port->port_num, > port->vcpi.vcpi, port->vcpi.num_slots); > + fetch_monitor_name(mgr, port, name, sizeof(name)); > + seq_printf(m, "vcpi %d: %d %d %d sink name: %s\n", i, > +port->port_num, port->vcpi.vcpi, > +port->vcpi.num_slots, > +(*name != 0) ? name : "Unknown"); > } else > - seq_printf(m, "vcpi %d:unsed\n", i); > + seq_printf(m, "vcpi %d:unused\n", i); > } > for (i = 0; i < mgr->max_payloads; i++) { > seq_printf(m, "payload %d: %d, %d, %d\n", > @@ -2817,8 +2835,9 @@ void drm_dp_mst_dump_topology(struct seq_file *m, > for (i = 0; i < 0x3; i++) > seq_printf(m, "%02x", buf[i]); > seq_printf(m, " devid: "); > - for (i = 0x3; i < 0x8; i++) > + for (i = 0x3; i < 0x8 && buf[i]; i++) > seq_printf(m, "%c", buf[i]); > + > seq_printf(m, " revision: hw: %x.%x sw: %x.%x", buf[0x9] >> 4, > buf[0x9] & 0xf, buf[0xa], buf[0xb]); > seq_printf(m, "\n"); > bret = dump_dp_payload_table(mgr, buf); -- Jani Nikula, Intel Open Source Technology Center
[PATCH v8 02/10] drm/hisilicon: Add hisilicon kirin drm master driver
Hi Emil, On 13 April 2016 at 20:15, Emil Velikov wrote: > Hi Xinliang, > > On 11 April 2016 at 09:55, Xinliang Liu wrote: > >> +static int kirin_drm_connectors_register(struct drm_device *dev) >> +{ >> + struct drm_connector *connector; >> + struct drm_connector *failed_connector; >> + int ret; >> + >> + mutex_lock(&dev->mode_config.mutex); >> + drm_for_each_connector(connector, dev) { >> + ret = drm_connector_register(connector); >> + if (ret) { >> + failed_connector = connector; >> + goto err; >> + } >> + } >> + mutex_unlock(&dev->mode_config.mutex); >> + >> + return 0; >> + >> +err: >> + drm_for_each_connector(connector, dev) { >> + if (failed_connector == connector) >> + break; >> + drm_connector_unregister(connector); >> + } >> + mutex_unlock(&dev->mode_config.mutex); >> + >> + return ret; >> +} >> + > Iirc we have new drm_connector_{un,}register_all() helpers.You might > want to use it once they are in (i.e. not sure what your base is and > if they have landed yet). I can't find these drm_connector_{un,}register_all() helpers in latest tag v4.6-rc3. > > >> +static struct device_node *kirin_get_remote_node(struct device_node *np) >> +{ >> + struct device_node *endpoint, *remote; >> + >> + /* get the first endpoint, in our case only one remote node >> +* is connected to display controller. >> +*/ >> + endpoint = of_graph_get_next_endpoint(np, NULL); >> + if (!endpoint) { >> + DRM_ERROR("no valid endpoint node\n"); >> + return ERR_PTR(-ENODEV); >> + } >> + of_node_put(endpoint); >> + >> + remote = of_graph_get_remote_port_parent(endpoint); >> + if (!remote) { >> + DRM_ERROR("no valid remote node\n"); >> + return ERR_PTR(-ENODEV); >> + } >> + of_node_put(remote); >> + >> + if (!of_device_is_available(remote)) { >> + DRM_ERROR("not available for remote node\n"); >> + return ERR_PTR(-ENODEV); >> + } >> + > This seems like a common pattern in many platform DRM drivers. Yet > some tend to differ in subtle ways - I'm leaning that they might be > bugs, but one cannot be too sure. > > A friendly request: > Can you please follow up by adding a helper and removing the > duplication thoughout ? Yes, I will create another patch set for this. I think I need to figure out other drivers requirements. Maybe, I need to add one more parameter for this helper. That's endpoint index to get which endpoint remote node. I will follow up this. Thanks, -xinliang > > Thanks > Emil
[RESEND PULL] drm: atmel-hlcdc: various improvements
Hi Dave, I've reformated the PR to use a branch name instead of a commit hash. Sorry for the inconvenience, I'll try to be more careful for my future PRs. This PR contains several improvement and cleanup patches for the atmel-hlcdc driver to be applied on drm-next (targeting 4.7). Best Regards, Boris The following changes since commit f9fd2adaacd8dc0ecbb38d96f3c62f20f0697176: Merge branch 'gma500-next' of git://github.com/patjak/drm-gma500 into drm-next (2016-04-14 13:07:12 +1000) are available in the git repository at: https://github.com/bbrezillon/linux-at91.git drm-atmel-hlcdc-devel for you to fetch changes up to ebab87ab7a130c2930b85695e01fc2944fab85c5: drm: atmel-hlcdc: route DMA accesses through AHB interfaces (2016-04-14 09:17:28 +0200) Boris Brezillon (9): drm: atmel-hlcdc: add a ->cleanup_fb() operation drm: atmel-hlcdc: support asynchronous atomic commit operations drm: atmel-hlcdc: fix connector and encoder types drm: atmel-hlcdc: remove leftovers from atomic mode setting migration drm: atmel-hlcdc: support extended timing ranges on sama5d4 and sama5d2 drm: atmel-hlcdc: move output mode selection in CRTC implementation drm: atmel-hlcdc: rework the output code to support drm bridges drm: atmel-hlcdc: check display mode validity in crtc->mode_fixup() drm: atmel-hlcdc: route DMA accesses through AHB interfaces drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 158 +- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 123 ++- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h | 15 ++ drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c | 249 ++- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 95 - 5 files changed, 481 insertions(+), 159 deletions(-)
[Intel-gfx] [PATCH v3 2/3] drm/dp/mst: Enhance DP MST debugfs output
On Thu, Apr 14, 2016 at 09:47:22AM +0300, Jani Nikula wrote: > On Mon, 11 Apr 2016, Jim Bride wrote: > > Add some additional information (input vs. output port, sink associated > > with VC, peer device type, max number of VCs supported) and ensure that > > any embedded '\0' characters in a branch device's devid string are not > > written to debugfs. > > > > v2: Rebase + change drm_edid_get_monitor_name() call to reflect new > > signature. > > > > v3: Minor changes suggested by Jani + rebase. > > > > cc: dri-devel at lists.freedesktop.org > > cc: Jani Nikula > > Signed-off-by: Jim Bride > > Reviewed-by: Jani Nikula Patch series seems a bit messed up here (I don't have a 3/3 here). Can you pls resend the entire pile, with nitpicks+reviewed-by and everything included, in a new thread? Thanks, Daniel > > > > --- > > drivers/gpu/drm/drm_dp_mst_topology.c | 29 - > > 1 file changed, 24 insertions(+), 5 deletions(-) > > > > diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c > > b/drivers/gpu/drm/drm_dp_mst_topology.c > > index 27fbd79..06d8b0a 100644 > > --- a/drivers/gpu/drm/drm_dp_mst_topology.c > > +++ b/drivers/gpu/drm/drm_dp_mst_topology.c > > @@ -2729,7 +2729,7 @@ static void drm_dp_mst_dump_mstb(struct seq_file *m, > > > > seq_printf(m, "%smst: %p, %d\n", prefix, mstb, mstb->num_ports); > > list_for_each_entry(port, &mstb->ports, next) { > > - seq_printf(m, "%sport: %d: ddps: %d ldps: %d, sdp: %d/%d, %p, > > conn: %p\n", prefix, port->port_num, port->ddps, port->ldps, > > port->num_sdp_streams, port->num_sdp_stream_sinks, port, port->connector); > > + seq_printf(m, "%sport: %d: input: %d: pdt: %d, ddps: %d ldps: > > %d, sdp: %d/%d, %p, conn: %p\n", prefix, port->port_num, port->input, > > port->pdt, port->ddps, port->ldps, port->num_sdp_streams, > > port->num_sdp_stream_sinks, port, port->connector); > > if (port->mstb) > > drm_dp_mst_dump_mstb(m, port->mstb); > > } > > @@ -2750,6 +2750,16 @@ static bool dump_dp_payload_table(struct > > drm_dp_mst_topology_mgr *mgr, > > return false; > > } > > > > +static void fetch_monitor_name(struct drm_dp_mst_topology_mgr *mgr, > > + struct drm_dp_mst_port *port, char *name, > > + int namelen) > > +{ > > + struct edid *mst_edid; > > + > > + mst_edid = drm_dp_mst_get_edid(port->connector, mgr, port); > > + drm_edid_get_monitor_name(mst_edid, name, namelen); > > +} > > + > > /** > > * drm_dp_mst_dump_topology(): dump topology to seq file. > > * @m: seq_file to dump output to > > @@ -2762,6 +2772,7 @@ void drm_dp_mst_dump_topology(struct seq_file *m, > > { > > int i; > > struct drm_dp_mst_port *port; > > + > > mutex_lock(&mgr->lock); > > if (mgr->mst_primary) > > drm_dp_mst_dump_mstb(m, mgr->mst_primary); > > @@ -2770,14 +2781,21 @@ void drm_dp_mst_dump_topology(struct seq_file *m, > > mutex_unlock(&mgr->lock); > > > > mutex_lock(&mgr->payload_lock); > > - seq_printf(m, "vcpi: %lx %lx\n", mgr->payload_mask, mgr->vcpi_mask); > > + seq_printf(m, "vcpi: %lx %lx %d\n", mgr->payload_mask, mgr->vcpi_mask, > > + mgr->max_payloads); > > > > for (i = 0; i < mgr->max_payloads; i++) { > > if (mgr->proposed_vcpis[i]) { > > + char name[14]; > > + > > port = container_of(mgr->proposed_vcpis[i], struct > > drm_dp_mst_port, vcpi); > > - seq_printf(m, "vcpi %d: %d %d %d\n", i, port->port_num, > > port->vcpi.vcpi, port->vcpi.num_slots); > > + fetch_monitor_name(mgr, port, name, sizeof(name)); > > + seq_printf(m, "vcpi %d: %d %d %d sink name: %s\n", i, > > + port->port_num, port->vcpi.vcpi, > > + port->vcpi.num_slots, > > + (*name != 0) ? name : "Unknown"); > > } else > > - seq_printf(m, "vcpi %d:unsed\n", i); > > + seq_printf(m, "vcpi %d:unused\n", i); > > } > > for (i = 0; i < mgr->max_payloads; i++) { > > seq_printf(m, "payload %d: %d, %d, %d\n", > > @@ -2817,8 +2835,9 @@ void drm_dp_mst_dump_topology(struct seq_file *m, > > for (i = 0; i < 0x3; i++) > > seq_printf(m, "%02x", buf[i]); > > seq_printf(m, " devid: "); > > - for (i = 0x3; i < 0x8; i++) > > + for (i = 0x3; i < 0x8 && buf[i]; i++) > > seq_printf(m, "%c", buf[i]); > > + > > seq_printf(m, " revision: hw: %x.%x sw: %x.%x", buf[0x9] >> 4, > > buf[0x9] & 0xf, buf[0xa], buf[0xb]); > > seq_printf(m, "\n"); > > bret = dump_dp_payload_table(mgr, buf); > > -- > Jani Nikula, Intel Open Source Technology Center > ___ > Intel-gfx mailing list > Intel-gfx at lists.freedesktop.org >
[alsa-devel] [PATCH v9 3/7] ASoC: hdmi-codec: Add hdmi-codec for external HDMI-encoders
Hi Jyri, On Thu, 2016-03-31 at 16:36 +0300, Jyri Sarha wrote: > The hdmi-codec is a platform device driver to be registered from > drivers of external HDMI encoders with I2S and/or spdif interface. The > driver in turn registers an ASoC codec for the HDMI encoder's audio > functionality. > > The structures and definitions in the API header are mostly redundant > copies of similar structures in ASoC headers. This is on purpose to > avoid direct dependencies to ASoC structures in video side driver. > > Signed-off-by: Jyri Sarha I successfully tested new version on mt8173. Acked-by: PC Liao
drm/amdgpu: start using graphics object ids from DAL.
Am 14.04.2016 um 04:56 schrieb Dave Airlie: > DAL has a concept of storing the graphics object ids in a special > small struct, and adding type safety to them. > > I'm starting to contemplate bringing some pieces of DAL into the > mainline modesetting code (like the bios parser for a start), > and I think this is the best first step in that direction. > > This series converts connectors, encoders and crtcs id to the > DAL objects. I haven't done PLLs yet they are a bit messier and > I probably need to think about them a bit more. > > Also DAL doesn't support any of the DVO/external encoders, I've no idea > if they even exist on DCE8 or newer GPUs, so I've done a separate > patch to drop them. I'm not so deep into the display engine stuff or DAL, but this looks like a good start to me to better integrate some of the DAL code into the existing code base. So the patches are Acked-by: Christian König . I will ask around about the DVO stuff. Let me know if you need anything else while Alex is still asleep. Regards, Christian. > Dave. > > ___ > dri-devel mailing list > dri-devel at lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 94917] radeonsi supports GL_ARB_shader_storage_buffer_object with 0 GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS
https://bugs.freedesktop.org/show_bug.cgi?id=94917 James Legg changed: What|Removed |Added Status|RESOLVED|VERIFIED --- Comment #4 from James Legg --- Confirmed. Thanks for the quick fix. -- 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/20160414/52a1f6b6/attachment.html>
[Bug 93144] [radeonsi] Alien: Isolation feature request
https://bugs.freedesktop.org/show_bug.cgi?id=93144 --- Comment #32 from Christoph Haag --- You can ignore my comment 27 and comment 29. For some reason with the first compute shader patchset the compute shaders would compile fine but not *really* work, at least for me - but for others they did. Now with v2 they work for me too - mostly. In some small areas there still appears to be some colorful flickering. Here's how it looks now: https://www.youtube.com/watch?v=T9eAcYthPOc Where I see some colors that I think shouldn't be there: very briefly at 2:36 and 2:38, from 2:50 ongoing the door and some short flickers on the whole room, then 3:20 the same door, and lastly from 6:20 ongoing that room. But it's no comparison to before.. -- 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/20160414/7e28d4ed/attachment.html>
[PATCH 08/10] drm: Forbid legacy MAP functions for DRIVER_MODESET
On Wed, Mar 30, 2016 at 11:39:01AM +0100, Emil Velikov wrote: > On 30 March 2016 at 10:45, Daniel Vetter wrote: > > Like in > > > > commit 0e975980d435d58df2d430d688b8c18778b42218 > > Author: Peter Antoine > > Date: Tue Jun 23 08:18:49 2015 +0100 > > > > drm: Turn off Legacy Context Functions > > > > we need to again make an exception for nouveau, but everyone else > > really doesn't need this. > > > > Cc: Peter Antoine > > Cc: Ben Skeggs > > Signed-off-by: Daniel Vetter > > --- > > drivers/gpu/drm/drm_bufs.c | 12 > > 1 file changed, 12 insertions(+) > > > > diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c > > index d92db7007f62..e8a12a4fd400 100644 > > --- a/drivers/gpu/drm/drm_bufs.c > > +++ b/drivers/gpu/drm/drm_bufs.c > > @@ -396,6 +396,10 @@ int drm_legacy_addmap_ioctl(struct drm_device *dev, > > void *data, > > if (!(capable(CAP_SYS_ADMIN) || map->type == _DRM_AGP || map->type > > == _DRM_SHM)) > > return -EPERM; > > > > + if (!drm_core_check_feature(dev, DRIVER_KMS_LEGACY_CONTEXT) && > > + drm_core_check_feature(dev, DRIVER_MODESET)) > > + return -EINVAL; > > + > Wondering if making this the first check in the function won't be > better ? We have a handful of places which preemptively check > DRIVER_MODESET prior to calling drm_legacy functions and similarly > some (last time I've looked) drm_legacy functions check for > DRIVER_MODESET. Perhaps we can move all the checking into the > drm_legacy API alone ? This is an ioctl handler, so there's not really any caller we can move this to. In general I'm split, and I just put checks like these wherever it makes sense, pulling them out into callers if there's an entire pile of them who all want the same checks. In the end I don't think it matters, as long as we dutifully combine drm_legacy_* with such checks, so that it's _really_ all dead code for modern drives. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
[PATCH] drm/vmwgfx: use *_32_bits() macros
On do, 2016-03-03 at 11:26 +0100, Paul Bolle wrote: > Use the upper_32_bits() macro instead of the four line equivalent that > triggers a GCC warning on 32 bits x86: > drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c: In function > 'vmw_cmdbuf_header_submit': > drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c:297:25: warning: right > shift count >= width of type [-Wshift-count-overflow] >val = (header->handle >> 32); > ^ > > And use the lower_32_bits() macro instead of and-ing with a 32 bits > mask. > > Signed-off-by: Paul Bolle > --- > Note: compile tested only (I don't use any of vmware's products). The warning can still be seen on v4.6-rc3 for 32 bits x86. This patch applies cleanly to that rc. Has anyone had a chance to look at this patch, and perhaps even test it? Thanks, Paul Bolle > drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c | 7 ++- > 1 file changed, 2 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c > b/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c > index 67cebb23c940..aa04fb0159a7 100644 > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c > @@ -293,13 +293,10 @@ static int vmw_cmdbuf_header_submit(struct > vmw_cmdbuf_header *header) > struct vmw_cmdbuf_man *man = header->man; > u32 val; > > - if (sizeof(header->handle) > 4) > - val = (header->handle >> 32); > - else > - val = 0; > + val = upper_32_bits(header->handle); > vmw_write(man->dev_priv, SVGA_REG_COMMAND_HIGH, val); > > - val = (header->handle & 0xULL); > + val = lower_32_bits(header->handle); > val |= header->cb_context & SVGA_CB_CONTEXT_MASK; > vmw_write(man->dev_priv, SVGA_REG_COMMAND_LOW, val); >
[Bug 116251] radeon 5a427809cd9143bef89ee3110f45e84f37484218 "drm/radeon: disable runtime pm on PX laptop" makes dGPU never stop
https://bugzilla.kernel.org/show_bug.cgi?id=116251 --- Comment #3 from Eugene Shalygin --- Created attachment 212691 --> https://bugzilla.kernel.org/attachment.cgi?id=212691&action=edit dmesg dmesg with the commit reverted -- You are receiving this mail because: You are watching the assignee of the bug.
[PATCH 2/2] drm/amdgpu: remove sorting of CS BOs
From: Christian König Not needed any more. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 23 --- 1 file changed, 23 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index 9392e50..00cf74a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c @@ -24,7 +24,6 @@ * Authors: *Jerome Glisse */ -#include #include #include #include @@ -527,16 +526,6 @@ static int amdgpu_cs_sync_rings(struct amdgpu_cs_parser *p) return 0; } -static int cmp_size_smaller_first(void *priv, struct list_head *a, - struct list_head *b) -{ - struct amdgpu_bo_list_entry *la = list_entry(a, struct amdgpu_bo_list_entry, tv.head); - struct amdgpu_bo_list_entry *lb = list_entry(b, struct amdgpu_bo_list_entry, tv.head); - - /* Sort A before B if A is smaller. */ - return (int)la->robj->tbo.num_pages - (int)lb->robj->tbo.num_pages; -} - /** * cs_parser_fini() - clean parser states * @parser:parser structure holding parsing context. @@ -553,18 +542,6 @@ static void amdgpu_cs_parser_fini(struct amdgpu_cs_parser *parser, int error, bo if (!error) { amdgpu_vm_move_pt_bos_in_lru(parser->adev, &fpriv->vm); - /* Sort the buffer list from the smallest to largest buffer, -* which affects the order of buffers in the LRU list. -* This assures that the smallest buffers are added first -* to the LRU list, so they are likely to be later evicted -* first, instead of large buffers whose eviction is more -* expensive. -* -* This slightly lowers the number of bytes moved by TTM -* per frame under memory pressure. -*/ - list_sort(NULL, &parser->validated, cmp_size_smaller_first); - ttm_eu_fence_buffer_objects(&parser->ticket, &parser->validated, parser->fence); -- 2.5.0
[PATCH 1/2] drm/amdgpu: group BOs by log2 of the size on the LRU
From: Christian König This allows us to have small BOs on the LRU before big ones. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 11 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 59 +++-- 2 files changed, 68 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index c4a21c6..7b90323 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -391,6 +391,14 @@ unsigned amdgpu_fence_count_emitted(struct amdgpu_ring *ring); /* * TTM. */ + +#define AMDGPU_TTM_LRU_SIZE20 + +struct amdgpu_mman_lru { + struct list_head*lru[TTM_NUM_MEM_TYPES]; + struct list_head*swap_lru; +}; + struct amdgpu_mman { struct ttm_bo_global_refbo_global_ref; struct drm_global_reference mem_global_ref; @@ -408,6 +416,9 @@ struct amdgpu_mman { struct amdgpu_ring *buffer_funcs_ring; /* Scheduler entity for buffer moves */ struct amd_sched_entity entity; + + /* custom LRU management */ + struct amdgpu_mman_lru log2_size[AMDGPU_TTM_LRU_SIZE]; }; 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..b58a445 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c @@ -910,6 +910,50 @@ 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); + unsigned i; + + for (i = 0; i < AMDGPU_TTM_LRU_SIZE; ++i) { + struct amdgpu_mman_lru *lru = &adev->mman.log2_size[i]; + + if (&tbo->lru == lru->lru[tbo->mem.mem_type]) + lru->lru[tbo->mem.mem_type] = tbo->lru.prev; + + if (&tbo->swap == lru->swap_lru) + lru->swap_lru = tbo->swap.prev; + } +} + +static struct amdgpu_mman_lru *amdgpu_ttm_lru(struct ttm_buffer_object *tbo) +{ + struct amdgpu_device *adev = amdgpu_get_adev(tbo->bdev); + unsigned log2_size = min(ilog2(tbo->num_pages), AMDGPU_TTM_LRU_SIZE); + + return &adev->mman.log2_size[log2_size]; +} + +static struct list_head *amdgpu_ttm_lru_tail(struct ttm_buffer_object *tbo) +{ + struct amdgpu_mman_lru *lru = amdgpu_ttm_lru(tbo); + struct list_head *res = lru->lru[tbo->mem.mem_type]; + + lru->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_mman_lru *lru = amdgpu_ttm_lru(tbo); + struct list_head *res = lru->swap_lru; + + lru->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 +967,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, j; int r; r = amdgpu_ttm_global_init(adev); @@ -946,6 +992,15 @@ int amdgpu_ttm_init(struct amdgpu_device *adev) DRM_ERROR("failed initializing buffer object driver(%d).\n", r); return r; } + + for (i = 0; i < AMDGPU_TTM_LRU_SIZE; ++i) { + struct amdgpu_mman_lru *lru = &adev->mman.log2_size[i]; + + for (j = 0; j < TTM_NUM_MEM_TYPES; ++j) + lru->lru[j] = &adev->mman.bdev.man[j].lru; + lru->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 v3 3/3] drm: bridge: anx78xx: Add anx78xx driver support.
struct anx78xx *anx78xx = bridge_to_anx78xx(bridge); > + > + mutex_lock(&anx78xx->lock); Do you really need the locking here and below? I think the DRM core already ensures that these calls are always serialized. > +static void anx78xx_bridge_mode_set(struct drm_bridge *bridge, > + struct drm_display_mode *mode, > + struct drm_display_mode *adjusted_mode) > +{ > + int err; > + struct hdmi_avi_infoframe frame; > + struct anx78xx *anx78xx = bridge_to_anx78xx(bridge); > + > + if (WARN_ON(!anx78xx->powered)) > + return; > + > + mutex_lock(&anx78xx->lock); > + > + mode = adjusted_mode; > + > + err = drm_hdmi_avi_infoframe_from_display_mode(&frame, mode); This seems like jumping through hoops. Why not simply pass adjusted_mode to the function? > +static const struct drm_bridge_funcs anx78xx_bridge_funcs = { > + .attach = anx78xx_bridge_attach, > + .mode_fixup = anx78xx_bridge_mode_fixup, > + .disable= anx78xx_bridge_disable, > + .mode_set = anx78xx_bridge_mode_set, > + .enable = anx78xx_bridge_enable, > +}; I'd leave out the tab-padding. Simple spaces will do just fine. > +static irqreturn_t anx78xx_hpd_threaded_handler(int unused, void *data) Might as well give the first parameter the proper name (irq). > +static bool anx78xx_handle_common_int_4(struct anx78xx *anx78xx, u8 irq) > +{ > + int err; > + bool event = false; > + > + DRM_DEBUG_KMS("Handle common interrupt 4: %02x\n", irq); > + > + err = regmap_write(anx78xx->map[I2C_IDX_TX_P2], > +SP_COMMON_INT_STATUS4_REG, irq); > + if (err) { > + DRM_ERROR("Failed to write SP_COMMON_INT_STATUS4 %d\n", err); > + return event; > + } > + > + if (irq & SP_HPD_LOST) { > + DRM_DEBUG_KMS("IRQ: Hot plug detect - cable is pulled out\n"); > + event = true; > + anx78xx_poweroff(anx78xx); > + } else if (irq & SP_HPD_PLUG) { > + DRM_DEBUG_KMS("IRQ: Hot plug detect - cable plug\n"); > + event = true; > + /* Free previous cached EDID if any */ > + kfree(anx78xx->edid); > + anx78xx->edid = NULL; I think you can free the EDID on unplug, since it becomes stale at that point already. The DRM core will also remove the EDID data on unplug. > +static void unregister_i2c_dummy_clients(struct anx78xx *anx78xx) > +{ > + int i; unsigned int > + > + for (i = 0; i < ARRAY_SIZE(anx78xx->i2c_dummy); i++) > + if (anx78xx->i2c_dummy[i]) > + i2c_unregister_device(anx78xx->i2c_dummy[i]); > +} > + > +static const struct regmap_config anx78xx_regmap_config = { > + .reg_bits = 8, > + .val_bits = 8, > +}; > + > +static const u16 anx78xx_chipid_list[] = { > + 0x7812, > + 0x7814, > + 0x7818, > +}; > + > +static int anx78xx_i2c_probe(struct i2c_client *client, > + const struct i2c_device_id *id) > +{ > + struct anx78xx *anx78xx; > + struct anx78xx_platform_data *pdata; > + int err, i; i should be unsigned int. > + unsigned int idl, idh, version; > + bool found = false; > + > + anx78xx = devm_kzalloc(&client->dev, sizeof(*anx78xx), GFP_KERNEL); > + if (!anx78xx) > + return -ENOMEM; > + > + pdata = &anx78xx->pdata; > + > + mutex_init(&anx78xx->lock); > + > +#if IS_ENABLED(CONFIG_OF) > + anx78xx->bridge.of_node = client->dev.of_node; > +#endif > + > + anx78xx->client = client; > + i2c_set_clientdata(client, anx78xx); > + > + err = anx78xx_init_gpio(anx78xx); > + if (err) { > + DRM_ERROR("Failed to initialize gpios\n"); > + return err; > + } > + > + pdata->hpd_irq = gpiod_to_irq(pdata->gpiod_hpd); > + if (pdata->hpd_irq < 0) { > + DRM_ERROR("Failed to get hpd irq %d\n", > + pdata->hpd_irq); > + return -ENODEV; > + } > + > + pdata->intp_irq = client->irq; > + if (!pdata->intp_irq) { > + DRM_ERROR("Failed to get CABLE_DET and INTP irq\n"); > + return -ENODEV; > + } > + > + /* Map slave addresses of ANX7814 */ > + for (i = 0; i < I2C_NUM_ADDRESSES; i++) { > + anx78xx->i2c_dummy[i] = i2c_new_dummy(client->adapter, > + anx78xx_i2c_addresses[i] >> 1); > + if (!anx78xx->i2c_dummy[i]) { > + err = -ENOMEM; > + DRM_ERROR("Failed to reserve i2c bus %02x.\n", > + anx78xx_i2c_addresses[i]); > + goto err_unregister_i2c; > + } > + > + anx78xx->map[i] = devm_regmap_init_i2c(anx78xx->i2c_dummy[i], > +&anx78xx_regmap_config); > + if (IS_ERR(anx78xx->map[i])) { > + err = PTR_ERR(anx78xx->map[i]); > + DRM_ERROR("Failed regmap initialization %02x.\n", > + anx78xx_i2c_addresses[i]); > + goto err_unregister_i2c; > + } > + } That's quite some overhead merely to use regmap... Perhaps there's room to enhance regmap-i2c to support multiple addresses for the same device? > +static int anx78xx_i2c_remove(struct i2c_client *client) > +{ > + struct anx78xx *anx78xx = i2c_get_clientdata(client); > + > + drm_bridge_remove(&anx78xx->bridge); > + > + unregister_i2c_dummy_clients(anx78xx); > + > + kfree(anx78xx->edid); > + anx78xx->edid = NULL; The memory pointed at by anx78xx will be freed a couple of instructions later, there's no need to set ->edid to NULL. Thierry -- next part -- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160414/d419807f/attachment-0001.sig>
[PATCH 08/10] drm: Forbid legacy MAP functions for DRIVER_MODESET
On 14 April 2016 at 11:06, Daniel Vetter wrote: > On Wed, Mar 30, 2016 at 11:39:01AM +0100, Emil Velikov wrote: >> On 30 March 2016 at 10:45, Daniel Vetter wrote: >> > Like in >> > >> > commit 0e975980d435d58df2d430d688b8c18778b42218 >> > Author: Peter Antoine >> > Date: Tue Jun 23 08:18:49 2015 +0100 >> > >> > drm: Turn off Legacy Context Functions >> > >> > we need to again make an exception for nouveau, but everyone else >> > really doesn't need this. >> > >> > Cc: Peter Antoine >> > Cc: Ben Skeggs >> > Signed-off-by: Daniel Vetter >> > --- >> > drivers/gpu/drm/drm_bufs.c | 12 >> > 1 file changed, 12 insertions(+) >> > >> > diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c >> > index d92db7007f62..e8a12a4fd400 100644 >> > --- a/drivers/gpu/drm/drm_bufs.c >> > +++ b/drivers/gpu/drm/drm_bufs.c >> > @@ -396,6 +396,10 @@ int drm_legacy_addmap_ioctl(struct drm_device *dev, >> > void *data, >> > if (!(capable(CAP_SYS_ADMIN) || map->type == _DRM_AGP || map->type >> > == _DRM_SHM)) >> > return -EPERM; >> > >> > + if (!drm_core_check_feature(dev, DRIVER_KMS_LEGACY_CONTEXT) && >> > + drm_core_check_feature(dev, DRIVER_MODESET)) >> > + return -EINVAL; >> > + >> Wondering if making this the first check in the function won't be >> better ? We have a handful of places which preemptively check >> DRIVER_MODESET prior to calling drm_legacy functions and similarly >> some (last time I've looked) drm_legacy functions check for >> DRIVER_MODESET. Perhaps we can move all the checking into the >> drm_legacy API alone ? > > This is an ioctl handler, so there's not really any caller we can move > this to. Indeed. One could extract the legacy ioctls into separate table and/or use a function alike drm_ioctl_permit() to generalise things. It will allow clear and obvious separation of things, although the particular above will make things a bit annoying. > In general I'm split, and I just put checks like these wherever > it makes sense, pulling them out into callers if there's an entire pile of > them who all want the same checks. > > In the end I don't think it matters, as long as we dutifully combine > drm_legacy_* with such checks, so that it's _really_ all dead code for > modern drives. I'd suspect that there's a few bits that are missing the check, plus going through might be a bit time consuming. Thus thinking of a 'generic' way to handle things. Just thinking out loud :-) -Emil
radeon_connector->audio is set by RADEON_AUDIO_DISABLE as default.
2016ë 04ì 14ì¼ 01:12ì Deucher, Alexander ì´(ê°) ì´ ê¸: >> -Original Message- >> From: Hyungwon Hwang [mailto:hyungwon.hwang7 at gmail.com] >> Sent: Wednesday, April 13, 2016 11:55 AM >> To: Deucher, Alexander; Koenig, Christian; dri-devel at lists.freedesktop.org >> Subject: radeon_connector->audio is set by RADEON_AUDIO_DISABLE as >> default. >> >> Dear all, >> >> I switched my desktop environment to GNOME wayland recently, and I >> found >> that no sound in this environment. In X desktop environment, the ioctl >> DRM_IOCTL_MODE_SETPROPERTY(I confused it with >> DRM_IOCTL_MODE_OBJ_SETPROPERTY - I deleted the log already :( ) is >> called by userspace and it makes the sound works. But in Gnome wayland >> desktop environment, the ioctl is not called. I tried to fixed it, and >> found that it is because radeon_connector->audio is set by >> RADEON_AUDIO_DISABLE. > > Thanks for spotting this. Does the attached patch fix it? > > Alex Great. Now it works with your patch. Thanks for your work. Best regards, Hyungwon Hwang > >> >> In atombios_encoders.c, atombios_get_encoder_mode() >> if (radeon_connector->audio == RADEON_AUDIO_ENABLE) >> return ATOM_ENCODER_MODE_HDMI; >> else if (drm_detect_hdmi_monitor(radeon_connector_edid(connector)) && >> (radeon_connector->audio == RADEON_AUDIO_AUTO)) >> return ATOM_ENCODER_MODE_HDMI; >> else >> return ATOM_ENCODER_MODE_DVI; >> >> This code returns ATOM_ENCODER_MODE_DVI. >> >> In atombios_encoders.c, radeon_atom_encoder_mode_set(): >> encoder_mode = atombios_get_encoder_mode(encoder); >> >> if (connector && (radeon_audio != 0) && >> >> ((encoder_mode == ATOM_ENCODER_MODE_HDMI) || >> >> ENCODER_MODE_IS_DP(encoder_mode))) >> >> radeon_audio_mode_set(encoder, adjusted_mode);b >> >> So this code bypasses the calling of radeon_audio_mode_set(). >> >> I think that radeon_connector->audio should be set by >> RADEON_AUDIO_AUTO, at least for connectors which can output audio. I >> fixed the code like below, and it works for me. But I am not familiar >> with radeon DRM driver, and can't see the big picture. Can you review >> this code? >> >> Thanks, >> Hyungwon Hwang >> >> diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c >> b/drivers/gpu/drm/radeon/radeon_connectors.c >> index cfcc099..cf52ea5 100644 >> --- a/drivers/gpu/drm/radeon/radeon_connectors.c >> +++ b/drivers/gpu/drm/radeon/radeon_connectors.c >> @@ -1975,11 +1975,12 @@ radeon_add_atom_connector(struct drm_device >> *dev, >> >> rdev->mode_info.output_csc_property, >> >> RADEON_OUTPUT_CSC_BYPASS); >> break; >> - case DRM_MODE_CONNECTOR_DVII: >> - case DRM_MODE_CONNECTOR_DVID: >> case DRM_MODE_CONNECTOR_HDMIA: >> case DRM_MODE_CONNECTOR_HDMIB: >> case DRM_MODE_CONNECTOR_DisplayPort: >> + radeon_connector->audio = RADEON_AUDIO_AUTO; >> + case DRM_MODE_CONNECTOR_DVII: >> + case DRM_MODE_CONNECTOR_DVID: >> drm_connector_init(dev, &radeon_connector->base, >>&radeon_dp_connector_funcs, >> connector_type); >> drm_connector_helper_add(&radeon_connector->base, >> @@ -2024,8 +2025,9 @@ radeon_add_atom_connector(struct drm_device >> *dev, >> 1); >> } >> break; >> - case DRM_MODE_CONNECTOR_LVDS: >> case DRM_MODE_CONNECTOR_eDP: >> + radeon_connector->audio = RADEON_AUDIO_AUTO; >> + case DRM_MODE_CONNECTOR_LVDS: >> drm_connector_init(dev, &radeon_connector->base, >> >> &radeon_lvds_bridge_connector_funcs, connector_type); >> drm_connector_helper_add(&radeon_connector->base, >> @@ -2196,6 +2198,7 @@ radeon_add_atom_connector(struct drm_device >> *dev, >> connector->doublescan_allowed = true; >> else >> connector->doublescan_allowed = false; >> + radeon_connector->audio = RADEON_AUDIO_AUTO; >> break; >> case DRM_MODE_CONNECTOR_DisplayPort: >> radeon_dig_connector = kzalloc(sizeof(struct >> radeon_connector_atom_dig), GFP_KERNEL); >> @@ -2245,6 +2248,7 @@ radeon_add_atom_connector(struct drm_device >> *dev, >> connector->interlace_allowed = true; >> /* in theory with a DP to VGA converter... */ >> connector->doublescan_allowed = false; >> + radeon_connector->audio = RADEON_AUDIO_AUTO; >> break; >> case DRM_MODE_CONNECTOR_eDP: >> radeon_dig_connector = kzalloc(sizeof(struct >> ra
[PATCH] drm/radeon: Allow setting shader registers using DMA/COPY packet3 on SI.
Signed-off-by: Bas Nieuwenhuizen --- I don't have the right hardware, so this is only compile tested. drivers/gpu/drm/radeon/radeon_drv.c | 3 ++- drivers/gpu/drm/radeon/si.c | 4 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index 1f96b04..7090d9f 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c @@ -94,9 +94,10 @@ * 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 + * 2.45.0 - Allow setting shader registers using DMA/COPY packet3 on SI */ #define KMS_DRIVER_MAJOR 2 -#define KMS_DRIVER_MINOR 44 +#define KMS_DRIVER_MINOR 45 #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); diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c index 7afe825..b30e719 100644 --- a/drivers/gpu/drm/radeon/si.c +++ b/drivers/gpu/drm/radeon/si.c @@ -4364,6 +4364,10 @@ static bool si_vm_reg_valid(u32 reg) if (reg >= 0x28000) return true; + /* shader regs are also fine */ + if (reg >= 0xB000 && reg < 0xC000) + return true; + /* check config regs */ switch (reg) { case GRBM_GFX_INDEX: -- 2.8.0
[PATCH v3 3/3] drm: bridge: anx78xx: Add anx78xx driver support.
Hi Enric, On 14 April 2016 at 14:42, Enric Balletbo i Serra wrote: > The patch was implemented first without OR'ing error codes. The reason why I > changed this is because I received the comments that checking the error on > every regmap_* didn't help the readability of the driver and is likely to > not fail if the first call doesn't fail. > > For example, originally the code was like this: > http://pastebin.com/rPgyji8k > but I changed to this > http://pastebin.com/rPgyji8k > Both links are the same ;-) But I believe we all get what you meant. Just a side note: many other drivers in DRM subsystem, inconsistently check the return value of the regmap API. Note sure how likely is any of it [regmap_foo] to fail and/or how determined people are to handle every possible error case. -Emil
[PATCH 1/2] drm/amdgpu: group BOs by log2 of the size on the LRU
On Thu, Apr 14, 2016 at 8:54 AM, Christian König wrote: > From: Christian König > > This allows us to have small BOs on the LRU before big ones. > > Signed-off-by: Christian König Have you done any benchmarking to see how much this helps when there is memory contention? For the series: Reviewed-by: Alex Deucher > --- > drivers/gpu/drm/amd/amdgpu/amdgpu.h | 11 ++ > drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 59 > +++-- > 2 files changed, 68 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h > b/drivers/gpu/drm/amd/amdgpu/amdgpu.h > index c4a21c6..7b90323 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h > @@ -391,6 +391,14 @@ unsigned amdgpu_fence_count_emitted(struct amdgpu_ring > *ring); > /* > * TTM. > */ > + > +#define AMDGPU_TTM_LRU_SIZE20 > + > +struct amdgpu_mman_lru { > + struct list_head*lru[TTM_NUM_MEM_TYPES]; > + struct list_head*swap_lru; > +}; > + > struct amdgpu_mman { > struct ttm_bo_global_refbo_global_ref; > struct drm_global_reference mem_global_ref; > @@ -408,6 +416,9 @@ struct amdgpu_mman { > struct amdgpu_ring *buffer_funcs_ring; > /* Scheduler entity for buffer moves */ > struct amd_sched_entity entity; > + > + /* custom LRU management */ > + struct amdgpu_mman_lru > log2_size[AMDGPU_TTM_LRU_SIZE]; > }; > > 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..b58a445 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c > @@ -910,6 +910,50 @@ 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); > + unsigned i; > + > + for (i = 0; i < AMDGPU_TTM_LRU_SIZE; ++i) { > + struct amdgpu_mman_lru *lru = &adev->mman.log2_size[i]; > + > + if (&tbo->lru == lru->lru[tbo->mem.mem_type]) > + lru->lru[tbo->mem.mem_type] = tbo->lru.prev; > + > + if (&tbo->swap == lru->swap_lru) > + lru->swap_lru = tbo->swap.prev; > + } > +} > + > +static struct amdgpu_mman_lru *amdgpu_ttm_lru(struct ttm_buffer_object *tbo) > +{ > + struct amdgpu_device *adev = amdgpu_get_adev(tbo->bdev); > + unsigned log2_size = min(ilog2(tbo->num_pages), AMDGPU_TTM_LRU_SIZE); > + > + return &adev->mman.log2_size[log2_size]; > +} > + > +static struct list_head *amdgpu_ttm_lru_tail(struct ttm_buffer_object *tbo) > +{ > + struct amdgpu_mman_lru *lru = amdgpu_ttm_lru(tbo); > + struct list_head *res = lru->lru[tbo->mem.mem_type]; > + > + lru->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_mman_lru *lru = amdgpu_ttm_lru(tbo); > + struct list_head *res = lru->swap_lru; > + > + lru->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 +967,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, j; > int r; > > r = amdgpu_ttm_global_init(adev); > @@ -946,6 +992,15 @@ int amdgpu_ttm_init(struct amdgpu_device *adev) > DRM_ERROR("failed initializing buffer object driver(%d).\n", > r); > return r; > } > + > + for (i = 0; i < AMDGPU_TTM_LRU_SIZE; ++i) { > + struct amdgpu_mman_lru *lru = &adev->mman.log2_size[i]; > + > + for (j = 0; j < TTM_NUM_MEM_TYPES; ++j) > + lru->lru[j] = &adev->mman.bdev.man[j].lru; > + lru->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 1/2] drm/amdgpu: group BOs by log2 of the size on the LRU
Am 14.04.2016 um 16:23 schrieb Alex Deucher: > On Thu, Apr 14, 2016 at 8:54 AM, Christian König > wrote: >> From: Christian König >> >> This allows us to have small BOs on the LRU before big ones. >> >> Signed-off-by: Christian König > Have you done any benchmarking to see how much this helps when there > is memory contention? Still working on this. Marek could you help with that? You usually have the Unigin benchmarks ready at hand. Christian. > > For the series: > Reviewed-by: Alex Deucher > >> --- >> drivers/gpu/drm/amd/amdgpu/amdgpu.h | 11 ++ >> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 59 >> +++-- >> 2 files changed, 68 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h >> b/drivers/gpu/drm/amd/amdgpu/amdgpu.h >> index c4a21c6..7b90323 100644 >> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h >> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h >> @@ -391,6 +391,14 @@ unsigned amdgpu_fence_count_emitted(struct amdgpu_ring >> *ring); >> /* >>* TTM. >>*/ >> + >> +#define AMDGPU_TTM_LRU_SIZE20 >> + >> +struct amdgpu_mman_lru { >> + struct list_head*lru[TTM_NUM_MEM_TYPES]; >> + struct list_head*swap_lru; >> +}; >> + >> struct amdgpu_mman { >> struct ttm_bo_global_refbo_global_ref; >> struct drm_global_reference mem_global_ref; >> @@ -408,6 +416,9 @@ struct amdgpu_mman { >> struct amdgpu_ring *buffer_funcs_ring; >> /* Scheduler entity for buffer moves */ >> struct amd_sched_entity entity; >> + >> + /* custom LRU management */ >> + struct amdgpu_mman_lru >> log2_size[AMDGPU_TTM_LRU_SIZE]; >> }; >> >> 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..b58a445 100644 >> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c >> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c >> @@ -910,6 +910,50 @@ 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); >> + unsigned i; >> + >> + for (i = 0; i < AMDGPU_TTM_LRU_SIZE; ++i) { >> + struct amdgpu_mman_lru *lru = &adev->mman.log2_size[i]; >> + >> + if (&tbo->lru == lru->lru[tbo->mem.mem_type]) >> + lru->lru[tbo->mem.mem_type] = tbo->lru.prev; >> + >> + if (&tbo->swap == lru->swap_lru) >> + lru->swap_lru = tbo->swap.prev; >> + } >> +} >> + >> +static struct amdgpu_mman_lru *amdgpu_ttm_lru(struct ttm_buffer_object *tbo) >> +{ >> + struct amdgpu_device *adev = amdgpu_get_adev(tbo->bdev); >> + unsigned log2_size = min(ilog2(tbo->num_pages), AMDGPU_TTM_LRU_SIZE); >> + >> + return &adev->mman.log2_size[log2_size]; >> +} >> + >> +static struct list_head *amdgpu_ttm_lru_tail(struct ttm_buffer_object *tbo) >> +{ >> + struct amdgpu_mman_lru *lru = amdgpu_ttm_lru(tbo); >> + struct list_head *res = lru->lru[tbo->mem.mem_type]; >> + >> + lru->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_mman_lru *lru = amdgpu_ttm_lru(tbo); >> + struct list_head *res = lru->swap_lru; >> + >> + lru->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 +967,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, j; >> int r; >> >> r = amdgpu_ttm_global_init(adev); >> @@ -946,6 +992,15 @@ int amdgpu_ttm_init(struct amdgpu_device *adev) >> DRM_ERROR("failed initializing buffer object >> driver(%d).\n", r); >> return r; >> } >> + >> + for (i = 0; i < AMDGPU_TTM_LRU_SIZE; ++i) { >> + struct amdgpu_mman_lru *lru = &adev->mman.log2_size[i]; >> + >> + for (j = 0; j < TTM_NUM_MEM_TYPES; ++j) >> + lru->lru[j] = &adev->mman.b
[PATCH v14 2/2] drm/bridge: Add I2C based driver for ps8640 bridge
uncs; > + ps_bridge->bridge.of_node = dev->of_node; > + ret = drm_bridge_add(&ps_bridge->bridge); Perhaps postpone the call to drm_bridge_add() until everything has been properly set up? That way you don't have to undo it again if something goes wrong in the more likely places. > + if (ret) { > + dev_err(dev, "Failed to add bridge: %d\n", ret); > + return ret; > + } > + > + ps_bridge->page[0] = client; > + ps_bridge->ddc_i2c = i2c_new_dummy(client->adapter, EDID_I2C_ADDR); > + if (!ps_bridge->ddc_i2c) { > + dev_err(dev, "failed ddc_i2c dummy device, address%02x\n", > + EDID_I2C_ADDR); > + ret = -EBUSY; > + goto exit_ddc_i2c_dummy; > + } > + /* > + * ps8640 uses multiple addresses, use dummy devices for them > + * page[0]: for DP control > + * page[1]: for VIDEO Bridge > + * page[2]: for control top > + * page[3]: for DSI Link Control1 > + * page[4]: for MIPI Phy > + * page[5]: for VPLL > + * page[6]: for DSI Link Control2 > + * page[7]: for spi rom mapping > + */ > + for (i = 1; i < 8; i++) { > + ps_bridge->page[i] = i2c_new_dummy(client->adapter, > +client->addr + i); > + if (!ps_bridge->page[i]) { > + dev_err(dev, "failed i2c dummy device, address%02x\n", > + client->addr + i); > + ret = -EBUSY; > + goto exit_dummy; > + } > + } > + i2c_set_clientdata(client, ps_bridge); > + > + ret = sysfs_create_group(&client->dev.kobj, &ps8640_attr_group); > + if (ret) { > + dev_err(dev, "failed to create sysfs entries: %d\n", ret); > + goto exit_dummy; > + } > + > + ret = devm_add_action(dev, ps8640_remove_sysfs_group, ps_bridge); > + if (ret) { > + dev_err(dev, "failed to add sysfs cleanup action: %d\n", ret); > + goto exit_remove_sysfs; > + } > + return 0; > + > +exit_remove_sysfs: > + sysfs_remove_group(&ps_bridge->page[0]->dev.kobj, &ps8640_attr_group); > +exit_dummy: > + for (i = 1; i < 8; i++) > + if (ps_bridge->page[i]) > + i2c_unregister_device(ps_bridge->page[i]); Might be better to make this into something like: while (--i) i2c_unregister_device(ps_bridge->page[i]); That way you can omit the check for valid page because you only unregister the ones you've successfully registered before. > + i2c_unregister_device(ps_bridge->ddc_i2c); > +exit_ddc_i2c_dummy: > + drm_bridge_remove(&ps_bridge->bridge); > + return ret; > +} > + > +static int ps8640_remove(struct i2c_client *client) > +{ > + struct ps8640 *ps_bridge = i2c_get_clientdata(client); > + int i; > + > + for (i = 1; i < 8; i++) > + i2c_unregister_device(ps_bridge->page[i]); > + > + i2c_unregister_device(ps_bridge->ddc_i2c); > + drm_bridge_remove(&ps_bridge->bridge); > + > + return 0; > +} The ordering here should be the reverse of that in ->probe(). > + > +static const struct i2c_device_id ps8640_i2c_table[] = { > + {"parade,ps8640", 0}, > + {}, Spaces after { and before }. Also is this really correct? I thought for I2C device IDs we didn't need a vendor prefix. Thierry -- next part -- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160414/3536b114/attachment-0001.sig>
[PATCH v3 3/3] drm: bridge: anx78xx: Add anx78xx driver support.
On Thu, Apr 14, 2016 at 04:08:43PM +0200, Enric Balletbo i Serra wrote: > Hi Emil, > > On 14/04/16 16:06, Emil Velikov wrote: > > Hi Enric, > > > > On 14 April 2016 at 14:42, Enric Balletbo i Serra > > wrote: > > > The patch was implemented first without OR'ing error codes. The reason > > > why I > > > changed this is because I received the comments that checking the error on > > > every regmap_* didn't help the readability of the driver and is likely to > > > not fail if the first call doesn't fail. > > > > > > For example, originally the code was like this: > > >http://pastebin.com/rPgyji8k > > > but I changed to this > > >http://pastebin.com/rPgyji8k > > > > > Both links are the same ;-) But I believe we all get what you meant. > > > > Ooops, sorry. This is the other link > > http://pastebin.com/e2KpGxHy I like the explicit checks better. Like I said, OR'ing the error codes makes you loose all context and likely give you many similar failures if for some reason regmap accesses always fail. Also you're code most likely is required to run in entirety for an operation to be successful. If the first part of the operation doesn't succeed it is natural to assume that the whole operation will fail, so there's no need (and a waste of time) to attempt any subsequent steps. Thierry -- next part -- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160414/aba7da40/attachment.sig>
[PATCH] drm/vmwgfx: use *_32_bits() macros
On Thu, 2016-04-14 at 13:32 +0200, Paul Bolle wrote: > On do, 2016-03-03 at 11:26 +0100, Paul Bolle wrote: > > > > Use the upper_32_bits() macro instead of the four line equivalent that > > triggers a GCC warning on 32 bits x86: > > Â Â Â Â drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c: In function > > 'vmw_cmdbuf_header_submit': > > Â Â Â Â drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c:297:25: warning: right > > shift count >= width of type [-Wshift-count-overflow] > > Â Â Â Â Â Â Â val = (header->handle >> 32); > > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ^ > > > > And use the lower_32_bits() macro instead of and-ing with a 32 bits > > mask. > > > > Signed-off-by: Paul Bolle > > --- > > Note: compile tested only (I don't use any of vmware's products). > The warning can still be seen on v4.6-rc3 for 32 bits x86. This patch > applies cleanly to that rc. > > Has anyone had a chance to look at this patch, and perhaps even test it? Test? Â Nope. Â Seems obviously correct. It might be clearer removing the temporary though: Maybe: --- Â drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c | 15 +-- Â 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c index 67cebb2..330794f 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c @@ -291,17 +291,12 @@ void vmw_cmdbuf_header_free(struct vmw_cmdbuf_header *header) Â static int vmw_cmdbuf_header_submit(struct vmw_cmdbuf_header *header) Â { Â struct vmw_cmdbuf_man *man = header->man; - u32 val; Â - if (sizeof(header->handle) > 4) - val = (header->handle >> 32); - else - val = 0; - vmw_write(man->dev_priv, SVGA_REG_COMMAND_HIGH, val); - - val = (header->handle & 0xULL); - val |= header->cb_context & SVGA_CB_CONTEXT_MASK; - vmw_write(man->dev_priv, SVGA_REG_COMMAND_LOW, val); + vmw_write(man->dev_priv, SVGA_REG_COMMAND_HIGH, + Â Â upper_32_bits(header->handle)); + vmw_write(man->dev_priv, SVGA_REG_COMMAND_LOW, + Â Â lower_32_bits(header->handle) | + Â Â (header->cb_context & SVGA_CB_CONTEXT_MASK)); Â Â return header->cb_header->status; Â }
[PATCH] include/drm: Reword debug categories comment.
From: Robert Foss The debug category comment mentions 4 categories, but more than 4 categories are listed. Let's change the wording to something a bit more generic. Signed-off-by: Robert Foss --- include/drm/drmP.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 3c8422c..5de4cff0 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -90,7 +90,7 @@ struct reservation_object; struct dma_buf_attachment; /* - * 4 debug categories are defined: + * The following categories are defined: * * CORE: Used in the generic drm code: drm_ioctl.c, drm_mm.c, drm_memory.c, ... * This is the category used by the DRM_DEBUG() macro. -- 2.5.0
[PATCH 5/7] [RFC] drm/amdgpu: drop DVO encoders support.
DVO was mainly used for crossfire pre-DCE 8, and possibly on some DCE 8 (Tonga) SKUs as well. On newer ASICs crossfire uses XDMA so there's no longer a need for DVO. It's probably safe to drop it for amdgpu. Radeon driver might still want to keep it if there's support for it. Harry On 2016-04-13 10:56 PM, Dave Airlie wrote: > From: Dave Airlie > > I'm a bit confused whether this is needed so it would be good to > confirm if hw shipped with it. > > DAL as currently is doesn't have any support for this, it doesn't > have any encoder ids for DVO that I can see. > > So before porting to DAL graphics objects, I'm removing this code, > so we can see if any regressions land here. > > Signed-off-by: Dave Airlie > --- > drivers/gpu/drm/amd/amdgpu/atombios_crtc.c | 3 - > drivers/gpu/drm/amd/amdgpu/atombios_encoders.c | 100 > - > drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 8 -- > drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 8 -- > drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 8 -- > 5 files changed, 127 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_crtc.c > b/drivers/gpu/drm/amd/amdgpu/atombios_crtc.c > index 49aa350..072a729 100644 > --- a/drivers/gpu/drm/amd/amdgpu/atombios_crtc.c > +++ b/drivers/gpu/drm/amd/amdgpu/atombios_crtc.c > @@ -344,9 +344,6 @@ static u32 amdgpu_atombios_crtc_adjust_pll(struct > drm_crtc *crtc, > } > } > > - /* DVO wants 2x pixel clock if the DVO chip is in 12 bit mode */ > - if (amdgpu_encoder->encoder_id == > ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1) > - adjusted_clock = mode->clock * 2; > if (amdgpu_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT)) > amdgpu_crtc->pll_flags |= AMDGPU_PLL_PREFER_CLOSEST_LOWER; > if (amdgpu_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) > diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c > b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c > index 4367941..7ef93c6 100644 > --- a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c > +++ b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c > @@ -272,7 +272,6 @@ bool amdgpu_atombios_encoder_is_digital(struct > drm_encoder *encoder) > { > struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); > switch (amdgpu_encoder->encoder_id) { > - case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1: > case ENCODER_OBJECT_ID_INTERNAL_UNIPHY: > case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1: > case ENCODER_OBJECT_ID_INTERNAL_UNIPHY2: > @@ -369,79 +368,8 @@ static u8 amdgpu_atombios_encoder_get_bpc(struct > drm_encoder *encoder) > } > } > > -union dvo_encoder_control { > - ENABLE_EXTERNAL_TMDS_ENCODER_PS_ALLOCATION ext_tmds; > - DVO_ENCODER_CONTROL_PS_ALLOCATION dvo; > - DVO_ENCODER_CONTROL_PS_ALLOCATION_V3 dvo_v3; > - DVO_ENCODER_CONTROL_PS_ALLOCATION_V1_4 dvo_v4; > -}; > - > -static void > -amdgpu_atombios_encoder_setup_dvo(struct drm_encoder *encoder, int action) > -{ > - struct drm_device *dev = encoder->dev; > - struct amdgpu_device *adev = dev->dev_private; > - struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); > - union dvo_encoder_control args; > - int index = GetIndexIntoMasterTable(COMMAND, DVOEncoderControl); > - uint8_t frev, crev; > - > - memset(&args, 0, sizeof(args)); > - > - if (!amdgpu_atom_parse_cmd_header(adev->mode_info.atom_context, index, > &frev, &crev)) > - return; > - > - switch (frev) { > - case 1: > - switch (crev) { > - case 1: > - /* R4xx, R5xx */ > - args.ext_tmds.sXTmdsEncoder.ucEnable = action; > - > - if (amdgpu_dig_monitor_is_duallink(encoder, > amdgpu_encoder->pixel_clock)) > - args.ext_tmds.sXTmdsEncoder.ucMisc |= > PANEL_ENCODER_MISC_DUAL; > - > - args.ext_tmds.sXTmdsEncoder.ucMisc |= > ATOM_PANEL_MISC_888RGB; > - break; > - case 2: > - /* RS600/690/740 */ > - args.dvo.sDVOEncoder.ucAction = action; > - args.dvo.sDVOEncoder.usPixelClock = > cpu_to_le16(amdgpu_encoder->pixel_clock / 10); > - /* DFP1, CRT1, TV1 depending on the type of port */ > - args.dvo.sDVOEncoder.ucDeviceType = > ATOM_DEVICE_DFP1_INDEX; > - > - if (amdgpu_dig_monitor_is_duallink(encoder, > amdgpu_encoder->pixel_clock)) > - > args.dvo.sDVOEncoder.usDevAttr.sDigAttrib.ucAttribute |= > PANEL_ENCODER_MISC_DUAL; > - break; > - case 3: > - /* R6xx */ > - args.dvo_v3.ucAction = action; > - args.dvo_v3.usPixelClock = > cpu_to_le16(amdgpu_encoder->pixel_clock / 10); > - args.dvo_v3.ucDVOConfig = 0; /* XXX */ > -
[PATCH] drm/panel: Add JDI LT070ME05000 WUXGA DSI Panel
On 4/13/2016 11:58 AM, Vinay Simha BN wrote: > Add support for the JDI lt070me05000 WUXGA DSI panel used in > Nexus 7 2013 devices. > > Programming sequence for the panel is was originally found in the > android-msm-flo-3.4-lollipop-release branch from: > https://android.googlesource.com/kernel/msm.git > > And video mode setting is from dsi-panel-jdi-dualmipi1-video.dtsi > file in: > git://codeaurora.org/kernel/msm-3.10.git LNX.LA.3.6_rb1.27 > > Other fixes folded in were provided > by Archit Taneja > > Signed-off-by: Vinay Simha BN > [sumit.semwal: Ported to the drm/panel framework] > Signed-off-by: Sumit Semwal > [jstultz: Cherry-picked to mainline, folded down other fixes > from Vinay and Archit] > Signed-off-by: John Stultz > --- > .../bindings/display/panel/jdi,lt070me05000.txt| 27 + > .../devicetree/bindings/vendor-prefixes.txt| 1 + > drivers/gpu/drm/panel/Kconfig | 11 + > drivers/gpu/drm/panel/Makefile | 1 + > drivers/gpu/drm/panel/panel-jdi-lt070me05000.c | 685 > + > 5 files changed, 725 insertions(+) > create mode 100644 > Documentation/devicetree/bindings/display/panel/jdi,lt070me05000.txt > create mode 100644 drivers/gpu/drm/panel/panel-jdi-lt070me05000.c > > diff --git > a/Documentation/devicetree/bindings/display/panel/jdi,lt070me05000.txt > b/Documentation/devicetree/bindings/display/panel/jdi,lt070me05000.txt > new file mode 100644 > index 000..35c5ac7 > --- /dev/null > +++ b/Documentation/devicetree/bindings/display/panel/jdi,lt070me05000.txt > @@ -0,0 +1,27 @@ > +JDI model LT070ME05000 1920x1200 7" DSI Panel > + > +Basic data sheet is at: > + http://panelone.net/en/7-0-inch/JDI_LT070ME05000_7.0_inch-datasheet > + > +This panel has video mode implemented currently in the driver. > + > +Required properties: > +- compatible: should be "jdi,lt070me05000" > + > +Optional properties: > +- power-supply: phandle of the regulator that provides the supply voltage > +- reset-gpio: phandle of gpio for reset line > +- backlight: phandle of the backlight device attached to the panel > + > +Example: > + > + dsi at 5430 { > + panel: panel at 0 { > + compatible = "jdi,lt070me05000"; > + reg = <0>; > + > + power-supply = <...>; > + reset-gpio = <...>; > + backlight = <...>; > + }; > + }; > diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt > b/Documentation/devicetree/bindings/vendor-prefixes.txt > index a580f3e..ec42bb4 100644 > --- a/Documentation/devicetree/bindings/vendor-prefixes.txt > +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt > @@ -130,6 +130,7 @@ invensenseInvenSense Inc. > iseeISEE 2007 S.L. > isilIntersil > issiIntegrated Silicon Solutions Inc. > +jdi Japan Display Inc. > jedec JEDEC Solid State Technology Association > karoKa-Ro electronics GmbH > keymile Keymile GmbH > diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig > index 1500ab9..f41690e 100644 > --- a/drivers/gpu/drm/panel/Kconfig > +++ b/drivers/gpu/drm/panel/Kconfig > @@ -61,6 +61,17 @@ config DRM_PANEL_SHARP_LQ101R1SX01 > To compile this driver as a module, choose M here: the module > will be called panel-sharp-lq101r1sx01. > > +config DRM_PANEL_JDI_LT070ME05000 > + tristate "JDI LT070ME05000 WUXGA DSI panel" > + depends on OF > + depends on DRM_MIPI_DSI > + depends on BACKLIGHT_CLASS_DEVICE > + help > + Say Y here if you want to enable support for JDI WUXGA DSI video/ > + command mode panel as found in Google Nexus 7 (2013) devices. > + The panel has a 1200(RGB)Ã1920 (WUXGA) resolution and uses > + 24 bit RGB per pixel. > + > config DRM_PANEL_SHARP_LS043T1LE01 > tristate "Sharp LS043T1LE01 qHD video mode panel" > depends on OF > diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile > index f277eed..e6c6fc8 100644 > --- a/drivers/gpu/drm/panel/Makefile > +++ b/drivers/gpu/drm/panel/Makefile > @@ -5,3 +5,4 @@ obj-$(CONFIG_DRM_PANEL_SAMSUNG_LD9040) += > panel-samsung-ld9040.o > obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0) += panel-samsung-s6e8aa0.o > obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += panel-sharp-lq101r1sx01.o > obj-$(CONFIG_DRM_PANEL_SHARP_LS043T1LE01) += panel-sharp-ls043t1le01.o > +obj-$(CONFIG_DRM_PANEL_JDI_LT070ME05000) += panel-jdi-lt070me05000.o > diff --git a/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c > b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c > new file mode 100644 > index 000..051aa1b > --- /dev/null > +++ b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c > @@ -0,0 +1,685 @@ > +/* > + * Copyright (C) 2015 InforceComputing > + * Author: Vinay Simha BN > + * > + * Copyright (C) 2015 Linaro Ltd > + * Author: Sumit Semwal > +
[PATCH] include/drm: Reword debug categories comment.
On Thu, Apr 14, 2016 at 10:34:16AM -0400, robert.foss at collabora.com wrote: > From: Robert Foss > > The debug category comment mentions 4 categories, but > more than 4 categories are listed. Let's change the > wording to something a bit more generic. > > Signed-off-by: Robert Foss Applied to drm-misc, thanks. -Daniel > --- > include/drm/drmP.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/drm/drmP.h b/include/drm/drmP.h > index 3c8422c..5de4cff0 100644 > --- a/include/drm/drmP.h > +++ b/include/drm/drmP.h > @@ -90,7 +90,7 @@ struct reservation_object; > struct dma_buf_attachment; > > /* > - * 4 debug categories are defined: > + * The following categories are defined: > * > * CORE: Used in the generic drm code: drm_ioctl.c, drm_mm.c, drm_memory.c, > ... > *This is the category used by the DRM_DEBUG() macro. > -- > 2.5.0 > > ___ > dri-devel mailing list > dri-devel at lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
[PATCH v3 0/7] drm/i2c: adv7511: ADV7533 support
Hi Laurent, On 3/9/2016 4:27 PM, Archit Taneja wrote: > ADV7533 is a DSI to HDMI encoder chip. It's like ADV7511, but with an > additional DSI RX block that takes in DSI video mode output. > > Trying to get this driver merged has had some challenges: > > - ADV7533 has an I2C control bus, but acts as a DSI peripheral too. >After discussions, it was concluded that we'd want to provide an >API to create MIPI DSI devices, rather than expose two different >interfaces on DT. The first version [1] tried the former approach >the second version [2] showed how the driver would look like if >exposed 2 DT nodes. This lateset patchset relies on the MIPI DSI >device creation API provided by [3], this has been accepted and >should be merged for 4.6. > > - The driver was designed as an I2C slave encoder. When ADV7533 >patches were posted [1], it was modelled as a bridge, but ADV7511 >and others were still left as I2C slave encoders. This wasn't >accepted. After discussions, it was decided that ADV7511 too would >be converted into a bridge driver, and all the users of ADV7511 >should assume it is a bridge. This bridge conversion was done in >[4]. There is still some debate over whether the bridge driver be >involved in the connector creation, or the KMS driver that has >the whole view of the display pipeline. This discussion shouldn't >affect this patch set, though. > > This patch set enables ADV7533 support with the above two issues > now resolved. It also incorporates ADV7533 specific features and fixes > that we've discovered since the first version of this patch was posted. > > Tested on ADV7533 chips on DB410c. It should work on the Hikey board too. > I'd appreaciate if someone could test it on a ADV7511 platform since I > don't have one. Could you try this patch set on the rcar-du platform? It would help to verify if this doesn't break ADV7511. Thanks, Archit > > [4] > https://lists.freedesktop.org/archives/dri-devel/2016-January/098287.html > > [3] > https://lkml.org/lkml/2016/2/12/67 > > [2] > https://lists.freedesktop.org/archives/dri-devel/2015-September/089884.html > > [1]: > https://lists.freedesktop.org/archives/dri-devel/2015-July/087088.html > > Archit Taneja (7): >drm/i2c: adv7511: Convert to drm_bridge >drm/i2c: adv7511: Fix mutex deadlock when interrupts are disabled >drm/i2c: adv7511: Initial support for ADV7533 >drm/i2c: adv7511: Create a MIPI DSI device >drm/i2c: adv7511: Use internal timing generator >drm/i2c: adv7511: Change number of DSI lanes dynamically >dt-bindings: drm/bridge: Update bindings for ADV7533 > > .../bindings/display/bridge/adi,adv7511.txt| 25 +- > drivers/gpu/drm/i2c/adv7511.c | 539 > + > 2 files changed, 476 insertions(+), 88 deletions(-) > -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
[RESEND][PATCH] drm/panel: Add JDI LT070ME05000 WUXGA DSI Panel
Add support for the JDI lt070me05000 WUXGA DSI panel used in Nexus 7 2013 devices. Programming sequence for the panel is was originally found in the android-msm-flo-3.4-lollipop-release branch from: https://android.googlesource.com/kernel/msm.git And video mode setting is from dsi-panel-jdi-dualmipi1-video.dtsi file in: git://codeaurora.org/kernel/msm-3.10.git LNX.LA.3.6_rb1.27 Other fixes folded in were provided by Archit Taneja Cc: Archit Taneja Signed-off-by: Vinay Simha BN [sumit.semwal: Ported to the drm/panel framework] Signed-off-by: Sumit Semwal [jstultz: Cherry-picked to mainline, folded down other fixes from Vinay and Archit] Signed-off-by: John Stultz Acked-by: John Stultz [vinay simha bn: added interface setting cmd mode, cmd or video mode panel setting selection in panel_init based on mode_flags] Signed-off-by: Vinay Simha BN --- .../bindings/display/panel/jdi,lt070me05000.txt| 27 + .../devicetree/bindings/vendor-prefixes.txt| 1 + drivers/gpu/drm/panel/Kconfig | 11 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-jdi-lt070me05000.c | 685 + 5 files changed, 725 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/jdi,lt070me05000.txt create mode 100644 drivers/gpu/drm/panel/panel-jdi-lt070me05000.c diff --git a/Documentation/devicetree/bindings/display/panel/jdi,lt070me05000.txt b/Documentation/devicetree/bindings/display/panel/jdi,lt070me05000.txt new file mode 100644 index 000..35c5ac7 --- /dev/null +++ b/Documentation/devicetree/bindings/display/panel/jdi,lt070me05000.txt @@ -0,0 +1,27 @@ +JDI model LT070ME05000 1920x1200 7" DSI Panel + +Basic data sheet is at: + http://panelone.net/en/7-0-inch/JDI_LT070ME05000_7.0_inch-datasheet + +This panel has video mode implemented currently in the driver. + +Required properties: +- compatible: should be "jdi,lt070me05000" + +Optional properties: +- power-supply: phandle of the regulator that provides the supply voltage +- reset-gpio: phandle of gpio for reset line +- backlight: phandle of the backlight device attached to the panel + +Example: + + dsi at 5430 { + panel: panel at 0 { + compatible = "jdi,lt070me05000"; + reg = <0>; + + power-supply = <...>; + reset-gpio = <...>; + backlight = <...>; + }; + }; diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index a580f3e..ec42bb4 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt @@ -130,6 +130,7 @@ invensense InvenSense Inc. isee ISEE 2007 S.L. isil Intersil issi Integrated Silicon Solutions Inc. +jdiJapan Display Inc. jedec JEDEC Solid State Technology Association karo Ka-Ro electronics GmbH keymileKeymile GmbH diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 1500ab9..f41690e 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -61,6 +61,17 @@ config DRM_PANEL_SHARP_LQ101R1SX01 To compile this driver as a module, choose M here: the module will be called panel-sharp-lq101r1sx01. +config DRM_PANEL_JDI_LT070ME05000 + tristate "JDI LT070ME05000 WUXGA DSI panel" + depends on OF + depends on DRM_MIPI_DSI + depends on BACKLIGHT_CLASS_DEVICE + help + Say Y here if you want to enable support for JDI WUXGA DSI video/ + command mode panel as found in Google Nexus 7 (2013) devices. + The panel has a 1200(RGB)Ã1920 (WUXGA) resolution and uses + 24 bit RGB per pixel. + config DRM_PANEL_SHARP_LS043T1LE01 tristate "Sharp LS043T1LE01 qHD video mode panel" depends on OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index f277eed..e6c6fc8 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -5,3 +5,4 @@ obj-$(CONFIG_DRM_PANEL_SAMSUNG_LD9040) += panel-samsung-ld9040.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0) += panel-samsung-s6e8aa0.o obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += panel-sharp-lq101r1sx01.o obj-$(CONFIG_DRM_PANEL_SHARP_LS043T1LE01) += panel-sharp-ls043t1le01.o +obj-$(CONFIG_DRM_PANEL_JDI_LT070ME05000) += panel-jdi-lt070me05000.o diff --git a/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c new file mode 100644 index 000..051aa1b --- /dev/null +++ b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c @@ -0,0 +1,685 @@ +/* + * Copyright (C) 2015 InforceComputing + * Author: Vinay Simha BN + * + * Copyright (C) 2015 Linaro Ltd + * Author: Sumit Semwal + * + * This program is free software; you can redistribute it and/or modify it + * under the ter
[PATCH v3 3/3] drm: bridge: anx78xx: Add anx78xx driver support.
Hi Thierry, Many thanks for answering and do this accurate report. I'd add a comment on something you (see below). Apart from this I'll add your changes and send a new version. On 14/04/16 15:10, Thierry Reding wrote: > On Fri, Apr 08, 2016 at 02:52:52PM +0200, Enric Balletbo i Serra wrote: >> Although there are other chips from the same family that can reuse this >> driver, at the moment we only tested ANX7814 chip. >> >> The ANX7814 is an ultra-low power Full-HD (1080p60) SlimPort transmitter >> designed for portable devices. This driver adds initial support for HDMI >> to DP pass-through mode. >> >> Signed-off-by: Enric Balletbo i Serra >> Tested-by: Nicolas Boichat >> Reviewed-by: Nicolas Boichat >> Cc: Emil Velikov >> Cc: Rob Herring >> Cc: Dan Carpenter >> Cc: Daniel Kurtz >> Cc: Nicolas Boichat >> --- >> Changes since v2: >> - Nicolas Boichat: >> - Get rid of wait_for macro since is only used once. >> - Do not replace the error code if it's readily available to you. >> - Add Tested-by: Nicolas Boichat >> - Add Reviewed-by: Nicolas Boichat >> >> Changes since v1: >> - Dan Carpenter: >> - Fix missing error code >> - Use meaningful names for goto exit paths >> - Rob Herring: >> - Use hpd instead cable_det as is the more standard name. >> - Daniel Kurtz: >> - Use regmap_bulk in aux_transfer >> - Fix gpio reset polarity. >> - Turn off v10 last so we mirror poweron sequence >> - Fix some error paths. >> - Remove mutex in anx78xx_detect >> - kbuild: >> - WARNING: PTR_ERR_OR_ZERO can be used >> >> drivers/gpu/drm/bridge/Kconfig |8 + >> drivers/gpu/drm/bridge/Makefile |1 + >> drivers/gpu/drm/bridge/anx78xx.c | 1403 >> ++ >> drivers/gpu/drm/bridge/anx78xx.h | 719 +++ >> 4 files changed, 2131 insertions(+) >> create mode 100644 drivers/gpu/drm/bridge/anx78xx.c >> create mode 100644 drivers/gpu/drm/bridge/anx78xx.h >> >> diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig >> index 27e2022..0f595ae 100644 >> --- a/drivers/gpu/drm/bridge/Kconfig >> +++ b/drivers/gpu/drm/bridge/Kconfig >> @@ -40,4 +40,12 @@ config DRM_PARADE_PS8622 >> ---help--- >>Parade eDP-LVDS bridge chip driver. >> >> +config DRM_ANX78XX > > The symbol name should include the vendor (DRM_ANALOGIX_ANX78XX) and the > entry needs to be ordered alphabetically (by vendor, then name). > >> +tristate "Analogix ANX78XX bridge" >> +select DRM_KMS_HELPER >> +select REGMAP_I2C >> +---help--- >> + ANX78XX is a HD video transmitter chip over micro-USB connector >> + for smartphone device. > > The commit description says the device is a FullHD video transmitter, > but here you say HD. Pick one. Preferably the correct one. > >> endmenu >> diff --git a/drivers/gpu/drm/bridge/Makefile >> b/drivers/gpu/drm/bridge/Makefile >> index f13c33d..8f0d69e 100644 >> --- a/drivers/gpu/drm/bridge/Makefile >> +++ b/drivers/gpu/drm/bridge/Makefile >> @@ -4,3 +4,4 @@ obj-$(CONFIG_DRM_DW_HDMI) += dw-hdmi.o >> obj-$(CONFIG_DRM_DW_HDMI_AHB_AUDIO) += dw-hdmi-ahb-audio.o >> obj-$(CONFIG_DRM_NXP_PTN3460) += nxp-ptn3460.o >> obj-$(CONFIG_DRM_PARADE_PS8622) += parade-ps8622.o >> +obj-$(CONFIG_DRM_ANX78XX) += anx78xx.o > > Same here, the source file should be named analogix-anx78xx.c, and this > needs to be sorted by vendor, then name as well. > >> diff --git a/drivers/gpu/drm/bridge/anx78xx.c >> b/drivers/gpu/drm/bridge/anx78xx.c > [...] >> +#include > > At least this one doesn't seem to be needed. > >> +static int anx78xx_aux_wait(struct anx78xx *anx78xx) >> +{ >> +int err; >> +unsigned int status; >> +unsigned long timeout; >> + >> +/* >> + * Does the right thing for modeset paths when run under kdgb or >> + * similar atomic contexts. Note that it's important that we check the >> + * condition again after having timed out, since the timeout could be >> + * due to preemption or similar and we've never had a chance to check >> + * the condition before the timeout. >> + */ > > I don't think this is necessary. The AUX code should never be called > from atomic context, there are various other places where we take a > mutex that would trigger warnings. > >> +err = 0; > > You can move this up to where the variable is declared. > >> +timeout = jiffies + msecs_to_jiffies(AUX_WAIT_TIMEOUT_MS) + 1; >> +while (anx78xx_aux_op_finished(anx78xx)) { >> +if (time_after(jiffies, timeout)) { >> +if (anx78xx_aux_op_finished(anx78xx)) >> +err = -ETIMEDOUT; > > Should this not be !cond? Ah, anx78xx_aux_op_finished() returns an error > code on failure. Perhaps it would be clearer if this either returned a > boolean or the name was changed to reflect the fact that it returns an > error code. _finished() sounds too much like it would return boolean. > > To make it clearer w
[PATCH v3 3/3] drm: bridge: anx78xx: Add anx78xx driver support.
Hi Emil, On 14/04/16 16:06, Emil Velikov wrote: > Hi Enric, > > On 14 April 2016 at 14:42, Enric Balletbo i Serra > wrote: >> The patch was implemented first without OR'ing error codes. The reason why I >> changed this is because I received the comments that checking the error on >> every regmap_* didn't help the readability of the driver and is likely to >> not fail if the first call doesn't fail. >> >> For example, originally the code was like this: >>http://pastebin.com/rPgyji8k >> but I changed to this >>http://pastebin.com/rPgyji8k >> > Both links are the same ;-) But I believe we all get what you meant. > Ooops, sorry. This is the other link http://pastebin.com/e2KpGxHy > Just a side note: many other drivers in DRM subsystem, inconsistently > check the return value of the regmap API. Note sure how likely is any > of it [regmap_foo] to fail and/or how determined people are to handle > every possible error case. > > -Emil > Enric
[PATCH] drm/panel: Add JDI LT070ME05000 WUXGA DSI Panel
Thierry Reding, Thanks for the review. Will address your reviews and resend the patches. On Wed, Apr 13, 2016 at 7:19 PM, Thierry Reding wrote: > On Wed, Apr 13, 2016 at 11:58:04AM +0530, Vinay Simha BN wrote: >> Add support for the JDI lt070me05000 WUXGA DSI panel used in >> Nexus 7 2013 devices. >> >> Programming sequence for the panel is was originally found in the >> android-msm-flo-3.4-lollipop-release branch from: >> https://android.googlesource.com/kernel/msm.git >> >> And video mode setting is from dsi-panel-jdi-dualmipi1-video.dtsi >> file in: >> git://codeaurora.org/kernel/msm-3.10.git LNX.LA.3.6_rb1.27 >> >> Other fixes folded in were provided >> by Archit Taneja >> >> Signed-off-by: Vinay Simha BN >> [sumit.semwal: Ported to the drm/panel framework] >> Signed-off-by: Sumit Semwal >> [jstultz: Cherry-picked to mainline, folded down other fixes >> from Vinay and Archit] >> Signed-off-by: John Stultz >> --- >> .../bindings/display/panel/jdi,lt070me05000.txt| 27 + >> .../devicetree/bindings/vendor-prefixes.txt| 1 + >> drivers/gpu/drm/panel/Kconfig | 11 + >> drivers/gpu/drm/panel/Makefile | 1 + >> drivers/gpu/drm/panel/panel-jdi-lt070me05000.c | 685 >> + >> 5 files changed, 725 insertions(+) >> create mode 100644 >> Documentation/devicetree/bindings/display/panel/jdi,lt070me05000.txt >> create mode 100644 drivers/gpu/drm/panel/panel-jdi-lt070me05000.c > > What's the difference between this and the patch you sent earlier? I'm > going to assume that the newer one is the correct patch, so I'll ignore > the previous patch. > >> diff --git >> a/Documentation/devicetree/bindings/display/panel/jdi,lt070me05000.txt >> b/Documentation/devicetree/bindings/display/panel/jdi,lt070me05000.txt >> new file mode 100644 >> index 000..35c5ac7 >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/display/panel/jdi,lt070me05000.txt > > The binding documentation should be a separate patch. > >> @@ -0,0 +1,27 @@ >> +JDI model LT070ME05000 1920x1200 7" DSI Panel >> + >> +Basic data sheet is at: >> + http://panelone.net/en/7-0-inch/JDI_LT070ME05000_7.0_inch-datasheet >> + >> +This panel has video mode implemented currently in the driver. > > That's information irrelevant to the DT binding, since you're presumably > talking about the Linux drm/panel driver, whereas the DT binding is > supposed to specify the description of the panel hardware in OS-agnostic > terms. > >> +Required properties: >> +- compatible: should be "jdi,lt070me05000" >> + >> +Optional properties: >> +- power-supply: phandle of the regulator that provides the supply voltage >> +- reset-gpio: phandle of gpio for reset line >> +- backlight: phandle of the backlight device attached to the panel >> + >> +Example: >> + >> + dsi at 5430 { >> + panel: panel at 0 { >> + compatible = "jdi,lt070me05000"; >> + reg = <0>; >> + >> + power-supply = <...>; >> + reset-gpio = <...>; >> + backlight = <...>; >> + }; >> + }; >> diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt >> b/Documentation/devicetree/bindings/vendor-prefixes.txt >> index a580f3e..ec42bb4 100644 >> --- a/Documentation/devicetree/bindings/vendor-prefixes.txt >> +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt >> @@ -130,6 +130,7 @@ invensenseInvenSense Inc. >> isee ISEE 2007 S.L. >> isil Intersil >> issi Integrated Silicon Solutions Inc. >> +jdi Japan Display Inc. >> jedecJEDEC Solid State Technology Association >> karo Ka-Ro electronics GmbH >> keymile Keymile GmbH > > This should be a separate patch as well. > >> diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig >> index 1500ab9..f41690e 100644 >> --- a/drivers/gpu/drm/panel/Kconfig >> +++ b/drivers/gpu/drm/panel/Kconfig >> @@ -61,6 +61,17 @@ config DRM_PANEL_SHARP_LQ101R1SX01 >> To compile this driver as a module, choose M here: the module >> will be called panel-sharp-lq101r1sx01. >> >> +config DRM_PANEL_JDI_LT070ME05000 >> + tristate "JDI LT070ME05000 WUXGA DSI panel" >> + depends on OF >> + depends on DRM_MIPI_DSI >> + depends on BACKLIGHT_CLASS_DEVICE >> + help >> + Say Y here if you want to enable support for JDI WUXGA DSI video/ >> + command mode panel as found in Google Nexus 7 (2013) devices. >> + The panel has a 1200(RGB)Ã1920 (WUXGA) resolution and uses >> + 24 bit RGB per pixel. >> + >> config DRM_PANEL_SHARP_LS043T1LE01 >> tristate "Sharp LS043T1LE01 qHD video mode panel" >> depends on OF > > Please keep these sorted alphabetically. I do realize that the list > isn't sorted quite correctly at the moment, so you may as well leave > this as-is and I'll fix up the order when applying and after fixing > the current ordering. > >> di
[Bug 115321] radeon runpm falsely disabled on Clevo P170EM
https://bugzilla.kernel.org/show_bug.cgi?id=115321 --- Comment #3 from Christoph Haag --- It does work for my laptop, so thanks for that. I guess if it was possible to test at runtime for it you'd have done it, so we can only hope that there are no other laptops with this problem.. -- You are receiving this mail because: You are watching the assignee of the bug.
[Bug 93144] [radeonsi] Alien: Isolation feature request
https://bugs.freedesktop.org/show_bug.cgi?id=93144 --- Comment #33 from Stepan Bakshaev --- @Christoph Haag, You wrote about patches to mesa. What is about llvm patches? Did you apply? Was it upsteam? -- 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/20160414/2348fd98/attachment.html>
[Bug 94933] [RV610] Freeze when turning on an external monitor after resume from suspend
https://bugs.freedesktop.org/show_bug.cgi?id=94933 Bug ID: 94933 Summary: [RV610] Freeze when turning on an external monitor after resume from suspend Product: DRI Version: unspecified Hardware: x86-64 (AMD64) OS: Linux (All) Status: NEW Severity: normal Priority: medium Component: DRM/Radeon Assignee: dri-devel at lists.freedesktop.org Reporter: nicolamori at aol.com I have a laptop with a Mobility Radeon HD3470 (RV610) and Plasma 5.6.2 as desktop environment. After suspending to RAM and resuming, I experience a system freeze when trying to switch to a dual monitor setup using an external monitor connected to the VGA output. The dual monitor can be turned on without problems before the suspend/resume cycle. I don't know which logs/information could be useful to diagnose the problem, so I will provide it on demand. Thanks. System details -- VGA: Mobility Radeon HD3470 (RV610) OS: ArchLinux 64 bit, kernel 4.4.7, xf86-video-ati 7.7.0 Desktop: Plasma 5.6.2 (with KF5 5.21 and Qt 5.6.0) Steps to reproduce -- - Start the system with only the laptop panel turned on - Suspend to RAM and then resume - Connect an external monitor - Enable the external monitor with xrandr or with the KCM module (System settings -> Display and Monitor -> Display configuration) -- 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/20160414/f58e5cb8/attachment-0001.html>
[PATCH 1/2] drm/amdgpu: group BOs by log2 of the size on the LRU
Am 14.04.2016 um 16:25 schrieb Christian König: > Am 14.04.2016 um 16:23 schrieb Alex Deucher: >> On Thu, Apr 14, 2016 at 8:54 AM, Christian König >> wrote: >>> From: Christian König >>> >>> This allows us to have small BOs on the LRU before big ones. >>> >>> Signed-off-by: Christian König >> Have you done any benchmarking to see how much this helps when there >> is memory contention? > > Still working on this. Marek could you help with that? You usually > have the Unigin benchmarks ready at hand. Alex please wait before you merge them. Further testing with Unigin Valey showed an interesting bug which needs to be fixed first. Christian. > > Christian. > >> >> For the series: >> Reviewed-by: Alex Deucher >> >>> --- >>> drivers/gpu/drm/amd/amdgpu/amdgpu.h | 11 ++ >>> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 59 >>> +++-- >>> 2 files changed, 68 insertions(+), 2 deletions(-) >>> >>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h >>> b/drivers/gpu/drm/amd/amdgpu/amdgpu.h >>> index c4a21c6..7b90323 100644 >>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h >>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h >>> @@ -391,6 +391,14 @@ unsigned amdgpu_fence_count_emitted(struct >>> amdgpu_ring *ring); >>> /* >>>* TTM. >>>*/ >>> + >>> +#define AMDGPU_TTM_LRU_SIZE20 >>> + >>> +struct amdgpu_mman_lru { >>> + struct list_head *lru[TTM_NUM_MEM_TYPES]; >>> + struct list_head*swap_lru; >>> +}; >>> + >>> struct amdgpu_mman { >>> struct ttm_bo_global_refbo_global_ref; >>> struct drm_global_reference mem_global_ref; >>> @@ -408,6 +416,9 @@ struct amdgpu_mman { >>> struct amdgpu_ring *buffer_funcs_ring; >>> /* Scheduler entity for buffer moves */ >>> struct amd_sched_entity entity; >>> + >>> + /* custom LRU management */ >>> + struct amdgpu_mman_lru log2_size[AMDGPU_TTM_LRU_SIZE]; >>> }; >>> >>> 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..b58a445 100644 >>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c >>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c >>> @@ -910,6 +910,50 @@ 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); >>> + unsigned i; >>> + >>> + for (i = 0; i < AMDGPU_TTM_LRU_SIZE; ++i) { >>> + struct amdgpu_mman_lru *lru = &adev->mman.log2_size[i]; >>> + >>> + if (&tbo->lru == lru->lru[tbo->mem.mem_type]) >>> + lru->lru[tbo->mem.mem_type] = tbo->lru.prev; >>> + >>> + if (&tbo->swap == lru->swap_lru) >>> + lru->swap_lru = tbo->swap.prev; >>> + } >>> +} >>> + >>> +static struct amdgpu_mman_lru *amdgpu_ttm_lru(struct >>> ttm_buffer_object *tbo) >>> +{ >>> + struct amdgpu_device *adev = amdgpu_get_adev(tbo->bdev); >>> + unsigned log2_size = min(ilog2(tbo->num_pages), >>> AMDGPU_TTM_LRU_SIZE); >>> + >>> + return &adev->mman.log2_size[log2_size]; >>> +} >>> + >>> +static struct list_head *amdgpu_ttm_lru_tail(struct >>> ttm_buffer_object *tbo) >>> +{ >>> + struct amdgpu_mman_lru *lru = amdgpu_ttm_lru(tbo); >>> + struct list_head *res = lru->lru[tbo->mem.mem_type]; >>> + >>> + lru->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_mman_lru *lru = amdgpu_ttm_lru(tbo); >>> + struct list_head *res = lru->swap_lru; >>> + >>> + lru->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 +967,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, j; >>> int r; >>> >>> r = amdgpu_ttm_global_init(adev); >>> @@ -946,6 +992,15 @@ int amdgpu_ttm_init(struct amdgpu_device *adev) >>> DRM_ERROR("failed initializing buffer object >>> driver(%d).\n", r); >>>
[Bug 94249] Topaz GPU not working correctly
https://bugs.freedesktop.org/show_bug.cgi?id=94249 --- Comment #3 from Armin K --- Ping? This is still problematic with Linux 4.5.1, xf86-video-amdgpu-1.1.0, xorg-server-1.18.3 and mesa-11.2.0. -- 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/20160414/3d662d26/attachment.html>
[Bug 116251] radeon 5a427809cd9143bef89ee3110f45e84f37484218 "drm/radeon: disable runtime pm on PX laptop" makes dGPU never stop
https://bugzilla.kernel.org/show_bug.cgi?id=116251 --- Comment #4 from Alex Deucher --- Created attachment 212711 --> https://bugzilla.kernel.org/attachment.cgi?id=212711&action=edit possible fix Please apply this patch on top of the patches from bug 115321. -- You are receiving this mail because: You are watching the assignee of the bug.
[Bug 76490] Hang during boot when DPM is on (R9 270X)
https://bugs.freedesktop.org/show_bug.cgi?id=76490 --- Comment #102 from samdenies at zhentarim.net --- I want to add another data point for a card not yet mentioned in this bug. I have had this issue for quite some time, awaiting a fix. I run a fully-updated Debian testing, and my card is described below. XFX R9 270X Vendor ID: 1002 Device ID: 6810 Subsystem Vendor ID: 1682 Subsystem Device ID: 9275 I don't believe this matches the existing quirk, and I haven't created a custom kernel to add one. Running with radeon.drm=0 allows it to boot and basically function, but with very poor 3D performance. I'd be more than happy to provide any additional diagnostic information within my abilities to collect, and test any potential fixes. -- 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/20160414/9a680bf2/attachment.html>
[PATCH v5 3/4] drm/dp_helper: Perform throw-away read before actual read in drm_dp_dpcd_read()
On Wed, Apr 13, 2016 at 10:58:32AM -0400, Lyude wrote: > This is part of a patch series to migrate all of the workarounds for > commonly seen behavior from bad sinks in intel_dp_dpcd_read_wake() to drm's > DP helper. > > Some sinks will just return garbage for the first aux tranaction they > receive when coming out of sleep mode, so we need to perform an additional > read before the actual read to workaround this. > > Changes since v5 > - If the throwaway read in drm_dp_dpcd_read() fails, return the error > from that instead of continuing. This follows the same logic we do in > drm_dp_dpcd_access() (e.g. the error from the first transaction may > differ from the errors that proceeding attempts might return). > > Signed-off-by: Lyude > --- > drivers/gpu/drm/drm_dp_helper.c | 12 > 1 file changed, 12 insertions(+) > > diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c > index 540c3e4..aa80702 100644 > --- a/drivers/gpu/drm/drm_dp_helper.c > +++ b/drivers/gpu/drm/drm_dp_helper.c > @@ -248,6 +248,18 @@ unlock: > ssize_t drm_dp_dpcd_read(struct drm_dp_aux *aux, unsigned int offset, >void *buffer, size_t size) > { > + int ret; > + > + /* > + * Sometimes we just get the same incorrect byte repeated over the > + * entire buffer. Doing one throw away read initially seems to "solve" > + * it. > + */ We might want to improve the comment a bit, now that I analyzed the problem in more detail. So perhaps something like: /* * HP ZR24w corrupts the first DPCD access after entering power save * mode. Eg. on a read, the entire buffer will be filled with the same * byte. Do a throw away read to avoid corrupting anything we care * about. Afterwards things will work correctly until the monitor * gets woken up and subsequently re-enters power save mode. * * The user pressing any button on the monitor is enough to wake it * up, so there is no particularly good place to do the workaround. * We just have to do it before any DPCD access and hope that the * monitor doesn't power down exactly after the throw away read. */ I'm thinking we should probably also do it for writes, since those seem to be affected as well. > + ret = drm_dp_dpcd_access(aux, DP_AUX_NATIVE_READ, DP_DPCD_REV, buffer, > + 1); > + if (ret != 1) > + return ret; > + > return drm_dp_dpcd_access(aux, DP_AUX_NATIVE_READ, offset, buffer, > size); > } > -- > 2.5.5 -- Ville Syrjälä Intel OTC
[Bug 76490] Hang during boot when DPM is on (R9 270X)
https://bugs.freedesktop.org/show_bug.cgi?id=76490 --- Comment #103 from Alex Deucher --- (In reply to samdenies from comment #102) > I want to add another data point for a card not yet mentioned in this bug. > I have had this issue for quite some time, awaiting a fix. I run a > fully-updated Debian testing, and my card is described below. > > XFX R9 270X > Vendor ID: 1002 > Device ID: 6810 > Subsystem Vendor ID: 1682 > Subsystem Device ID: 9275 > > I don't believe this matches the existing quirk, and I haven't created a > custom kernel to add one. Running with radeon.drm=0 allows it to boot and > basically function, but with very poor 3D performance. > > I'd be more than happy to provide any additional diagnostic information > within my abilities to collect, and test any potential fixes. Please attach the output of lspci -vnn -- 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/20160414/86501ced/attachment-0001.html>
[Bug 94933] [RV610] Freeze when turning on an external monitor after resume from suspend
https://bugs.freedesktop.org/show_bug.cgi?id=94933 --- Comment #1 from Alex Deucher --- Please attach your xorg log and dmesg output. Does the whole system freeze or just X? -- 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/20160414/bf52ef1b/attachment.html>
[RESEND][PATCH] drm/panel: Add JDI LT070ME05000 WUXGA DSI Panel
On Thu, Apr 14, 2016 at 04:17:45PM +0530, Vinay Simha BN wrote: > Add support for the JDI lt070me05000 WUXGA DSI panel used in > Nexus 7 2013 devices. > > Programming sequence for the panel is was originally found in the > android-msm-flo-3.4-lollipop-release branch from: > https://android.googlesource.com/kernel/msm.git > > And video mode setting is from dsi-panel-jdi-dualmipi1-video.dtsi > file in: > git://codeaurora.org/kernel/msm-3.10.git LNX.LA.3.6_rb1.27 > > Other fixes folded in were provided > by Archit Taneja > > Cc: Archit Taneja > Signed-off-by: Vinay Simha BN > [sumit.semwal: Ported to the drm/panel framework] > Signed-off-by: Sumit Semwal > [jstultz: Cherry-picked to mainline, folded down other fixes > from Vinay and Archit] > Signed-off-by: John Stultz > Acked-by: John Stultz > [vinay simha bn: added interface setting cmd mode, cmd or video > mode panel setting selection in panel_init based on mode_flags] > Signed-off-by: Vinay Simha BN > --- > .../bindings/display/panel/jdi,lt070me05000.txt| 27 + > .../devicetree/bindings/vendor-prefixes.txt| 1 + > drivers/gpu/drm/panel/Kconfig | 11 + > drivers/gpu/drm/panel/Makefile | 1 + > drivers/gpu/drm/panel/panel-jdi-lt070me05000.c | 685 > + > 5 files changed, 725 insertions(+) > create mode 100644 > Documentation/devicetree/bindings/display/panel/jdi,lt070me05000.txt > create mode 100644 drivers/gpu/drm/panel/panel-jdi-lt070me05000.c > > diff --git > a/Documentation/devicetree/bindings/display/panel/jdi,lt070me05000.txt > b/Documentation/devicetree/bindings/display/panel/jdi,lt070me05000.txt > new file mode 100644 > index 000..35c5ac7 > --- /dev/null > +++ b/Documentation/devicetree/bindings/display/panel/jdi,lt070me05000.txt > @@ -0,0 +1,27 @@ > +JDI model LT070ME05000 1920x1200 7" DSI Panel > + > +Basic data sheet is at: > + http://panelone.net/en/7-0-inch/JDI_LT070ME05000_7.0_inch-datasheet > + > +This panel has video mode implemented currently in the driver. As Thierry already mentioned, this has nothing to do with the binding. > + > +Required properties: > +- compatible: should be "jdi,lt070me05000" > + > +Optional properties: > +- power-supply: phandle of the regulator that provides the supply voltage > +- reset-gpio: phandle of gpio for reset line reset-gpios > +- backlight: phandle of the backlight device attached to the panel > + > +Example: > + > + dsi at 5430 { > + panel: panel at 0 { > + compatible = "jdi,lt070me05000"; > + reg = <0>; > + > + power-supply = <...>; > + reset-gpio = <...>; > + backlight = <...>; > + }; > + }; > diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt > b/Documentation/devicetree/bindings/vendor-prefixes.txt > index a580f3e..ec42bb4 100644 > --- a/Documentation/devicetree/bindings/vendor-prefixes.txt > +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt > @@ -130,6 +130,7 @@ invensenseInvenSense Inc. > isee ISEE 2007 S.L. > isil Intersil > issi Integrated Silicon Solutions Inc. > +jdi Japan Display Inc. > jedecJEDEC Solid State Technology Association > karo Ka-Ro electronics GmbH > keymile Keymile GmbH > diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig > index 1500ab9..f41690e 100644 > --- a/drivers/gpu/drm/panel/Kconfig > +++ b/drivers/gpu/drm/panel/Kconfig > @@ -61,6 +61,17 @@ config DRM_PANEL_SHARP_LQ101R1SX01 > To compile this driver as a module, choose M here: the module > will be called panel-sharp-lq101r1sx01. > > +config DRM_PANEL_JDI_LT070ME05000 > + tristate "JDI LT070ME05000 WUXGA DSI panel" > + depends on OF > + depends on DRM_MIPI_DSI > + depends on BACKLIGHT_CLASS_DEVICE > + help > + Say Y here if you want to enable support for JDI WUXGA DSI video/ > + command mode panel as found in Google Nexus 7 (2013) devices. > + The panel has a 1200(RGB)Ã1920 (WUXGA) resolution and uses > + 24 bit RGB per pixel. > + > config DRM_PANEL_SHARP_LS043T1LE01 > tristate "Sharp LS043T1LE01 qHD video mode panel" > depends on OF > diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile > index f277eed..e6c6fc8 100644 > --- a/drivers/gpu/drm/panel/Makefile > +++ b/drivers/gpu/drm/panel/Makefile > @@ -5,3 +5,4 @@ obj-$(CONFIG_DRM_PANEL_SAMSUNG_LD9040) += > panel-samsung-ld9040.o > obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0) += panel-samsung-s6e8aa0.o > obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += panel-sharp-lq101r1sx01.o > obj-$(CONFIG_DRM_PANEL_SHARP_LS043T1LE01) += panel-sharp-ls043t1le01.o > +obj-$(CONFIG_DRM_PANEL_JDI_LT070ME05000) += panel-jdi-lt070me05000.o > diff --git a/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c > b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c > new file mode
[Bug 76490] Hang during boot when DPM is on (R9 270X)
https://bugs.freedesktop.org/show_bug.cgi?id=76490 --- Comment #104 from samdenies at zhentarim.net --- Created attachment 122942 --> https://bugs.freedesktop.org/attachment.cgi?id=122942&action=edit XFX R9 270X lspci -xnn results -- 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/20160414/e650d327/attachment-0001.html>
[PATCH 01/14] drm/amdgpu: use drm_crtc_send_vblank_event()
From: Gustavo Padovan Replace the legacy drm_send_vblank_event() with the new helper function. Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c index 6de2ce53..92c5a71 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c @@ -3370,7 +3370,7 @@ static int dce_v10_0_pageflip_irq(struct amdgpu_device *adev, /* wakeup usersapce */ if (works->event) - drm_send_vblank_event(adev->ddev, crtc_id, works->event); + drm_crtc_send_vblank_event(&amdgpu_crtc->base, works->event); spin_unlock_irqrestore(&adev->ddev->event_lock, flags); diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c index e9ccc6b..2f784f2 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c @@ -3366,7 +3366,7 @@ static int dce_v11_0_pageflip_irq(struct amdgpu_device *adev, /* wakeup usersapce */ if(works->event) - drm_send_vblank_event(adev->ddev, crtc_id, works->event); + drm_crtc_send_vblank_event(&amdgpu_crtc->base, works->event); spin_unlock_irqrestore(&adev->ddev->event_lock, flags); diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c index e56b55d..9155e3b 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c @@ -3379,7 +3379,7 @@ static int dce_v8_0_pageflip_irq(struct amdgpu_device *adev, /* wakeup usersapce */ if (works->event) - drm_send_vblank_event(adev->ddev, crtc_id, works->event); + drm_crtc_send_vblank_event(&amdgpu_crtc->base, works->event); spin_unlock_irqrestore(&adev->ddev->event_lock, flags); -- 2.5.5
[PATCH 02/14] drm/armada: use drm_crtc_send_vblank_event()
From: Gustavo Padovan Replace the legacy drm_send_vblank_event() with the new helper function. Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/armada/armada_crtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/armada/armada_crtc.c b/drivers/gpu/drm/armada/armada_crtc.c index 0293eb7..b8c8cb6 100644 --- a/drivers/gpu/drm/armada/armada_crtc.c +++ b/drivers/gpu/drm/armada/armada_crtc.c @@ -260,7 +260,7 @@ static void armada_drm_crtc_complete_frame_work(struct armada_crtc *dcrtc, if (fwork->event) { spin_lock_irqsave(&dev->event_lock, flags); - drm_send_vblank_event(dev, dcrtc->num, fwork->event); + drm_crtc_send_vblank_event(&dcrtc->crtc, fwork->event); spin_unlock_irqrestore(&dev->event_lock, flags); } -- 2.5.5
[PATCH 03/14] drm/atmel: use drm_crtc_send_vblank_event()
From: Gustavo Padovan Replace the legacy drm_send_vblank_event() with the new helper function. Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c index 58c4f78..a299a71 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c @@ -279,7 +279,7 @@ static void atmel_hlcdc_crtc_finish_page_flip(struct atmel_hlcdc_crtc *crtc) spin_lock_irqsave(&dev->event_lock, flags); if (crtc->event) { - drm_send_vblank_event(dev, crtc->id, crtc->event); + drm_crtc_send_vblank_event(&crtc->base, crtc->event); drm_vblank_put(dev, crtc->id); crtc->event = NULL; } -- 2.5.5
[PATCH 04/14] drm/i915: use drm_crtc_send_vblank_event()
From: Gustavo Padovan Replace the legacy drm_send_vblank_event() with the new helper function. Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/i915/intel_display.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 29aa64b..181ee3c 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -3802,9 +3802,7 @@ static void page_flip_completed(struct intel_crtc *intel_crtc) intel_crtc->unpin_work = NULL; if (work->event) - drm_send_vblank_event(intel_crtc->base.dev, - intel_crtc->pipe, - work->event); + drm_crtc_send_vblank_event(&intel_crtc->base, work->event); drm_crtc_vblank_put(&intel_crtc->base); @@ -11699,7 +11697,7 @@ retry: if (ret == 0 && event) { spin_lock_irq(&dev->event_lock); - drm_send_vblank_event(dev, pipe, event); + drm_crtc_send_vblank_event(crtc, event); spin_unlock_irq(&dev->event_lock); } } -- 2.5.5
[PATCH 05/14] drm/msm: use drm_crtc_send_vblank_event()
From: Gustavo Padovan Replace the legacy drm_send_vblank_event() with the new helper function. Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c | 2 +- drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c index e233acf..3a48889 100644 --- a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c +++ b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c @@ -121,7 +121,7 @@ static void complete_flip(struct drm_crtc *crtc, struct drm_file *file) if (!file || (event->base.file_priv == file)) { mdp4_crtc->event = NULL; DBG("%s: send event: %p", mdp4_crtc->name, event); - drm_send_vblank_event(dev, mdp4_crtc->id, event); + drm_crtc_send_vblank_event(crtc, event); } } spin_unlock_irqrestore(&dev->event_lock, flags); diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c index 9673b95..ce779d9 100644 --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c @@ -149,7 +149,7 @@ static void complete_flip(struct drm_crtc *crtc, struct drm_file *file) if (!file || (event->base.file_priv == file)) { mdp5_crtc->event = NULL; DBG("%s: send event: %p", mdp5_crtc->name, event); - drm_send_vblank_event(dev, mdp5_crtc->id, event); + drm_crtc_send_vblank_event(crtc, event); } } spin_unlock_irqrestore(&dev->event_lock, flags); -- 2.5.5
[PATCH 06/14] drm/qxl: use drm_crtc_send_vblank_event()
From: Gustavo Padovan Replace the legacy drm_send_vblank_event() with the new helper function. Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/qxl/qxl_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index 43e5f50..75cba59 100644 --- a/drivers/gpu/drm/qxl/qxl_display.c +++ b/drivers/gpu/drm/qxl/qxl_display.c @@ -256,7 +256,7 @@ static int qxl_crtc_page_flip(struct drm_crtc *crtc, if (event) { spin_lock_irqsave(&dev->event_lock, flags); - drm_send_vblank_event(dev, qcrtc->index, event); + drm_crtc_send_vblank_event(crtc, event); spin_unlock_irqrestore(&dev->event_lock, flags); } drm_vblank_put(dev, qcrtc->index); -- 2.5.5
[PATCH 07/14] drm/nouveau: use drm_crtc_send_vblank_event()
From: Gustavo Padovan Replace the legacy drm_send_vblank_event() with the new helper function. Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/nouveau/nouveau_display.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index 7ce7fa5..973c2d9 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c @@ -841,10 +841,12 @@ nouveau_finish_page_flip(struct nouveau_channel *chan, s = list_first_entry(&fctx->flip, struct nouveau_page_flip_state, head); if (s->event) { + struct drm_crtc *crtc = drm_crtc_find(dev, s->crtc); + if (drm->device.info.family < NV_DEVICE_INFO_V0_TESLA) { drm_arm_vblank_event(dev, s->crtc, s->event); } else { - drm_send_vblank_event(dev, s->crtc, s->event); + drm_crtc_send_vblank_event(crtc, s->event); /* Give up ownership of vblank for page-flipped crtc */ drm_vblank_put(dev, s->crtc); -- 2.5.5
[PATCH 08/14] drm/radeon: use drm_crtc_send_vblank_event()
From: Gustavo Padovan Replace the legacy drm_send_vblank_event() with the new helper function. Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/radeon/radeon_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index fcc7483..d596c83 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c @@ -377,7 +377,7 @@ void radeon_crtc_handle_flip(struct radeon_device *rdev, int crtc_id) /* wakeup userspace */ if (work->event) - drm_send_vblank_event(rdev->ddev, crtc_id, work->event); + drm_crtc_send_vblank_event(&radeon_crtc->base, work->event); spin_unlock_irqrestore(&rdev->ddev->event_lock, flags); -- 2.5.5
[PATCH 09/14] drm/rcar-du: use drm_crtc_send_vblank_event()
From: Gustavo Padovan Replace the legacy drm_send_vblank_event() with the new helper function. Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c index d9f06cc..0d8bdda 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c @@ -314,7 +314,7 @@ static void rcar_du_crtc_finish_page_flip(struct rcar_du_crtc *rcrtc) return; spin_lock_irqsave(&dev->event_lock, flags); - drm_send_vblank_event(dev, rcrtc->index, event); + drm_crtc_send_vblank_event(&rcrtc->crtc, event); wake_up(&rcrtc->flip_wait); spin_unlock_irqrestore(&dev->event_lock, flags); -- 2.5.5
[PATCH 10/14] drm/shmobile: use drm_crtc_send_vblank_event()
From: Gustavo Padovan Replace the legacy drm_send_vblank_event() with the new helper function. Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/shmobile/shmob_drm_crtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/shmobile/shmob_drm_crtc.c b/drivers/gpu/drm/shmobile/shmob_drm_crtc.c index 88643ab..1e154fc 100644 --- a/drivers/gpu/drm/shmobile/shmob_drm_crtc.c +++ b/drivers/gpu/drm/shmobile/shmob_drm_crtc.c @@ -440,7 +440,7 @@ void shmob_drm_crtc_finish_page_flip(struct shmob_drm_crtc *scrtc) event = scrtc->event; scrtc->event = NULL; if (event) { - drm_send_vblank_event(dev, 0, event); + drm_crtc_send_vblank_event(&scrtc->crtc, event); drm_vblank_put(dev, 0); } spin_unlock_irqrestore(&dev->event_lock, flags); -- 2.5.5
[PATCH 11/14] drm/tilcdc: use drm_crtc_send_vblank_event()
From: Gustavo Padovan Replace the legacy drm_send_vblank_event() with the new helper function. Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c index 051e5e1..79027b1 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c @@ -707,7 +707,7 @@ irqreturn_t tilcdc_crtc_irq(struct drm_crtc *crtc) event = tilcdc_crtc->event; tilcdc_crtc->event = NULL; if (event) - drm_send_vblank_event(dev, 0, event); + drm_crtc_send_vblank_event(crtc, event); spin_unlock_irqrestore(&dev->event_lock, flags); } -- 2.5.5
[PATCH 12/14] drm/udl: use drm_crtc_send_vblank_event()
From: Gustavo Padovan Replace the legacy drm_send_vblank_event() with the new helper function. Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/udl/udl_modeset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/udl/udl_modeset.c b/drivers/gpu/drm/udl/udl_modeset.c index b87afee..f92ea95 100644 --- a/drivers/gpu/drm/udl/udl_modeset.c +++ b/drivers/gpu/drm/udl/udl_modeset.c @@ -376,7 +376,7 @@ static int udl_crtc_page_flip(struct drm_crtc *crtc, spin_lock_irqsave(&dev->event_lock, flags); if (event) - drm_send_vblank_event(dev, 0, event); + drm_crtc_send_vblank_event(crtc, event); spin_unlock_irqrestore(&dev->event_lock, flags); crtc->primary->fb = fb; -- 2.5.5
[PATCH 13/14] drm/virtio: use drm_crtc_send_vblank_event()
From: Gustavo Padovan Replace the legacy drm_send_vblank_event() with the new helper function. Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/virtio/virtgpu_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c index 4854dac..66be450 100644 --- a/drivers/gpu/drm/virtio/virtgpu_display.c +++ b/drivers/gpu/drm/virtio/virtgpu_display.c @@ -163,7 +163,7 @@ static int virtio_gpu_page_flip(struct drm_crtc *crtc, if (event) { spin_lock_irqsave(&crtc->dev->event_lock, irqflags); - drm_send_vblank_event(crtc->dev, -1, event); + drm_crtc_send_vblank_event(crtc, event); spin_unlock_irqrestore(&crtc->dev->event_lock, irqflags); } -- 2.5.5
[PATCH 14/14] drm: remove legacy drm_send_vblank_event()
From: Gustavo Padovan We don't have any user of this function anymore, let's remove it. Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/drm_irq.c | 31 ++- include/drm/drmP.h| 2 -- 2 files changed, 6 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index 3c1a6f1..c0205ed 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c @@ -1100,21 +1100,19 @@ void drm_crtc_arm_vblank_event(struct drm_crtc *crtc, EXPORT_SYMBOL(drm_crtc_arm_vblank_event); /** - * drm_send_vblank_event - helper to send vblank event after pageflip - * @dev: DRM device - * @pipe: CRTC index + * drm_crtc_send_vblank_event - helper to send vblank event after pageflip + * @crtc: the source CRTC of the vblank event * @e: the event to send * * Updates sequence # and timestamp on event, and sends it to userspace. * Caller must hold event lock. - * - * This is the legacy version of drm_crtc_send_vblank_event(). */ -void drm_send_vblank_event(struct drm_device *dev, unsigned int pipe, - struct drm_pending_vblank_event *e) +void drm_crtc_send_vblank_event(struct drm_crtc *crtc, + struct drm_pending_vblank_event *e) { + struct drm_device *dev = crtc->dev; + unsigned int seq, pipe = drm_crtc_index(crtc); struct timeval now; - unsigned int seq; if (dev->num_crtcs > 0) { seq = drm_vblank_count_and_time(dev, pipe, &now); @@ -1126,23 +1124,6 @@ void drm_send_vblank_event(struct drm_device *dev, unsigned int pipe, e->pipe = pipe; send_vblank_event(dev, e, seq, &now); } -EXPORT_SYMBOL(drm_send_vblank_event); - -/** - * drm_crtc_send_vblank_event - helper to send vblank event after pageflip - * @crtc: the source CRTC of the vblank event - * @e: the event to send - * - * Updates sequence # and timestamp on event, and sends it to userspace. - * Caller must hold event lock. - * - * This is the native KMS version of drm_send_vblank_event(). - */ -void drm_crtc_send_vblank_event(struct drm_crtc *crtc, - struct drm_pending_vblank_event *e) -{ - drm_send_vblank_event(crtc->dev, drm_crtc_index(crtc), e); -} EXPORT_SYMBOL(drm_crtc_send_vblank_event); /** diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 3c8422c..d0e1332 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -970,8 +970,6 @@ extern u32 drm_vblank_count_and_time(struct drm_device *dev, unsigned int pipe, struct timeval *vblanktime); extern u32 drm_crtc_vblank_count_and_time(struct drm_crtc *crtc, struct timeval *vblanktime); -extern void drm_send_vblank_event(struct drm_device *dev, unsigned int pipe, - struct drm_pending_vblank_event *e); extern void drm_crtc_send_vblank_event(struct drm_crtc *crtc, struct drm_pending_vblank_event *e); extern void drm_arm_vblank_event(struct drm_device *dev, unsigned int pipe, -- 2.5.5
[PATCH RESEND] drm/virtio: send vblank event after crtc updates
From: Gustavo Padovan virtio_gpu was failing to send vblank events when using the atomic IOCTL with the DRM_MODE_PAGE_FLIP_EVENT flag set. This patch fixes each and enables atomic pageflips updates. Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/virtio/virtgpu_display.c | 12 1 file changed, 12 insertions(+) diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c index 4854dac..5fd1fd0 100644 --- a/drivers/gpu/drm/virtio/virtgpu_display.c +++ b/drivers/gpu/drm/virtio/virtgpu_display.c @@ -267,11 +267,23 @@ static int virtio_gpu_crtc_atomic_check(struct drm_crtc *crtc, return 0; } +static void virtio_gpu_crtc_atomic_flush(struct drm_crtc *crtc, +struct drm_crtc_state *old_state) +{ + unsigned long flags; + + spin_lock_irqsave(&crtc->dev->event_lock, flags); + if (crtc->state->event) + drm_crtc_send_vblank_event(crtc, crtc->state->event); + spin_unlock_irqrestore(&crtc->dev->event_lock, flags); +} + static const struct drm_crtc_helper_funcs virtio_gpu_crtc_helper_funcs = { .enable= virtio_gpu_crtc_enable, .disable = virtio_gpu_crtc_disable, .mode_set_nofb = virtio_gpu_crtc_mode_set_nofb, .atomic_check = virtio_gpu_crtc_atomic_check, + .atomic_flush = virtio_gpu_crtc_atomic_flush, }; static void virtio_gpu_enc_mode_set(struct drm_encoder *encoder, -- 2.5.5
[PATCH] drm/i915/vlv: Enable/disable VGA hotplugging properly
On Tue, Mar 29, 2016 at 04:46:30PM -0400, Lyude wrote: > On Valleyview, VGA hotplugging is controlled through a seperate register > than everything else, VLV_ADPA, which must be explicitly set. > > While VGA hotplugging worked(ish) before, it looks like that was mainly > because we'd unintentionally enable it in > valleyview_crt_detect_hotplug() when we did a force trigger. This > doesn't work reliably enough because whenever the display powerwell on > vlv gets disabled, the values set in VLV_ADPA get cleared and > consequently VGA hotplugging gets disabled. This causes bugs such as one > we found on an Intel NUC, where doing the following sequence of > hotplugs: > > - Disconnect all monitors > - Connect VGA > - Disconnect VGA > - Connect HDMI > > Would result in hotplugging getting disabled, due to the display > powerwells getting toggled in the process of connecting HDMI. > > CC: stable at vger.kernel.org > Signed-off-by: Lyude > --- > drivers/gpu/drm/i915/i915_irq.c | 14 ++ > 1 file changed, 14 insertions(+) > > diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c > index 5aa4239..60592a4 100644 > --- a/drivers/gpu/drm/i915/i915_irq.c > +++ b/drivers/gpu/drm/i915/i915_irq.c > @@ -3611,6 +3611,7 @@ static void valleyview_display_irqs_install(struct > drm_i915_private *dev_priv) > { > u32 pipestat_mask; > u32 iir_mask; > + u32 adpa_reg; > enum pipe pipe; > > pipestat_mask = PIPESTAT_INT_STATUS_MASK | > @@ -3627,6 +3628,12 @@ static void valleyview_display_irqs_install(struct > drm_i915_private *dev_priv) > for_each_pipe(dev_priv, pipe) > i915_enable_pipestat(dev_priv, pipe, pipestat_mask); > > + if (IS_VALLEYVIEW(dev_priv)) { > + adpa_reg = I915_READ(VLV_ADPA); > + adpa_reg |= ADPA_CRT_HOTPLUG_ENABLE; > + I915_WRITE(VLV_ADPA, adpa_reg); > + } We might not want to enable that when there's no VGA connector. Seems like we should just be calling intel_crt_reset() here. We definitely don't want to call the reset for hooks for all the other connectors so drm_mode_config_reset() is out. Also the connector locking might be problematic here, so I might suggest adjusting intel_crt_reset() to take an encoder instead of connector, and then we should be able to walk the encoder list without any troubles. > + > iir_mask = I915_DISPLAY_PORT_INTERRUPT | > I915_DISPLAY_PIPE_A_EVENT_INTERRUPT | > I915_DISPLAY_PIPE_B_EVENT_INTERRUPT; > @@ -3645,8 +3652,15 @@ static void valleyview_display_irqs_uninstall(struct > drm_i915_private *dev_priv) > { > u32 pipestat_mask; > u32 iir_mask; > + u32 adpa_reg; > enum pipe pipe; > > + if (IS_VALLEYVIEW(dev_priv)) { > + adpa_reg = I915_READ(VLV_ADPA); > + adpa_reg &= ~ADPA_CRT_HOTPLUG_ENABLE; > + I915_WRITE(VLV_ADPA, adpa_reg); > + } > + > iir_mask = I915_DISPLAY_PORT_INTERRUPT | > I915_DISPLAY_PIPE_A_EVENT_INTERRUPT | > I915_DISPLAY_PIPE_B_EVENT_INTERRUPT; > -- > 2.5.5 > > ___ > dri-devel mailing list > dri-devel at lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Ville Syrjälä Intel OTC
[PATCH v10 3/3] staging/android: refactor SYNC IOCTLs
Hi Greg, Any comment on this? Thanks, Gustavo 2016-03-18 Gustavo Padovan : > From: Gustavo Padovan > > Change SYNC_IOC_FILE_INFO (former SYNC_IOC_FENCE_INFO) behaviour to avoid > future API breaks and optimize buffer allocation. > > Now num_fences can be filled by the caller to inform how many fences it > wants to retrieve from the kernel. If the num_fences passed is greater > than zero info->sync_fence_info should point to a buffer with enough space > to fit all fences. > > However if num_fences passed to the kernel is 0, the kernel will reply > with number of fences of the sync_file. > > Sending first an ioctl with num_fences = 0 can optimize buffer allocation, > in a first call with num_fences = 0 userspace will receive the actual > number of fences in the num_fences filed. > > Then it can allocate a buffer with the correct size on sync_fence_info and > call SYNC_IOC_FILE_INFO again, but now with the actual value of num_fences > in the sync_file. > > info->sync_fence_info was converted to __u64 pointer to prevent 32bit > compatibility issues. And a flags member was added. > > An example userspace code for the later would be: > > struct sync_file_info *info; > int err, size, num_fences; > > info = malloc(sizeof(*info)); > > info.flags = 0; > err = ioctl(fd, SYNC_IOC_FILE_INFO, info); > num_fences = info->num_fences; > > if (num_fences) { > info.flags = 0; > size = sizeof(struct sync_fence_info) * num_fences; > info->num_fences = num_fences; > info->sync_fence_info = (uint64_t) calloc(num_fences, > sizeof(struct > sync_fence_info)); > > err = ioctl(fd, SYNC_IOC_FILE_INFO, info); > } > > Finally the IOCTLs numbers were changed to avoid any potential old > userspace running the old API to get weird errors. Changing the opcodes > will make them fail right away. This is just a precaution, there no > upstream users of these interfaces yet and the only user is Android, but > we don't expect anyone trying to run android userspace and all it > dependencies on top of upstream kernels. > > Signed-off-by: Gustavo Padovan > Reviewed-by: Maarten Lankhorst > Acked-by: Greg Hackmann > Acked-by: Rob Clark > Acked-by: Daniel Vetter > > --- > v2: fix fence_info memory leak > > v3: Comments from Emil Velikov > - improve commit message > - remove __u64 cast > - remove check for output fields in file_info > - clean up sync_fill_fence_info() > > Comments from Maarten Lankhorst > - remove in.num_fences && !in.sync_fence_info check > - remove info->len and use only num_fences to calculate size > > Comments from Dan Carpenter > - fix info->sync_fence_info documentation > > v4: remove allocated struct sync_file_info (comment from Maarten) > > v5: merge all commits that were changing the ABI > > v6: fix -Wint-to-pointer-cast error on info.sync_fence_info > --- > drivers/staging/android/sync.c | 76 > - > drivers/staging/android/uapi/sync.h | 36 +- > 2 files changed, 67 insertions(+), 45 deletions(-) > > diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c > index 3a8f210..f9c6094 100644 > --- a/drivers/staging/android/sync.c > +++ b/drivers/staging/android/sync.c > @@ -445,6 +445,11 @@ static long sync_file_ioctl_merge(struct sync_file > *sync_file, > goto err_put_fd; > } > > + if (data.flags || data.pad) { > + err = -EINVAL; > + goto err_put_fd; > + } > + > fence2 = sync_file_fdget(data.fd2); > if (!fence2) { > err = -ENOENT; > @@ -479,13 +484,9 @@ err_put_fd: > return err; > } > > -static int sync_fill_fence_info(struct fence *fence, void *data, int size) > +static void sync_fill_fence_info(struct fence *fence, > + struct sync_fence_info *info) > { > - struct sync_fence_info *info = data; > - > - if (size < sizeof(*info)) > - return -ENOMEM; > - > strlcpy(info->obj_name, fence->ops->get_timeline_name(fence), > sizeof(info->obj_name)); > strlcpy(info->driver_name, fence->ops->get_driver_name(fence), > @@ -495,58 +496,63 @@ static int sync_fill_fence_info(struct fence *fence, > void *data, int size) > else > info->status = 0; > info->timestamp_ns = ktime_to_ns(fence->timestamp); > - > - return sizeof(*info); > } > > static long sync_file_ioctl_fence_info(struct sync_file *sync_file, > unsigned long arg) > { > - struct sync_file_info *info; > + struct sync_file_info info; > + struct sync_fence_info *fence_info = NULL; > __u32 size; > - __u32 len = 0; > int ret, i; > > - if (copy_from_user(&size, (void __user *)arg, sizeof(size)))
[Bug 93144] [radeonsi] Alien: Isolation feature request
https://bugs.freedesktop.org/show_bug.cgi?id=93144 --- Comment #34 from Christoph Haag --- (In reply to Stepan Bakshaev from comment #33) > @Christoph Haag, > > You wrote about patches to mesa. What is about llvm patches? Did you apply? > Was it upsteam? This one is upstream I assume: http://reviews.llvm.org/D18559 So I only applied the diff from http://reviews.llvm.org/D18340 to llvm-svn 266255. -- 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/20160414/f21eb6c8/attachment.html>
[Bug 76490] Hang during boot when DPM is on (R9 270X)
https://bugs.freedesktop.org/show_bug.cgi?id=76490 --- Comment #105 from Alex Deucher --- Created attachment 122946 --> https://bugs.freedesktop.org/attachment.cgi?id=122946&action=edit possible fix (In reply to samdenies from comment #102) > I want to add another data point for a card not yet mentioned in this bug. > I have had this issue for quite some time, awaiting a fix. I run a > fully-updated Debian testing, and my card is described below. > > XFX R9 270X > Vendor ID: 1002 > Device ID: 6810 > Subsystem Vendor ID: 1682 > Subsystem Device ID: 9275 > > I don't believe this matches the existing quirk, and I haven't created a > custom kernel to add one. Running with radeon.drm=0 allows it to boot and > basically function, but with very poor 3D performance. > > I'd be more than happy to provide any additional diagnostic information > within my abilities to collect, and test any potential fixes. Does this attached patch help? -- 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/20160414/f04f434e/attachment.html>
[GIT PULL] drm-vc4-next-2016-04-14
The following changes since commit f55532a0c0b8bb6148f4e07853b876ef73bc69ca: Linux 4.6-rc1 (2016-03-26 16:03:24 -0700) are available in the git repository at: https://github.com/anholt/linux tags/drm-vc4-next-2016-04-14 for you to fetch changes up to 5883980313af70aec0ceebaef6ef0709726e5e63: drm/vc4: Fix NULL deref in HDMI init error path (2016-04-14 12:23:11 -0700) This pull request brings in the DPI panel support for vc4, plus a minor bugfix found during Pi3 development. Eric Anholt (3): drm: Add an encoder and connector type enum for DPI. drm/vc4: Add DPI driver drm/vc4: Fix NULL deref in HDMI init error path .../devicetree/bindings/display/brcm,bcm-vc4.txt | 36 ++ drivers/gpu/drm/drm_crtc.c | 2 + drivers/gpu/drm/vc4/Kconfig| 1 + drivers/gpu/drm/vc4/Makefile | 1 + drivers/gpu/drm/vc4/vc4_debugfs.c | 1 + drivers/gpu/drm/vc4/vc4_dpi.c | 520 + drivers/gpu/drm/vc4/vc4_drv.c | 1 + drivers/gpu/drm/vc4/vc4_drv.h | 5 + drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +- include/uapi/drm/drm_mode.h| 2 + 10 files changed, 570 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/vc4/vc4_dpi.c
[Bug 94726] [Tonga] ARK: Survival Evolved crashes on savegame load. Out of Memory
https://bugs.freedesktop.org/show_bug.cgi?id=94726 --- Comment #7 from thomas.rinsch at arcor.de --- (In reply to Nicolai H�hnle from comment #6) Thanks a lot Nicolai, I applied the patch and unfortunately all that has changed is that ARK needs longer to crash now. In addition it tends to freeze the whole system, or at least crash the DE panel and itself. As a result I wasn't able to get a new backtrace (application already exited). The apitrace is twice as big now, but judging from a comparison the only difference is that it contains more frames from loading longer. During one attempt I also got spammed by the User error: GL_OUT_OF_MEMORY in glBufferData Mesa: User error: GL_INVALID_VALUE in glBufferSubData(offset 0 + size 432 > buffer size 0) amdgpu: Failed to allocate a buffer: amdgpu:size : 4096 bytes amdgpu:alignment : 4096 bytes amdgpu:domains : 4 amdgpu: Failed to allocate a buffer: amdgpu:size : 4096 bytes amdgpu:alignment : 4096 bytes amdgpu:domains : 4 again. Interestingly it seems to behave slightly different on every try now. It is nice to know you have a clue what the root of the problem is. :) I can imagine ARK is behaving a bit odd. It worked with fglrx and obviously llvmpipe somehow, though. I also noticed I spelled Michels name wrong in a previous comment. Apologies for that. -- 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/20160414/1451327f/attachment-0001.html>
[PATCH 05/14] drm/msm: use drm_crtc_send_vblank_event()
On Thu, Apr 14, 2016 at 1:48 PM, Gustavo Padovan wrote: > From: Gustavo Padovan > > Replace the legacy drm_send_vblank_event() with the new helper function. > > Signed-off-by: Gustavo Padovan thanks, shall I take this via msm-next for 4.7, I assume? Looks like no dependency on drm-core patches that haven't already landed? Reviewed-by: Rob Clark > --- > drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c | 2 +- > drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c > b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c > index e233acf..3a48889 100644 > --- a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c > +++ b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c > @@ -121,7 +121,7 @@ static void complete_flip(struct drm_crtc *crtc, struct > drm_file *file) > if (!file || (event->base.file_priv == file)) { > mdp4_crtc->event = NULL; > DBG("%s: send event: %p", mdp4_crtc->name, event); > - drm_send_vblank_event(dev, mdp4_crtc->id, event); > + drm_crtc_send_vblank_event(crtc, event); > } > } > spin_unlock_irqrestore(&dev->event_lock, flags); > diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c > b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c > index 9673b95..ce779d9 100644 > --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c > +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c > @@ -149,7 +149,7 @@ static void complete_flip(struct drm_crtc *crtc, struct > drm_file *file) > if (!file || (event->base.file_priv == file)) { > mdp5_crtc->event = NULL; > DBG("%s: send event: %p", mdp5_crtc->name, event); > - drm_send_vblank_event(dev, mdp5_crtc->id, event); > + drm_crtc_send_vblank_event(crtc, event); > } > } > spin_unlock_irqrestore(&dev->event_lock, flags); > -- > 2.5.5 >
[PATCH v4 2/3] drm/dp/mst: Enhance DP MST debugfs output
Add some additional information (input vs. output port, sink associated with VC, peer device type, max number of VCs supported) and ensure that any embedded '\0' characters in a branch device's devid string are not written to debugfs. v2: Rebase + change drm_edid_get_monitor_name() call to reflect new signature. v3: Minor changes suggested by Jani + rebase. v4: Rebase cc: dri-devel at lists.freedesktop.org cc: Jani Nikula Reviewed-by: Jani Nikula Signed-off-by: Jim Bride --- drivers/gpu/drm/drm_dp_mst_topology.c | 29 - 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index 27fbd79..06d8b0a 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -2729,7 +2729,7 @@ static void drm_dp_mst_dump_mstb(struct seq_file *m, seq_printf(m, "%smst: %p, %d\n", prefix, mstb, mstb->num_ports); list_for_each_entry(port, &mstb->ports, next) { - seq_printf(m, "%sport: %d: ddps: %d ldps: %d, sdp: %d/%d, %p, conn: %p\n", prefix, port->port_num, port->ddps, port->ldps, port->num_sdp_streams, port->num_sdp_stream_sinks, port, port->connector); + seq_printf(m, "%sport: %d: input: %d: pdt: %d, ddps: %d ldps: %d, sdp: %d/%d, %p, conn: %p\n", prefix, port->port_num, port->input, port->pdt, port->ddps, port->ldps, port->num_sdp_streams, port->num_sdp_stream_sinks, port, port->connector); if (port->mstb) drm_dp_mst_dump_mstb(m, port->mstb); } @@ -2750,6 +2750,16 @@ static bool dump_dp_payload_table(struct drm_dp_mst_topology_mgr *mgr, return false; } +static void fetch_monitor_name(struct drm_dp_mst_topology_mgr *mgr, + struct drm_dp_mst_port *port, char *name, + int namelen) +{ + struct edid *mst_edid; + + mst_edid = drm_dp_mst_get_edid(port->connector, mgr, port); + drm_edid_get_monitor_name(mst_edid, name, namelen); +} + /** * drm_dp_mst_dump_topology(): dump topology to seq file. * @m: seq_file to dump output to @@ -2762,6 +2772,7 @@ void drm_dp_mst_dump_topology(struct seq_file *m, { int i; struct drm_dp_mst_port *port; + mutex_lock(&mgr->lock); if (mgr->mst_primary) drm_dp_mst_dump_mstb(m, mgr->mst_primary); @@ -2770,14 +2781,21 @@ void drm_dp_mst_dump_topology(struct seq_file *m, mutex_unlock(&mgr->lock); mutex_lock(&mgr->payload_lock); - seq_printf(m, "vcpi: %lx %lx\n", mgr->payload_mask, mgr->vcpi_mask); + seq_printf(m, "vcpi: %lx %lx %d\n", mgr->payload_mask, mgr->vcpi_mask, + mgr->max_payloads); for (i = 0; i < mgr->max_payloads; i++) { if (mgr->proposed_vcpis[i]) { + char name[14]; + port = container_of(mgr->proposed_vcpis[i], struct drm_dp_mst_port, vcpi); - seq_printf(m, "vcpi %d: %d %d %d\n", i, port->port_num, port->vcpi.vcpi, port->vcpi.num_slots); + fetch_monitor_name(mgr, port, name, sizeof(name)); + seq_printf(m, "vcpi %d: %d %d %d sink name: %s\n", i, + port->port_num, port->vcpi.vcpi, + port->vcpi.num_slots, + (*name != 0) ? name : "Unknown"); } else - seq_printf(m, "vcpi %d:unsed\n", i); + seq_printf(m, "vcpi %d:unused\n", i); } for (i = 0; i < mgr->max_payloads; i++) { seq_printf(m, "payload %d: %d, %d, %d\n", @@ -2817,8 +2835,9 @@ void drm_dp_mst_dump_topology(struct seq_file *m, for (i = 0; i < 0x3; i++) seq_printf(m, "%02x", buf[i]); seq_printf(m, " devid: "); - for (i = 0x3; i < 0x8; i++) + for (i = 0x3; i < 0x8 && buf[i]; i++) seq_printf(m, "%c", buf[i]); + seq_printf(m, " revision: hw: %x.%x sw: %x.%x", buf[0x9] >> 4, buf[0x9] & 0xf, buf[0xa], buf[0xb]); seq_printf(m, "\n"); bret = dump_dp_payload_table(mgr, buf); -- 2.5.0
[PATCH 0/2] tonga_get_evv_voltage error handling fixes
I got myself a 380X recently and started reading random mesa and kernel code in the hopes that I would find something that I can fix or improve, and something actually caught my eye. Some of the error handling in tonga_get_evv_voltage just seemed of and based on the comments I think the patches provided will do the intended thing. While I did test the patch I have to admit that i did not try what happens when I apply 2V to my card ;-). PS: This is my first submission. So... please tell me if I did something wrong. Moritz Kühner (2): drm/amd/powerplay/hwmgr: prevent VDDC from exceeding 2V drm/amd/powerplay/hwmgr: don't add invalid voltage drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c | 55 --- 1 file changed, 30 insertions(+), 25 deletions(-) -- 2.7.4
[PATCH 1/2] drm/amd/powerplay/hwmgr: prevent VDDC from exceeding 2V
If the tonga gpu is controlled by SVID2 tonga_get_evv_voltage will only print an error if the voltage exceeds 2V although a comment clearly states that it needs be less than 2V. --- drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c index 0d5d837..50afb02 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c @@ -455,8 +455,7 @@ int tonga_get_evv_voltage(struct pp_hwmgr *hwmgr) "Error retrieving EVV voltage value!", continue); /* need to make sure vddc is less than 2v or else, it could burn the ASIC. */ - if (vddc > 2000) - printk(KERN_ERR "[ powerplay ] Invalid VDDC value! \n"); + PP_ASSERT_WITH_CODE(vddc < 2000, "Invalid VDDC value!", return -1); /* the voltage should not be zero nor equal to leakage ID */ if (vddc != 0 && vddc != virtual_voltage_id) { -- 2.7.4
[PATCH 2/2] drm/amd/powerplay/hwmgr: don't add invalid voltage
if atomctrl_get_voltage_evv_on_sclk returns non zero (fail) in the expansion of the PP_ASSERT_WITH_CODE macro the continue will actually do nothing (The macro uses a do ... while(0) as scope, which eats the continue). Based on the code I don't think this was the intent. Unfortunately fixing this requires rewriting the control flow and removing the macros. --- drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c | 54 +-- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c index 50afb02..9a5d10a 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c @@ -429,19 +429,22 @@ int tonga_get_evv_voltage(struct pp_hwmgr *hwmgr) } } } - PP_ASSERT_WITH_CODE(0 == atomctrl_get_voltage_evv_on_sclk + if (0 == atomctrl_get_voltage_evv_on_sclk (hwmgr, VOLTAGE_TYPE_VDDGFX, sclk, -virtual_voltage_id, &vddgfx), - "Error retrieving EVV voltage value!", continue); - - /* need to make sure vddgfx is less than 2v or else, it could burn the ASIC. */ - PP_ASSERT_WITH_CODE((vddgfx < 2000 && vddgfx != 0), "Invalid VDDGFX value!", return -1); - - /* the voltage should not be zero nor equal to leakage ID */ - if (vddgfx != 0 && vddgfx != virtual_voltage_id) { - data->vddcgfx_leakage.actual_voltage[data->vddcgfx_leakage.count] = vddgfx; - data->vddcgfx_leakage.leakage_id[data->vddcgfx_leakage.count] = virtual_voltage_id; - data->vddcgfx_leakage.count++; +virtual_voltage_id, &vddgfx)) { + /* need to make sure vddgfx is less than 2v or else, it could burn the ASIC. */ + PP_ASSERT_WITH_CODE((vddgfx < 2000 && vddgfx != 0), "Invalid VDDGFX value!", return -1); + + /* the voltage should not be zero nor equal to leakage ID */ + if (vddgfx != 0 && vddgfx != virtual_voltage_id) { + data->vddcgfx_leakage.actual_voltage[data->vddcgfx_leakage.count] = vddgfx; + data->vddcgfx_leakage.leakage_id[data->vddcgfx_leakage.count] = virtual_voltage_id; + data->vddcgfx_leakage.count++; + } + } + else + { + printk("%s\n", "Error retrieving EVV voltage value!"); } } } else { @@ -449,19 +452,22 @@ int tonga_get_evv_voltage(struct pp_hwmgr *hwmgr) if (0 == tonga_get_sclk_for_voltage_evv(hwmgr, pptable_info->vddc_lookup_table, virtual_voltage_id, &sclk)) { - PP_ASSERT_WITH_CODE(0 == atomctrl_get_voltage_evv_on_sclk + if (0 == atomctrl_get_voltage_evv_on_sclk (hwmgr, VOLTAGE_TYPE_VDDC, sclk, -virtual_voltage_id, &vddc), - "Error retrieving EVV voltage value!", continue); - - /* need to make sure vddc is less than 2v or else, it could burn the ASIC. */ - PP_ASSERT_WITH_CODE(vddc < 2000, "Invalid VDDC value!", return -1); - - /* the voltage should not be zero nor equal to leakage ID */ - if (vddc != 0 && vddc != virtual_voltage_id) { - data->vddc_leakage.actual_voltage[data->vddc_leakage.count] = vddc; - data->vddc_leakage.leakage_id[data->vddc_leakage.count] = virtual_voltage_id; - data->vddc_leakage.count++; +virtual_voltage_id, &vddc)) { + /* need to make sure vddc is less than 2v or else, it could burn the ASIC. */ + PP_ASSERT_WITH_CODE(vddc < 2000, "Invalid VDDC va
[PATCH v4 1/3] drm/edid: Add drm_edid_get_monitor_name()
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. v2: Refactor to have drm_edid_get_monitor_name() and drm_edid_to_eld() use a common helper function to extract the monitor name from the edid. [Jani] + rebase. v3: Minor changes suggested by Jani + rebase. v4: Few more minor changes suggested by Jani + rebase. cc: dri-devel at lists.freedesktop.org cc: Jani Nikula Reviewed-by: Jani Nikula Signed-off-by: Jim Bride --- drivers/gpu/drm/drm_edid.c | 51 ++ include/drm/drm_crtc.h | 2 ++ 2 files changed, 44 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 558ef9f..96b181a 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -3293,6 +3293,46 @@ monitor_name(struct detailed_timing *t, void *data) *(u8 **)data = t->data.other_data.data.str.str; } +static int get_monitor_name(struct edid *edid, char name[13]) +{ + char *edid_name = NULL; + int mnl; + + if (!edid || !name) + return 0; + + drm_for_each_detailed_block((u8 *)edid, monitor_name, &edid_name); + for (mnl = 0; edid_name && mnl < 13; mnl++) { + if (edid_name[mnl] == 0x0a) + break; + + name[mnl] = edid_name[mnl]; + } + + return mnl; +} + +/** + * drm_edid_get_monitor_name - fetch the monitor name from the edid + * @edid: monitor EDID information + * @name: pointer to a character array to hold the name of the monitor + * @bufsize: The size of the name buffer (should be at least 14 chars.) + * + */ +void drm_edid_get_monitor_name(struct edid *edid, char *name, int bufsize) +{ + int name_length; + char buf[13]; + + if (bufsize <= 0) + return; + + name_length = min(get_monitor_name(edid, buf), bufsize - 1); + memcpy(name, buf, name_length); + name[name_length] = '\0'; +} +EXPORT_SYMBOL(drm_edid_get_monitor_name); + /** * drm_edid_to_eld - build ELD from EDID * @connector: connector corresponding to the HDMI/DP sink @@ -3306,7 +3346,6 @@ void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid) { uint8_t *eld = connector->eld; u8 *cea; - u8 *name; u8 *db; int total_sad_count = 0; int mnl; @@ -3320,14 +3359,8 @@ void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid) return; } - name = NULL; - drm_for_each_detailed_block((u8 *)edid, monitor_name, &name); - /* max: 13 bytes EDID, 16 bytes ELD */ - for (mnl = 0; name && mnl < 13; mnl++) { - if (name[mnl] == 0x0a) - break; - eld[20 + mnl] = name[mnl]; - } + mnl = get_monitor_name(edid, eld + 20); + eld[4] = (cea[1] << 5) | mnl; DRM_DEBUG_KMS("ELD monitor %s\n", eld + 20); diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 8cb377c..6d46842 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -2500,6 +2500,8 @@ 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 void drm_edid_get_monitor_name(struct edid *edid, char *name, + int buflen); extern struct drm_tile_group *drm_mode_create_tile_group(struct drm_device *dev, char topology[8]); -- 2.5.0
[PATCH 2/2] drm/amd/powerplay/hwmgr: don't add invalid voltage
Hi Moritz, 2016-04-14 Moritz Kühner : > if atomctrl_get_voltage_evv_on_sclk returns non zero (fail) in the expansion > of the PP_ASSERT_WITH_CODE macro the continue will actually do nothing > (The macro uses a do ... while(0) as scope, which eats the continue). > Based on the code I don't think this was the intent. > Unfortunately fixing this requires rewriting the control flow and > removing the macros. > --- > drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c | 54 > +-- > 1 file changed, 30 insertions(+), 24 deletions(-) > > diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c > b/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c > index 50afb02..9a5d10a 100644 > --- a/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c > +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c > @@ -429,19 +429,22 @@ int tonga_get_evv_voltage(struct pp_hwmgr *hwmgr) > } > } > } > - PP_ASSERT_WITH_CODE(0 == > atomctrl_get_voltage_evv_on_sclk > + if (0 == atomctrl_get_voltage_evv_on_sclk > (hwmgr, VOLTAGE_TYPE_VDDGFX, > sclk, > - virtual_voltage_id, &vddgfx), > - "Error retrieving EVV voltage > value!", continue); > - > - /* need to make sure vddgfx is less than 2v or > else, it could burn the ASIC. */ > - PP_ASSERT_WITH_CODE((vddgfx < 2000 && vddgfx != > 0), "Invalid VDDGFX value!", return -1); > - > - /* the voltage should not be zero nor equal to > leakage ID */ > - if (vddgfx != 0 && vddgfx != > virtual_voltage_id) { > - > data->vddcgfx_leakage.actual_voltage[data->vddcgfx_leakage.count] = vddgfx; > - > data->vddcgfx_leakage.leakage_id[data->vddcgfx_leakage.count] = > virtual_voltage_id; > - data->vddcgfx_leakage.count++; > + virtual_voltage_id, &vddgfx)) { > + /* need to make sure vddgfx is less > than 2v or else, it could burn the ASIC. */ > + PP_ASSERT_WITH_CODE((vddgfx < 2000 && > vddgfx != 0), "Invalid VDDGFX value!", return -1); > + > + /* the voltage should not be zero nor > equal to leakage ID */ > + if (vddgfx != 0 && vddgfx != > virtual_voltage_id) { > + > data->vddcgfx_leakage.actual_voltage[data->vddcgfx_leakage.count] = vddgfx; > + > data->vddcgfx_leakage.leakage_id[data->vddcgfx_leakage.count] = > virtual_voltage_id; > + data->vddcgfx_leakage.count++; > + } > + } > + else > + { > + printk("%s\n", "Error retrieving EVV > voltage value!"); Use DRM_ERROR here. And no need to for %s on this format string. I think you want something like this: DRM_ERROR("Error retrieving EVV voltage value!\n"); > } > } > } else { > @@ -449,19 +452,22 @@ int tonga_get_evv_voltage(struct pp_hwmgr *hwmgr) > if (0 == tonga_get_sclk_for_voltage_evv(hwmgr, > pptable_info->vddc_lookup_table, > virtual_voltage_id, &sclk)) { > - PP_ASSERT_WITH_CODE(0 == > atomctrl_get_voltage_evv_on_sclk > + if (0 == atomctrl_get_voltage_evv_on_sclk > (hwmgr, VOLTAGE_TYPE_VDDC, sclk, > - virtual_voltage_id, &vddc), > - "Error retrieving EVV voltage > value!", continue); > - > - /* need to make sure vddc is less than 2v or > else, it could burn the ASIC. */ > - PP_ASSERT_WITH_CODE(vddc < 2000, "Invalid VDDC > value!", return -1); > - > - /* the voltage should not be zero nor equal to > leakage ID */ > - if (vddc != 0 && vddc != virtual_voltage_id) { > - > data->vddc_leakage.actual_voltage[data->vddc_leakage.count] = vddc; > - > data->vddc_leakage.leakage_id[data->vddc_leakage.count] = virtual_voltage_id; > - data->vddc_l
[RFC 0/8] drm: explicit fencing support
From: Gustavo Padovan Hi, Currently the Linux Kernel only have an implicit fencing mechanism where the fence are attached directly to buffers and userspace is unaware of what is happening. On the other hand explicit fencing which is not supported yet by Linux but it expose fences to the userspace to handle fencing between producer/consumer explicitely. For that we use the Android Sync Framework[1], a explicit fencing mechanism that help the userspace handles fences directly. It has the concept of sync_file (called sync_fence in Android) that expose the driver's fences to userspace via file descriptors. File descriptors are useful because we can pass them around between process. The Sync Framework is currently in the staging tree and on the process to be de-staged[2]. With explicit fencing we have a global mechanism that optimizes the flow of buffers between consumers and producers, avoid a lot of waiting. So instead of waiting for a buffer to be processed by the GPU before sending it to DRM in an Atomic IOCTL we can get a sync_file fd from the GPU driver at the moment we submit the buffer processing. The compositor then passes these fds to DRM in a atomic commit request, that will not be displayed until the fences signal, i.e, the GPU finished processing the buffer and it is ready to display. In DRM the fences we wait on before displaying a buffer are called in-fences. Vice-versa, we have out-fences, to sychronize the return of buffers to GPU (producer) to be processed again. When DRM receives an atomic request with a special flag set it generates one fence per-crtc and attach it to a per-crtc sync_file. It then returns the array of sync_file fds to userspace as an atomic_ioctl out arg. With the fences available userspace can forward these fences to the GPU, where it will wait the fence to signal before starting to process on buffer again. Explicit fencing with Sync Framework allows buffer suballocation. Userspace get a large buffer and divides it into small ones and submit requests to process them, each subbuffer gets and sync_file fd and can be processed in parallel. This is not even possible with implicit fencing. While these are out-fences in DRM (the consumer) they become in-fences once they get to the GPU (the producer). DRM explicit fences are opt-in, as the default will still be implicit fencing. To enable explicit in-fences one just need to pass a sync_file fd in the FENCE_FD plane property. *In-fences are per-plane*, i.e., per framebuffer. For out-fences, just enabling DRM_MODE_ATOMIC_OUT_FENCE flag is enough. *Out-fences are per-crtc*. In-fences - In the first discussions on #dri-devel on IRC we decided to hide the Sync Framework from DRM drivers to reduce complexity, so as soon we get the fd via FENCE_FD plane property we convert the sync_file fd to a struct fence. However a sync_file might contain more than one fence, so we created the fence_collection concept. struct fence_collection is a subclass of struct fence and stores a group of fences that needs to be waited together, in other words, all the fences in the sync_file. Then we just use the already in place fence support to wait on those fences. Once the producer calls fence_signal() for all fences on wait we can proceed with the atomic commit and display the framebuffers. DRM drivers only needs to be converted to struct fence to make use of this feature. Out-fences -- Passing the DRM_MODE_ATOMIC_OUT_FENCE flag to an atomic request enables out-fences. The kernel then creates a fence, attach it to a sync_file and install this file on a unused fd for each crtc. Userspace get the fence back as an array of per-crtc sync_file fds. DRM core use the already in place drm_event infrastructure to help signal fences, we've added a fence pointer to struct drm_pending_event. If the atomic update received requested an PAGE_FLIP_EVENT we just use the same drm_pending_event and set our fence there, otherwise we just create an event with a NULL file_priv to set our fence. On vblank we just call fence_signal() to signal that the buffer related to this fence is *now* on the screen. Note that this is exactly the opposite behaviour from Android, where the fences are signaled when they are not on display anymore, so free to be reused. No changes are required to DRM drivers to have out-fences support, apart from atomic support of course. Open question -- Should we use sync_timeline for out-fences? My feel is that sync_timeline do a lot more than we need for DRM. Should we go for a small drm_timeline? Any toughts on this? Kernel tree --- For those who want all patches on this RFC are in my tree. The tree includes all sync frameworks patches needed at the moment: https://git.kernel.org/cgit/linux/kernel/git/padovan/linux.git/log/?h=fences I also hacked some poor some fake fences support to modetest here: https://git.collabora.com/cgit/user/padovan/libdrm.git/log/?h=atomic Regards, Gustavo --
[RFC 1/8] dma-buf/fence: add fence_collection fences
From: Gustavo Padovan struct fence_collection inherits from struct fence and carries a collection of fences that needs to be waited together. It is useful to translate a sync_file to a fence to remove the complexity of dealing with sync_files from DRM drivers. So even if there are many fences in the sync_file that needs to waited for a commit to happen drivers would only worry about a standard struct fence.That means that no changes needed to any driver besides supporting fences. fence_collection's fence doesn't belong to any timeline context. Signed-off-by: Gustavo Padovan --- drivers/dma-buf/Makefile | 2 +- drivers/dma-buf/fence-collection.c | 138 + drivers/dma-buf/fence.c| 2 +- include/linux/fence-collection.h | 56 +++ include/linux/fence.h | 2 + 5 files changed, 198 insertions(+), 2 deletions(-) create mode 100644 drivers/dma-buf/fence-collection.c create mode 100644 include/linux/fence-collection.h diff --git a/drivers/dma-buf/Makefile b/drivers/dma-buf/Makefile index 43325a1..30b8464 100644 --- a/drivers/dma-buf/Makefile +++ b/drivers/dma-buf/Makefile @@ -1,3 +1,3 @@ -obj-y := dma-buf.o fence.o reservation.o seqno-fence.o +obj-y := dma-buf.o fence.o reservation.o seqno-fence.o fence-collection.o obj-$(CONFIG_SYNC_FILE)+= sync_file.o sync_timeline.o sync_debug.o obj-$(CONFIG_SW_SYNC) += sw_sync.o diff --git a/drivers/dma-buf/fence-collection.c b/drivers/dma-buf/fence-collection.c new file mode 100644 index 000..8a4ecb0 --- /dev/null +++ b/drivers/dma-buf/fence-collection.c @@ -0,0 +1,138 @@ +/* + * fence-collection: aggregate fences to be waited together + * + * Copyright (C) 2016 Collabora Ltd + * Authors: + * Gustavo Padovan + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#include +#include +#include + +static const char *fence_collection_get_driver_name(struct fence *fence) +{ + struct fence_collection *collection = to_fence_collection(fence); + struct fence *f = collection->fences[0].fence; + + return f->ops->get_driver_name(fence); +} + +static const char *fence_collection_get_timeline_name(struct fence *fence) +{ + return "no context"; +} + +static bool fence_collection_enable_signaling(struct fence *fence) +{ + struct fence_collection *collection = to_fence_collection(fence); + + return atomic_read(&collection->num_pending_fences); +} + +static bool fence_collection_signaled(struct fence *fence) +{ + struct fence_collection *collection = to_fence_collection(fence); + + return (atomic_read(&collection->num_pending_fences) == 0); +} + +static void fence_collection_release(struct fence *fence) +{ + struct fence_collection *collection = to_fence_collection(fence); + int i; + + for (i = 0 ; i < collection->num_fences ; i++) { + fence_remove_callback(collection->fences[i].fence, + &collection->fences[i].cb); + fence_put(collection->fences[i].fence); + } + + fence_free(fence); +} + +static signed long fence_collection_wait(struct fence *fence, bool intr, +signed long timeout) +{ + struct fence_collection *collection = to_fence_collection(fence); + int i; + + for (i = 0 ; i < collection->num_fences ; i++) { + timeout = fence_wait(collection->fences[i].fence, intr); + if (timeout < 0) + return timeout; + } + + return timeout; +} + +static const struct fence_ops fence_collection_ops = { + .get_driver_name = fence_collection_get_driver_name, + .get_timeline_name = fence_collection_get_timeline_name, + .enable_signaling = fence_collection_enable_signaling, + .signaled = fence_collection_signaled, + .wait = fence_collection_wait, + .release = fence_collection_release, +}; + +static void collection_check_cb_func(struct fence *fence, struct fence_cb *cb) +{ + struct fence_collection_cb *f_cb; + struct fence_collection *collection; + + f_cb = container_of(cb, struct fence_collection_cb, cb); + collection = f_cb->collection; + + if (atomic_dec_and_test(&collection->num_pending_fences)) + fence_signal(&collection->base); +} + +void fence_collection_add(struct fence_collection *collection, + struct fence *fence) +{ + int n = collection->num_fences; + + collection->fences[n].collection = collection