amdgpu: HDMI Stereo 3D support
Subsystems (2)
PATCH 1/2 amdgpu: Stereo 3D support requires enabling audio
In reply to Jeff Smith--- drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +6 -4
@@ -1638,12 +1638,12 @@ amdgpu_connector_add(struct amdgpu_device *adev,drm_object_attach_property (&amdgpu_connector->base.base, adev->mode_info.dither_property,AMDGPU_FMT_DITHER_DISABLE ); - -if (amdgpu_audio !=0 ) +if (amdgpu_audio !=0 ) { + amdgpu_connector->audio =AMDGPU_AUDIO_AUTO ;drm_object_attach_property (&amdgpu_connector->base.base, adev->mode_info.audio_property,AMDGPU_AUDIO_AUTO ); - + } subpixel_order = SubPixelHorizontalRGB; connector->interlace_allowed = true;if (connector_type ==DRM_MODE_CONNECTOR_HDMIB )
@@ -1742,8 +1742,8 @@ amdgpu_connector_add(struct amdgpu_device *adev,drm_object_attach_property (&amdgpu_connector->base.base, dev->mode_config.scaling_mode_property,DRM_MODE_SCALE_NONE ); -if (amdgpu_audio !=0 ) { + amdgpu_connector->audio =AMDGPU_AUDIO_AUTO ;drm_object_attach_property (&amdgpu_connector->base.base, adev->mode_info.audio_property,AMDGPU_AUDIO_AUTO );
@@ -1792,6 +1792,7 @@ amdgpu_connector_add(struct amdgpu_device *adev, dev->mode_config.scaling_mode_property, DRM_MODE_SCALE_NONE);if (amdgpu_audio !=0 ) { + amdgpu_connector->audio =AMDGPU_AUDIO_AUTO ;drm_object_attach_property (&amdgpu_connector->base.base, adev->mode_info.audio_property,AMDGPU_AUDIO_AUTO );
@@ -1837,6 +1838,7 @@ amdgpu_connector_add(struct amdgpu_device *adev, dev->mode_config.scaling_mode_property, DRM_MODE_SCALE_NONE);if (amdgpu_audio !=0 ) { + amdgpu_connector->audio =AMDGPU_AUDIO_AUTO ;drm_object_attach_property (&amdgpu_connector->base.base, adev->mode_info.audio_property,AMDGPU_AUDIO_AUTO );
Signature · 6 lines
2.9.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/2 amdgpu: Add stereo 3D support
In reply to Jeff Smith--- drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 5 ++ drivers/gpu/drm/amd/amdgpu/atombios_crtc.c | 27 ++++---- drivers/gpu/drm/amd/amdgpu/atombios_encoders.c | 2 +- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 86 ++++++++++++++++++++++++-- 4 files changed, 100 insertions(+), 20 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +5 -0
@@ -1165,6 +1165,10 @@ static int amdgpu_connector_dvi_mode_valid(struct drm_connector *connector,struct amdgpu_device *adev = dev->dev_private;struct amdgpu_connector *amdgpu_connector =to_amdgpu_connector (connector); +if (((mode->flags &DRM_MODE_FLAG_3D_MASK ) ==DRM_MODE_FLAG_3D_FRAME_PACKING ) && + (mode->flags &DRM_MODE_FLAG_INTERLACE )) +return MODE_BAD ; +/* XXX check mode bandwidth */ if (amdgpu_connector->use_digital && (mode->clock >165000 )) {
@@ -1802,6 +1806,7 @@ amdgpu_connector_add(struct amdgpu_device *adev, AMDGPU_FMT_DITHER_DISABLE); subpixel_order = SubPixelHorizontalRGB; connector->interlace_allowed = true; + connector->stereo_allowed = true;if (connector_type ==DRM_MODE_CONNECTOR_HDMIB ) connector->doublescan_allowed = true;else
drivers/gpu/drm/amd/amdgpu/atombios_crtc.c +13 -14
@@ -301,8 +301,7 @@ union adjust_pixel_clock {ADJUST_DISPLAY_PLL_PS_ALLOCATION_V3 v3; }; -static u32 amdgpu_atombios_crtc_adjust_pll (struct drm_crtc *crtc, -struct drm_display_mode *mode) +static u32 amdgpu_atombios_crtc_adjust_pll (struct drm_crtc *crtc,u32 clock) {struct amdgpu_crtc *amdgpu_crtc =to_amdgpu_crtc (crtc);struct drm_device *dev = crtc->dev;
@@ -310,12 +309,11 @@ static u32 amdgpu_atombios_crtc_adjust_pll(struct drm_crtc *crtc,struct drm_encoder *encoder = amdgpu_crtc->encoder;struct amdgpu_encoder *amdgpu_encoder =to_amdgpu_encoder (encoder);struct drm_connector *connector =amdgpu_get_connector_for_encoder (encoder); -u32 adjusted_clock = mode->clock; +u32 adjusted_clock = clock;int encoder_mode =amdgpu_atombios_encoder_get_encoder_mode (encoder); -u32 dp_clock = mode->clock; -u32 clock = mode->clock; +u32 dp_clock = clock;int bpc = amdgpu_crtc->bpc; -bool is_duallink =amdgpu_dig_monitor_is_duallink (encoder, mode->clock); +bool is_duallink =amdgpu_dig_monitor_is_duallink (encoder, clock);union adjust_pixel_clock args;u8 frev, crev;int index;
@@ -346,7 +344,7 @@ 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 ; + adjusted_clock = 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 ))
@@ -746,6 +744,7 @@ int amdgpu_atombios_crtc_prepare_pll(struct drm_crtc *crtc,struct amdgpu_encoder *amdgpu_encoder =to_amdgpu_encoder (amdgpu_crtc->encoder);int encoder_mode =amdgpu_atombios_encoder_get_encoder_mode (amdgpu_crtc->encoder); +u32 clock = mode->crtc_clock; amdgpu_crtc->bpc =8 ; amdgpu_crtc->ss_enabled = false;
@@ -762,7 +761,7 @@ int amdgpu_atombios_crtc_prepare_pll(struct drm_crtc *crtc,int dp_clock;/* Assign mode clock for hdmi deep color max clock limit check */ - amdgpu_connector->pixelclock_for_modeset = mode->clock; + amdgpu_connector->pixelclock_for_modeset = clock; amdgpu_crtc->bpc =amdgpu_connector_get_monitor_bpc (connector);switch (encoder_mode) {
@@ -780,21 +779,21 @@ int amdgpu_atombios_crtc_prepare_pll(struct drm_crtc *crtc,amdgpu_atombios_get_asic_ss_info (adev, &amdgpu_crtc->ss, dig->lcd_ss_id, - mode->clock /10 ); + clock /10 );break ;case ATOM_ENCODER_MODE_DVI : amdgpu_crtc->ss_enabled =amdgpu_atombios_get_asic_ss_info (adev, &amdgpu_crtc->ss,ASIC_INTERNAL_SS_ON_TMDS , - mode->clock /10 ); + clock /10 );break ;case ATOM_ENCODER_MODE_HDMI : amdgpu_crtc->ss_enabled =amdgpu_atombios_get_asic_ss_info (adev, &amdgpu_crtc->ss,ASIC_INTERNAL_SS_ON_HDMI , - mode->clock /10 ); + clock /10 );break ;default :break ;
@@ -802,7 +801,7 @@ int amdgpu_atombios_crtc_prepare_pll(struct drm_crtc *crtc, }/* adjust pixel clock as needed */ - amdgpu_crtc->adjusted_clock =amdgpu_atombios_crtc_adjust_pll (crtc, mode); + amdgpu_crtc->adjusted_clock =amdgpu_atombios_crtc_adjust_pll (crtc, clock);return 0 ; }
@@ -814,8 +813,8 @@ void amdgpu_atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_modestruct amdgpu_device *adev = dev->dev_private;struct amdgpu_encoder *amdgpu_encoder =to_amdgpu_encoder (amdgpu_crtc->encoder); -u32 pll_clock = mode->clock; -u32 clock = mode->clock; +u32 pll_clock = mode->crtc_clock; +u32 clock = mode->crtc_clock;u32 ref_div =0 , fb_div =0 , frac_fb_div =0 , post_div =0 ;struct amdgpu_pll *pll;int encoder_mode =amdgpu_atombios_encoder_get_encoder_mode (amdgpu_crtc->encoder);
drivers/gpu/drm/amd/amdgpu/atombios_encoders.c +1 -1
@@ -292,7 +292,7 @@ bool amdgpu_atombios_encoder_mode_fixup(struct drm_encoder *encoder,/* set the active encoder to connector routing */ amdgpu_encoder_set_active_device (encoder); -drm_mode_set_crtcinfo (adjusted_mode,0 ); +drm_mode_set_crtcinfo (adjusted_mode,CRTC_STEREO_DOUBLE );/* hw bug */ if ((mode->flags & DRM_MODE_FLAG_INTERLACE)
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c +81 -5
135 lines not on this page · raw message
Signature · 6 lines
2.9.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
cover amdgpu: HDMI Stereo 3D support
Hello all,
This code is very raw at this point, but wanted to get this out there for feedback.
This uses codepaths very close to those used for HDMI audio support. The driver currently has this disabled, so I needed to re-enable it. Turning stereo 3D on without turning audio on would require a bit of additional condition handling.
I suspect there are some non-stereo modes that will break with the code in its current state, such as modes that require double-scan.
Regards,
Jeff
Jeff Smith (2):
amdgpu: Stereo 3D support requires enabling audio
amdgpu: Add stereo 3D support
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 15 +++-- drivers/gpu/drm/amd/amdgpu/atombios_crtc.c | 27 ++++---- drivers/gpu/drm/amd/amdgpu/atombios_encoders.c | 2 +- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 86 ++++++++++++++++++++++++-- 4 files changed, 106 insertions(+), 24 deletions(-)
Signature · 6 lines
2.9.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 5 lines · Jeff Smith
Hello all,
This code is very raw at this point, but wanted to get this out there for feedback.
Quoted 8 lines
This uses codepaths very close to those used for HDMI audio support. The driver currently has this disabled, so I needed to re-enable it. Turning stereo 3D on without turning audio on would require a bit of additional condition handling.
I suspect there are some non-stereo modes that will break with the code in its current state, such as modes that require double-scan.
Thanks for the patches. We are in the process of transitioning to new updated modesetting code (DC), so I would suggest working against that rather than the existing code. You can find the latest DC code on the branch below. See the display directory in drivers/gpu/drm/amd.
https://cgit.freedesktop.org/~agd5f/linux/log/?h=amd-staging-4.9
Alex
Quoted 14 lines
Regards,
JeffJeff Smith (2):
amdgpu: Stereo 3D support requires enabling audio
amdgpu: Add stereo 3D supportdrivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 15 +++-- drivers/gpu/drm/amd/amdgpu/atombios_crtc.c | 27 ++++---- drivers/gpu/drm/amd/amdgpu/atombios_encoders.c | 2 +- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 86 ++++++++++++++++++++++++-- 4 files changed, 106 insertions(+), 24 deletions(-)
Quoted 7 lines
--
2.9.3_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 15 lines · Alex Deucher
Quoted 5 lines · Jeff Smith
Hello all,
This code is very raw at this point, but wanted to get this out there for feedback.
Quoted 8 lines
This uses codepaths very close to those used for HDMI audio support. The driver currently has this disabled, so I needed to re-enable it. Turning stereo 3D on without turning audio on would require a bit of additional condition handling.
I suspect there are some non-stereo modes that will break with the code in its current state, such as modes that require double-scan.
Quoted 5 lines
Thanks for the patches. We are in the process of transitioning to new updated modesetting code (DC), so I would suggest working against that rather than the existing code. You can find the latest DC code on the branch below. See the display directory in
drivers/gpu/drm/amd.
https://cgit.freedesktop.org/~agd5f/linux/log/?h=amd-staging-4.9
Given that DAL is still a bit away from getting merged I'm not sure it's a good idea to block new features from outsiders on it landing ... That means AMD will need to port this, but that's part of the price to pay for a wholesale rewrite of the display driver.
-Daniel
Quoted 29 lines
Alex
Quoted 14 lines
Regards,
JeffJeff Smith (2):
amdgpu: Stereo 3D support requires enabling audio
amdgpu: Add stereo 3D supportdrivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 15 +++-- drivers/gpu/drm/amd/amdgpu/atombios_crtc.c | 27 ++++---- drivers/gpu/drm/amd/amdgpu/atombios_encoders.c | 2 +- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 86 ++++++++++++++++++++++++-- 4 files changed, 106 insertions(+), 24 deletions(-)Quoted 7 lines
--
2.9.3_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 22 lines · Daniel Vetter
Quoted 15 lines · Alex Deucher
Quoted 5 lines · Jeff Smith
Hello all,
This code is very raw at this point, but wanted to get this out there for feedback.
Quoted 8 lines
This uses codepaths very close to those used for HDMI audio support. The driver currently has this disabled, so I needed to re-enable it. Turning stereo 3D on without turning audio on would require a bit of additional condition handling.
I suspect there are some non-stereo modes that will break with the code in its current state, such as modes that require double-scan.
Quoted 5 lines
Thanks for the patches. We are in the process of transitioning to new updated modesetting code (DC), so I would suggest working against that rather than the existing code. You can find the latest DC code on the branch below. See the display directory in
drivers/gpu/drm/amd.
https://cgit.freedesktop.org/~agd5f/linux/log/?h=amd-staging-4.9
Quoted 4 lines
Given that DAL is still a bit away from getting merged I'm not sure it's a good idea to block new features from outsiders on it landing ... That means AMD will need to port this, but that's part of the price to pay for a wholesale rewrite of the display driver.
Before this patch set can land, the current display code needs to grow support for proper audio and infoframe support in general which is a fairly major task. Without that, these patches are not particularly useful as they won't work in most cases. In my opinion, time would be better spent working on helping to get DC merged, but I obviously can't tell you how to spend your time.
Alex
Quoted 32 lines
-Daniel
Quoted 21 lines
Alex
Quoted 17 lines
Regards,
JeffJeff Smith (2):
amdgpu: Stereo 3D support requires enabling audio
amdgpu: Add stereo 3D supportdrivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 15 +++-- drivers/gpu/drm/amd/amdgpu/atombios_crtc.c | 27 ++++---- drivers/gpu/drm/amd/amdgpu/atombios_encoders.c | 2 +- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 86 ++++++++++++++++++++++++-- 4 files changed, 106 insertions(+), 24 deletions(-)--
2.9.3Quoted 8 lines
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 4 lines
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel