Skip to content

Commit

Permalink
drm/amdkcl: TODO drop dead code in crtc->gamma_set
Browse files Browse the repository at this point in the history
drm_fb_helper_setcmap() prev
v4.12-rc7-1385-g964c60063bff("drm/fb-helper: separate the fb_setcmap
		helper into atomic and legacy paths") don't work as
expected.
this commit won't fix the issue. just leave a TODO msg once the
gamma_set func is required.

the gamma_set history is:
v4.13-rc2-353-g2cd575aabd4d drm: remove unused and redundant callbacks
v4.13-rc2-337-g76dd3cd8405c drm: amd: remove dead code and pointless
local lut storage
v4.12-rc7-1385-g964c60063bff drm/fb-helper: separate the fb_setcmap
helper into atomic and legacy paths
v3.10-rc2-516-g04c0c569d435 drm/fb-helper: Make load_lut and
gamma_set/gamma_get hooks optional

Signed-off-by: Flora Cui <flora.cui@amd.com>
Reviewed-by: Yang Xiong <Yang.Xiong@amd.com>
  • Loading branch information
Flora Cui committed Aug 14, 2020
1 parent d96876c commit beab110
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 48 deletions.
3 changes: 0 additions & 3 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,6 @@ struct amdgpu_atom_ss {
struct amdgpu_crtc {
struct drm_crtc base;
int crtc_id;
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)
u16 lut_r[256], lut_g[256], lut_b[256];
#endif
bool enabled;
bool can_tile;
uint32_t crtc_offset;
Expand Down
14 changes: 5 additions & 9 deletions drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
Original file line number Diff line number Diff line change
Expand Up @@ -2533,6 +2533,11 @@ static void dce_v10_0_cursor_reset(struct drm_crtc *crtc)
}
}

/*
* TODO: drm_fb_helper_setcmap() prev commit v4.12-rc7-1385-g964c60063bff
* ("drm/fb-helper: separate the fb_setcmap helper into atomic and legacy paths")
* don't work as expected.
*/
#if defined(HAVE_STRUCT_DRM_CRTC_FUNCS_GAMMA_SET_6ARGS)
static int dce_v10_0_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
u16 *blue, uint32_t size,
Expand All @@ -2554,15 +2559,6 @@ static int dce_v10_0_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
static void dce_v10_0_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
u16 *blue, uint32_t start, uint32_t size)
{
struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
int end = (start + size > 256) ? 256 : start + size, i;

/* userspace palettes are always correct as is */
for (i = start; i < end; i++) {
amdgpu_crtc->lut_r[i] = red[i] >> 6;
amdgpu_crtc->lut_g[i] = green[i] >> 6;
amdgpu_crtc->lut_b[i] = blue[i] >> 6;
}
dce_v10_0_crtc_load_lut(crtc);
}
#endif
Expand Down
14 changes: 5 additions & 9 deletions drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
Original file line number Diff line number Diff line change
Expand Up @@ -2612,6 +2612,11 @@ static void dce_v11_0_cursor_reset(struct drm_crtc *crtc)
}
}

/*
* TODO: drm_fb_helper_setcmap() prev commit v4.12-rc7-1385-g964c60063bff
* ("drm/fb-helper: separate the fb_setcmap helper into atomic and legacy paths")
* don't work as expected.
*/
#if defined(HAVE_STRUCT_DRM_CRTC_FUNCS_GAMMA_SET_6ARGS)
static int dce_v11_0_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
u16 *blue, uint32_t size,
Expand All @@ -2633,15 +2638,6 @@ static int dce_v11_0_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
static void dce_v11_0_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
u16 *blue, uint32_t start, uint32_t size)
{
struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
int end = (start + size > 256) ? 256 : start + size, i;

/* userspace palettes are always correct as is */
for (i = start; i < end; i++) {
amdgpu_crtc->lut_r[i] = red[i] >> 6;
amdgpu_crtc->lut_g[i] = green[i] >> 6;
amdgpu_crtc->lut_b[i] = blue[i] >> 6;
}
dce_v11_0_crtc_load_lut(crtc);
}
#endif
Expand Down
14 changes: 5 additions & 9 deletions drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
Original file line number Diff line number Diff line change
Expand Up @@ -2435,6 +2435,11 @@ static void dce_v6_0_cursor_reset(struct drm_crtc *crtc)
}
}

/*
* TODO: drm_fb_helper_setcmap() prev commit v4.12-rc7-1385-g964c60063bff
* ("drm/fb-helper: separate the fb_setcmap helper into atomic and legacy paths")
* don't work as expected.
*/
#if defined(HAVE_STRUCT_DRM_CRTC_FUNCS_GAMMA_SET_6ARGS)
static int dce_v6_0_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
u16 *blue, uint32_t size,
Expand All @@ -2456,15 +2461,6 @@ static int dce_v6_0_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
static void dce_v6_0_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
u16 *blue, uint32_t start, uint32_t size)
{
struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
int end = (start + size > 256) ? 256 : start + size, i;

/* userspace palettes are always correct as is */
for (i = start; i < end; i++) {
amdgpu_crtc->lut_r[i] = red[i] >> 6;
amdgpu_crtc->lut_g[i] = green[i] >> 6;
amdgpu_crtc->lut_b[i] = blue[i] >> 6;
}
dce_v6_0_crtc_load_lut(crtc);
}
#endif
Expand Down
14 changes: 5 additions & 9 deletions drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
Original file line number Diff line number Diff line change
Expand Up @@ -2433,6 +2433,11 @@ static void dce_v8_0_cursor_reset(struct drm_crtc *crtc)
}
}

/*
* TODO: drm_fb_helper_setcmap() prev commit v4.12-rc7-1385-g964c60063bff
* ("drm/fb-helper: separate the fb_setcmap helper into atomic and legacy paths")
* don't work as expected.
*/
#if defined(HAVE_STRUCT_DRM_CRTC_FUNCS_GAMMA_SET_6ARGS)
static int dce_v8_0_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
u16 *blue, uint32_t size,
Expand All @@ -2454,15 +2459,6 @@ static int dce_v8_0_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
static void dce_v8_0_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
u16 *blue, uint32_t start, uint32_t size)
{
struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
int end = (start + size > 256) ? 256 : start + size, i;

/* userspace palettes are always correct as is */
for (i = start; i < end; i++) {
amdgpu_crtc->lut_r[i] = red[i] >> 6;
amdgpu_crtc->lut_g[i] = green[i] >> 6;
amdgpu_crtc->lut_b[i] = blue[i] >> 6;
}
dce_v8_0_crtc_load_lut(crtc);
}
#endif
Expand Down
9 changes: 0 additions & 9 deletions drivers/gpu/drm/amd/amdgpu/dce_virtual.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,6 @@ static int dce_virtual_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *gree
static void dce_virtual_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
u16 *blue, uint32_t start, uint32_t size)
{
struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
int end = (start + size > 256) ? 256 : start + size, i;

/* userspace palettes are always correct as is */
for (i = start; i < end; i++) {
amdgpu_crtc->lut_r[i] = red[i] >> 6;
amdgpu_crtc->lut_g[i] = green[i] >> 6;
amdgpu_crtc->lut_b[i] = blue[i] >> 6;
}
}
#endif

Expand Down

0 comments on commit beab110

Please sign in to comment.