Skip to contentSkip to conversation

drm/msm: CONFIG_MSM_OCMEM?

DISCUSSION Paul Bolle 2 participants 3 messages Feb 11, 2014 Arm Qualcomm mailing list

lore
Share & tools
lore

Paul Bolle

author
#0 lore raw

Rob,

Commit 55459968176f ("drm/msm: add a330/apq8x74") added preprocessor checks for CONFIG_MSM_OCMEM. But I couldn't find a Kconfig symbol MSM_OCMEM (nor a preprocessor define for a macro of that name). Why were those preprocessor checks added?

Please note that lines 197-201 currently read:

    /* Set the OCMEM base address for A330, etc */
    if (a3xx_gpu->ocmem_hdl) {
            gpu_write(gpu, REG_A3XX_RB_GMEM_BASE_ADDR,
                    (unsigned int)(a3xx_gpu->ocmem_base >> 14));
    }

ocmem_hdl and ocmem_base are used uninitialized here, aren't they? So it seems these lines should be wrapped with a preprocessor check for CONFIG_MSM_OCMEM too.

Paul Bolle

#1 lore raw
Quoted 6 lines · Paul Bolle

Rob,

Commit 55459968176f ("drm/msm: add a330/apq8x74") added preprocessor checks for CONFIG_MSM_OCMEM. But I couldn't find a Kconfig symbol MSM_OCMEM (nor a preprocessor define for a macro of that name). Why were those preprocessor checks added?

At the moment, CONFIG_MSM_OCMEM is only in downstream kernel.. not 100% sure about how we'll handle that upstream when there is more than just drm/msm using OCMEM (which can be shared between gpu, video enc/dec, etc).

Quoted 10 lines

Please note that lines 197-201 currently read:

    /* Set the OCMEM base address for A330, etc */
    if (a3xx_gpu->ocmem_hdl) {
            gpu_write(gpu, REG_A3XX_RB_GMEM_BASE_ADDR,
                    (unsigned int)(a3xx_gpu->ocmem_base >> 14));
    }

ocmem_hdl and ocmem_base are used uninitialized here, aren't they? So it seems these lines should be wrapped with a preprocessor check for CONFIG_MSM_OCMEM too.

in this case ocmem_hdl will be NULL (since a3xx_gpu is kzalloc'd). The #ifdef's could be added here, but not required.

BR,
-R

Quoted 3 lines

Paul Bolle

author
#2 lore raw
Quoted 10 lines · Rob Clark
Quoted 4 lines · Paul Bolle

Commit 55459968176f ("drm/msm: add a330/apq8x74") added preprocessor checks for CONFIG_MSM_OCMEM. But I couldn't find a Kconfig symbol MSM_OCMEM (nor a preprocessor define for a macro of that name). Why were those preprocessor checks added?

At the moment, CONFIG_MSM_OCMEM is only in downstream kernel.. not 100% sure about how we'll handle that upstream when there is more than just drm/msm using OCMEM (which can be shared between gpu, video enc/dec, etc).

I see. (Wouldn't that be an upstream kernel, actually?)

Quoted 7 lines
Quoted 7 lines

Please note that lines 197-201 currently read:

    /* Set the OCMEM base address for A330, etc */
    if (a3xx_gpu->ocmem_hdl) {
            gpu_write(gpu, REG_A3XX_RB_GMEM_BASE_ADDR,
                    (unsigned int)(a3xx_gpu->ocmem_base >> 14));
    }
Quoted 6 lines
Quoted 3 lines

ocmem_hdl and ocmem_base are used uninitialized here, aren't they? So it seems these lines should be wrapped with a preprocessor check for CONFIG_MSM_OCMEM too.

in this case ocmem_hdl will be NULL (since a3xx_gpu is kzalloc'd). The #ifdef's could be added here, but not required.

I missed that. So whether or not to #ifdef this would be mostly a matter of style.

Thanks,

Paul Bolle