diff options
author | james qian wang (Arm Technology China) <james.qian.wang@arm.com> | 2019-01-22 12:12:02 +0100 |
---|---|---|
committer | Liviu Dudau <Liviu.Dudau@arm.com> | 2019-05-07 12:26:04 +0200 |
commit | 8c134d13a07884048756dc5de7cd4526b440483b (patch) | |
tree | c0b100af37be429228e5871a6a721021ae265178 /drivers/gpu/drm/arm | |
parent | drm/komeda: Add sysfs attribute: core_id and config_id (diff) | |
download | linux-8c134d13a07884048756dc5de7cd4526b440483b.tar.xz linux-8c134d13a07884048756dc5de7cd4526b440483b.zip |
drm/komeda: Expose bus_width to Komeda-CORE
CHIP set bus_width according to the HW configuration, and CORE will use
it as buffer alignment.
v2: Rebase
Signed-off-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com>
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
Diffstat (limited to 'drivers/gpu/drm/arm')
-rw-r--r-- | drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/arm/display/komeda/komeda_kms.c | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c b/drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c index b01b628019ba..34506ef7ad40 100644 --- a/drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c +++ b/drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c @@ -520,6 +520,7 @@ d71_identify(u32 __iomem *reg_base, struct komeda_chip_info *chip) chip->arch_id = malidp_read32(reg_base, GLB_ARCH_ID); chip->core_id = malidp_read32(reg_base, GLB_CORE_ID); chip->core_info = malidp_read32(reg_base, GLB_CORE_INFO); + chip->bus_width = D71_BUS_WIDTH_16_BYTES; return &d71_chip_funcs; } diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c index e8573b03021f..86f6542afb40 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c @@ -26,10 +26,10 @@ static int komeda_gem_cma_dumb_create(struct drm_file *file, struct drm_device *dev, struct drm_mode_create_dumb *args) { - u32 alignment = 16; /* TODO get alignment from dev */ + struct komeda_dev *mdev = dev->dev_private; + u32 pitch = DIV_ROUND_UP(args->width * args->bpp, 8); - args->pitch = ALIGN(DIV_ROUND_UP(args->width * args->bpp, 8), - alignment); + args->pitch = ALIGN(pitch, mdev->chip.bus_width); return drm_gem_cma_dumb_create_internal(file, dev, args); } |