AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Harry Wentland <harry.wentland-5C7GfCeVMHo@public.gmane.org>
To: Rex Zhu <Rex.Zhu-5C7GfCeVMHo@public.gmane.org>,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH 1/2] drm/amd/dc: Use atombios api directly in DC
Date: Mon, 26 Mar 2018 16:34:43 -0400	[thread overview]
Message-ID: <fa78377f-c90f-3bb9-b269-515d0fa86d2e@amd.com> (raw)
In-Reply-To: <1522065362-25568-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>

On 2018-03-26 07:56 AM, Rex Zhu wrote:
> In order to remove the cgs wrapper functions for atombios api.
> 
> Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>

Patch 1 is
Reviewed-by: Harry Wentland <harry.wentland@amd.com>

Harry

> ---
>  .../gpu/drm/amd/display/dc/bios/command_table.c    | 22 +++++++++---------
>  .../gpu/drm/amd/display/dc/bios/command_table2.c   | 26 +++++++++++++---------
>  2 files changed, 28 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/bios/command_table.c b/drivers/gpu/drm/amd/display/dc/bios/command_table.c
> index 4b5fdd5..651e1fd 100644
> --- a/drivers/gpu/drm/amd/display/dc/bios/command_table.c
> +++ b/drivers/gpu/drm/amd/display/dc/bios/command_table.c
> @@ -24,7 +24,7 @@
>   */
>  
>  #include "dm_services.h"
> -
> +#include "amdgpu.h"
>  #include "atom.h"
>  
>  #include "include/bios_parser_interface.h"
> @@ -35,16 +35,16 @@
>  #include "bios_parser_types_internal.h"
>  
>  #define EXEC_BIOS_CMD_TABLE(command, params)\
> -	(cgs_atom_exec_cmd_table(bp->base.ctx->cgs_device, \
> +	(amdgpu_atom_execute_table(((struct amdgpu_device *)bp->base.ctx->driver_context)->mode_info.atom_context, \
>  		GetIndexIntoMasterTable(COMMAND, command), \
> -		&params) == 0)
> +		(uint32_t *)&params) == 0)
>  
>  #define BIOS_CMD_TABLE_REVISION(command, frev, crev)\
> -	cgs_atom_get_cmd_table_revs(bp->base.ctx->cgs_device, \
> +	amdgpu_atom_parse_cmd_header(((struct amdgpu_device *)bp->base.ctx->driver_context)->mode_info.atom_context, \
>  		GetIndexIntoMasterTable(COMMAND, command), &frev, &crev)
>  
>  #define BIOS_CMD_TABLE_PARA_REVISION(command)\
> -	bios_cmd_table_para_revision(bp->base.ctx->cgs_device, \
> +	bios_cmd_table_para_revision(bp->base.ctx->driver_context, \
>  		GetIndexIntoMasterTable(COMMAND, command))
>  
>  static void init_dig_encoder_control(struct bios_parser *bp);
> @@ -82,16 +82,18 @@ void dal_bios_parser_init_cmd_tbl(struct bios_parser *bp)
>  	init_set_dce_clock(bp);
>  }
>  
> -static uint32_t bios_cmd_table_para_revision(void *cgs_device,
> +static uint32_t bios_cmd_table_para_revision(void *dev,
>  					     uint32_t index)
>  {
> +	struct amdgpu_device *adev = dev;
>  	uint8_t frev, crev;
>  
> -	if (cgs_atom_get_cmd_table_revs(cgs_device,
> +	if (amdgpu_atom_parse_cmd_header(adev->mode_info.atom_context,
>  					index,
> -					&frev, &crev) != 0)
> +					&frev, &crev))
> +		return crev;
> +	else
>  		return 0;
> -	return crev;
>  }
>  
>  /*******************************************************************************
> @@ -368,7 +370,7 @@ static void init_transmitter_control(struct bios_parser *bp)
>  	uint8_t crev;
>  
>  	if (BIOS_CMD_TABLE_REVISION(UNIPHYTransmitterControl,
> -			frev, crev) != 0)
> +			frev, crev) == false)
>  		BREAK_TO_DEBUGGER();
>  	switch (crev) {
>  	case 2:
> diff --git a/drivers/gpu/drm/amd/display/dc/bios/command_table2.c b/drivers/gpu/drm/amd/display/dc/bios/command_table2.c
> index 3f63f71..752b08a 100644
> --- a/drivers/gpu/drm/amd/display/dc/bios/command_table2.c
> +++ b/drivers/gpu/drm/amd/display/dc/bios/command_table2.c
> @@ -26,14 +26,18 @@
>  #include "dm_services.h"
>  
>  #include "ObjectID.h"
> -#include "atomfirmware.h"
>  
> +#include "atomfirmware.h"
> +#include "atom.h"
>  #include "include/bios_parser_interface.h"
>  
>  #include "command_table2.h"
>  #include "command_table_helper2.h"
>  #include "bios_parser_helper.h"
>  #include "bios_parser_types_internal2.h"
> +#include "amdgpu.h"
> +
> +
>  #define DC_LOGGER \
>  	bp->base.ctx->logger
>  
> @@ -43,16 +47,16 @@
>  		->FieldName)-(char *)0)/sizeof(uint16_t))
>  
>  #define EXEC_BIOS_CMD_TABLE(fname, params)\
> -	(cgs_atom_exec_cmd_table(bp->base.ctx->cgs_device, \
> +	(amdgpu_atom_execute_table(((struct amdgpu_device *)bp->base.ctx->driver_context)->mode_info.atom_context, \
>  		GET_INDEX_INTO_MASTER_TABLE(command, fname), \
> -		&params) == 0)
> +		(uint32_t *)&params) == 0)
>  
>  #define BIOS_CMD_TABLE_REVISION(fname, frev, crev)\
> -	cgs_atom_get_cmd_table_revs(bp->base.ctx->cgs_device, \
> +	amdgpu_atom_parse_cmd_header(((struct amdgpu_device *)bp->base.ctx->driver_context)->mode_info.atom_context, \
>  		GET_INDEX_INTO_MASTER_TABLE(command, fname), &frev, &crev)
>  
>  #define BIOS_CMD_TABLE_PARA_REVISION(fname)\
> -	bios_cmd_table_para_revision(bp->base.ctx->cgs_device, \
> +	bios_cmd_table_para_revision(bp->base.ctx->driver_context, \
>  			GET_INDEX_INTO_MASTER_TABLE(command, fname))
>  
>  static void init_dig_encoder_control(struct bios_parser *bp);
> @@ -86,16 +90,18 @@ void dal_firmware_parser_init_cmd_tbl(struct bios_parser *bp)
>  	init_get_smu_clock_info(bp);
>  }
>  
> -static uint32_t bios_cmd_table_para_revision(void *cgs_device,
> +static uint32_t bios_cmd_table_para_revision(void *dev,
>  					     uint32_t index)
>  {
> +	struct amdgpu_device *adev = dev;
>  	uint8_t frev, crev;
>  
> -	if (cgs_atom_get_cmd_table_revs(cgs_device,
> +	if (amdgpu_atom_parse_cmd_header(adev->mode_info.atom_context,
>  					index,
> -					&frev, &crev) != 0)
> +					&frev, &crev))
> +		return crev;
> +	else
>  		return 0;
> -	return crev;
>  }
>  
>  /******************************************************************************
> @@ -201,7 +207,7 @@ static void init_transmitter_control(struct bios_parser *bp)
>  	uint8_t frev;
>  	uint8_t crev;
>  
> -	if (BIOS_CMD_TABLE_REVISION(dig1transmittercontrol, frev, crev) != 0)
> +	if (BIOS_CMD_TABLE_REVISION(dig1transmittercontrol, frev, crev) == false)
>  		BREAK_TO_DEBUGGER();
>  	switch (crev) {
>  	case 6:
> 
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

      parent reply	other threads:[~2018-03-26 20:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-26 11:56 [PATCH 1/2] drm/amd/dc: Use atombios api directly in DC Rex Zhu
     [not found] ` <1522065362-25568-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
2018-03-26 11:56   ` [PATCH 2/2] drm/amd/pp: Use atombios interface directly in powerplay Rex Zhu
     [not found]     ` <1522065362-25568-2-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
2018-03-27  2:23       ` Huang Rui
2018-03-26 20:34   ` Harry Wentland [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fa78377f-c90f-3bb9-b269-515d0fa86d2e@amd.com \
    --to=harry.wentland-5c7gfcevmho@public.gmane.org \
    --cc=Rex.Zhu-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox