Commit 25da4427 authored by Chunming Zhou's avatar Chunming Zhou Committed by Alex Deucher

drm/amdgpu: add atom interfaces for CGS

This implements the interface for atombios command
and data table access.
Reviewed-by: default avatarJammy Zhou <Jammy.Zhou@amd.com>
Signed-off-by: default avatarChunming Zhou <David1.Zhou@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 0cf3be21
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <linux/pci.h> #include <linux/pci.h>
#include "amdgpu.h" #include "amdgpu.h"
#include "cgs_linux.h" #include "cgs_linux.h"
#include "atom.h"
struct amdgpu_cgs_device { struct amdgpu_cgs_device {
struct cgs_device base; struct cgs_device base;
...@@ -221,24 +222,39 @@ static const void *amdgpu_cgs_atom_get_data_table(void *cgs_device, ...@@ -221,24 +222,39 @@ static const void *amdgpu_cgs_atom_get_data_table(void *cgs_device,
unsigned table, uint16_t *size, unsigned table, uint16_t *size,
uint8_t *frev, uint8_t *crev) uint8_t *frev, uint8_t *crev)
{ {
/* TODO */ CGS_FUNC_ADEV;
uint16_t data_start;
if (amdgpu_atom_parse_data_header(
adev->mode_info.atom_context, table, size,
frev, crev, &data_start))
return (uint8_t*)adev->mode_info.atom_context->bios +
data_start;
return NULL; return NULL;
} }
static int amdgpu_cgs_atom_get_cmd_table_revs(void *cgs_device, unsigned table, static int amdgpu_cgs_atom_get_cmd_table_revs(void *cgs_device, unsigned table,
uint8_t *frev, uint8_t *crev) uint8_t *frev, uint8_t *crev)
{ {
/* TODO */ CGS_FUNC_ADEV;
if (amdgpu_atom_parse_cmd_header(
adev->mode_info.atom_context, table,
frev, crev))
return 0; return 0;
return -EINVAL;
} }
static int amdgpu_cgs_atom_exec_cmd_table(void *cgs_device, unsigned table, static int amdgpu_cgs_atom_exec_cmd_table(void *cgs_device, unsigned table,
void *args) void *args)
{ {
/* TODO */ CGS_FUNC_ADEV;
return 0;
}
return amdgpu_atom_execute_table(
adev->mode_info.atom_context, table, args);
}
static int amdgpu_cgs_create_pm_request(void *cgs_device, cgs_handle_t *request) static int amdgpu_cgs_create_pm_request(void *cgs_device, cgs_handle_t *request)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment